Skip to content

Instantly share code, notes, and snippets.

@shenxianpeng
Created December 10, 2019 03:26
Show Gist options
  • Select an option

  • Save shenxianpeng/a277aaa464f614574b24750460b20803 to your computer and use it in GitHub Desktop.

Select an option

Save shenxianpeng/a277aaa464f614574b24750460b20803 to your computer and use it in GitHub Desktop.
Jenkins groovy snippet-01
def call(){
def labels = ['build-on-linux', 'build-on-aix', 'build-on-hpux', 'build-on-solaris']
def builders = [:]
def BLD = credentials("d1cbab74-823d-41aa-abb7")
def UNIX_BLD_FOLDER = '/disk1/agent/workspace/build'
for (x in labels){
def label = x
builders[label] = {
node(label){
stage("Clean WS"){
echo "NODE_NAME = ${env.NODE_NAME}"
cleanup.buildWs("ud", "\$BLD_PSW", "${UNIX_BLD_FOLDER}")
sh 'git checkout .'
}
stage("Full Build"){
checkout scm
dir('src/ud/packaging/unix'){
sh 'sh bld 1.0'
}
}
}
}
}
parallel builders
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment