Created
December 10, 2019 03:26
-
-
Save shenxianpeng/a277aaa464f614574b24750460b20803 to your computer and use it in GitHub Desktop.
Jenkins groovy snippet-01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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