11#! /usr/bin/env groovy
2+ @Library (" product-pipelines-shared-library" ) _
23
34pipeline {
4- agent { label ' executor-v2 ' }
5+ agent { label ' conjur-enterprise-common-agent ' }
56
67 options {
78 timestamps()
@@ -13,45 +14,57 @@ pipeline {
1314 }
1415
1516 stages {
17+ stage(' Get InfraPool Agent' ) {
18+ steps {
19+ script {
20+ INFRAPOOL_EXECUTORV2_AGENT_0 = getInfraPoolAgent. connected(type : " ExecutorV2" , quantity : 1 , duration : 1 )[0 ]
21+ }
22+ }
23+ }
24+
1625 stage(' Validate' ) {
1726 parallel {
1827 stage(' Changelog' ) {
19- steps { parseChangelog() }
28+ steps { parseChangelog(INFRAPOOL_EXECUTORV2_AGENT_0 ) }
2029 }
2130 }
2231 }
2332
2433 stage(' Prepare build environment' ) {
2534 steps {
26- sh '''
27- # make sure the build env is up to date
28- make -C docker
35+ script {
36+ INFRAPOOL_EXECUTORV2_AGENT_0 . agentSh '''
37+ # make sure the build env is up to date
38+ make -C docker
2939
30- TAG=`cat docker/tag`
40+ TAG=`cat docker/tag`
3141
32- if [ -z `docker images -q $TAG` ]; then
33- # the image is not present, so pull or build
34- docker pull $TAG || make -C docker rebuild
35- fi
36- '''
42+ if [ -z `docker images -q $TAG` ]; then
43+ # the image is not present, so pull or build
44+ docker pull $TAG || make -C docker rebuild
45+ fi
46+ '''
47+ }
3748 }
3849 }
3950
4051 stage(' Build and test package' ) {
4152 steps {
4253 script {
4354 BUILD_NAME = " ${ env.BUILD_NUMBER} -${ env.BRANCH_NAME.replace('/','-')} "
44- sh " summon -e pipeline ./build.sh ${ BUILD_NAME} "
55+ INFRAPOOL_EXECUTORV2_AGENT_0 . agentSh " summon -e pipeline ./build.sh ${ BUILD_NAME} "
56+ INFRAPOOL_EXECUTORV2_AGENT_0 . agentStash name : ' test-results' , includes : ' *.xml'
57+ unstash ' test-results'
58+ junit ' TestResults.xml'
59+ INFRAPOOL_EXECUTORV2_AGENT_0 . agentArchiveArtifacts artifacts : ' bin/*' , fingerprint : true
4560 }
46- junit ' TestResults.xml'
47- archiveArtifacts artifacts : ' bin/*' , fingerprint : true
4861 }
4962 }
5063 }
5164
5265 post {
5366 always {
54- cleanupAndNotify(currentBuild . currentResult )
67+ releaseInfraPoolAgent( " .infrapool/release_agents " )
5568 }
5669 }
5770}
0 commit comments