jenkins pipeline 使用遇到的问题

jenkins pipeline 使用遇到的问题

希望可以直接看到nexus中的war包列表, 以方便选择需要上线的war包版本

这里需要用到Extended Choice Parameter可以在插件中使用Choose Source for Value

//这是我要从nexus中找到我可能会需要用到的war或者tar包的代码, 具体语法不做解释
'curl http://nexus访问地址/service/rest/repository/browse/raw-pro/pipeline-APP/'.execute().text.readLines().collect{
  if(it.contains('pipeline-APP')){
    if(it.contains('.war')){
      String temp=it.split('.war')[1].split('">')[1]+".war"
      return temp
    }
    else if(it.contains('.tar.gz')){
      String temp=it.split('.tar.gz')[1].split('">')[1]+".tar.gz"
      return temp
    }
  }
}.findResults {it}
原文地址:https://www.cnblogs.com/peitianwang/p/11348076.html