Miscellaneous configuration optimization jenkins

  

path="${jenkinsProject.workspace}/backup/"
rollback=['bash', '-c', "ls -t1 ${path} "].execute().text.readLines()

if (action.equals("RollBack")) {
  return rollback
} else {
  return ["选择RollBack后显示"]
}

Here by  jenkinsProject.workspace the environment variables jenkins's  WORKSPACE.
Backup directory  WORKSPACE under the  backup  directory. You can specify other directories.

Conditional step conditional step

 

 

判断第一步中选择的操作类型,在回滚时跳过编译打包的步骤。

 

 

Guess you like

Origin www.cnblogs.com/lvcisco/p/12126498.html