1 # this is the job configuration for bgs
10 - 'compass-verify-on-ericsson-node'
12 - 'compass-daily-{stream}'
15 - 'compass-deploy-virtual-{flavor}'
17 # stream: branch with - in place of / (eg. stable-helium)
18 # branch: branch (eg. stable/helium)
28 conf: 'virtual_cluster'
33 project: 'compass4nfv'
35 ########################
37 ########################
39 name: 'compass-verify-on-ericsson-node'
41 project-type: freestyle
50 artifactDaysToKeep: -1
59 installer: '{installer}'
63 credentials-id: '{ssh-credentials}'
64 refspec: '$GERRIT_REFSPEC'
65 choosing-strategy: 'gerrit'
68 - ssh-agent-credentials:
69 user: '{ssh-credentials}'
74 - patchset-created-event:
75 exclude-drafts: 'false'
76 exclude-trivial-rebase: 'false'
77 exclude-no-code-change: 'false'
78 - draft-published-event
79 - comment-added-contains-event:
80 comment-contains-value: 'recheck'
81 - comment-added-contains-event:
82 comment-contains-value: 'reverify'
84 - project-compare-type: 'ANT'
85 project-pattern: '{project}'
87 - branch-compare-type: 'ANT'
88 branch-pattern: '**/master'
94 - 'builder-compass-build-iso'
95 - 'builder-compass-workspace-cleanup'
98 name: 'compass-verify'
100 project-type: freestyle
109 artifactDaysToKeep: -1
110 artifactNumToKeep: -1
118 installer: '{installer}'
121 default: 'virtual_cluster'
124 - gerrit-trigger-scm:
125 credentials-id: '{ssh-credentials}'
126 refspec: '$GERRIT_REFSPEC'
127 choosing-strategy: 'gerrit'
130 - ssh-agent-credentials:
131 user: '{ssh-credentials}'
136 - patchset-created-event:
137 exclude-drafts: 'false'
138 exclude-trivial-rebase: 'false'
139 exclude-no-code-change: 'false'
140 - draft-published-event
141 - comment-added-contains-event:
142 comment-contains-value: 'recheck'
143 - comment-added-contains-event:
144 comment-contains-value: 'reverify'
146 - project-compare-type: 'ANT'
147 project-pattern: '{project}'
149 - branch-compare-type: 'ANT'
150 branch-pattern: '**/master'
151 forbidden-file-paths:
156 - 'builder-compass-build-iso'
157 # - 'builder-compass-deploy-virtual-flavor'
158 # - 'builder-compass-backup-logs'
161 # artifacts: 'ansible.log'
162 # allow-empty: 'true'
166 name: 'compass-merge'
168 # builder-merge job to run JJB update
170 # This job's purpose is to update all the JJB
172 project-type: freestyle
179 artifactDaysToKeep: -1
188 installer: '{installer}'
191 - gerrit-trigger-scm:
192 credentials-id: '{ssh-credentials}'
194 choosing-strategy: 'default'
197 - ssh-agent-credentials:
198 user: '{ssh-credentials}'
203 - change-merged-event
204 - comment-added-contains-event:
205 comment-contains-value: 'remerge'
207 - project-compare-type: 'ANT'
208 project-pattern: '{project}'
210 - branch-compare-type: 'ANT'
211 branch-pattern: '**/master'
213 - 'builder-compass-merge'
216 name: 'compass-daily-{stream}'
218 project-type: freestyle
226 installer: '{installer}'
230 credentials-id: '{ssh-credentials}'
235 - pollscm: '@midnight'
240 artifactDaysToKeep: -1
241 artifactNumToKeep: -1
244 #- 'builder-compass-build-iso'
245 #- 'builder-compass-upload-artifact'
246 #- 'builder-compass-workspace-cleanup'
249 echo "compass-deploy-virtual job will be triggered!"
253 project: 'compass-build'
256 project: 'compass-deploy-virtual-cluster'
260 name: 'compass-build-iso'
262 project-type: freestyle
269 artifactDaysToKeep: -1
270 artifactNumToKeep: -1
276 installer: '{installer}'
280 credentials-id: '{ssh-credentials}'
285 - 'builder-compass-build-iso'
286 - 'builder-compass-upload-artifact'
287 - 'builder-compass-workspace-cleanup'
290 name: 'compass-build'
292 description: "build ppa(using docker) in huawei lab"
294 project-type: freestyle
301 artifactDaysToKeep: -1
302 artifactNumToKeep: -1
308 installer: '{installer}'
312 credentials-id: '{ssh-credentials}'
318 - 'builder-compass-make-ppa'
320 - project: 'compass-build-iso'
325 name: 'compass-deploy-virtual-{flavor}'
327 project-type: freestyle
337 installer: '{installer}'
344 - pollscm: "H/2 * * * *"
349 artifactDaysToKeep: -1
350 artifactNumToKeep: -1
353 - 'builder-compass-ci-preclean-workspace'
354 - 'builder-compass-download-artifact'
355 - 'builder-compass-deploy-virtual-flavor'
356 - 'builder-compass-backup-logs'
359 artifacts: 'ansible.log'
363 ########################
365 ########################
367 name: compass-parameter
371 default: '{installer}'
372 description: "Installer to use."
374 name: BUILD_DIRECTORY
375 default: $WORKSPACE/build_output
376 description: "Directory where the build artifact will be located upon the completion of the build."
378 name: CACHE_DIRECTORY
379 default: $HOME/opnfv/cache/$PROJECT
380 description: "Directory where the cache to be used during the build is located."
383 default: https://gerrit.opnfv.org/gerrit/$PROJECT
384 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
387 default: artifacts.opnfv.org/$PROJECT/
388 description: "URL to Google Storage."
391 default: build.opnfv.org/artifacts/$PROJECT/
392 description: "URL to Google Storage proxy"
394 name: INTERNAL_REPO_XA
395 default: "root@192.168.127.11:~/xh/work/build/work"
396 description: "Artifact Repository"
403 default: "http://58.251.166.184:9999"
406 default: "$WORKSPACE/work/repo/"
408 ########################
410 ########################
412 name: 'builder-compass-merge'
419 name: 'builder-compass-make-ppa'
432 for i in `find *.gz *.iso *.img -type f`
434 md5=`md5sum $i | cut -d ' ' -f1`
438 for i in `find *.* -type f`
444 name: 'builder-compass-build-iso'
452 # log info to console
453 echo "Starting the build of $INSTALLER. This could take some time..."
454 echo "--------------------------------------------------------"
457 # create the cache directory if it doesn't exist
458 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
459 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
461 # set OPNFV_ARTIFACT_VERSION
462 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
467 cp $PPA_CACHE/*.tar.gz $PPA_CACHE/*.iso $PPA_CACHE/*.img $CACHE_DIRECTORY/ -f
471 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
473 # list the build artifacts
474 ls -al $BUILD_DIRECTORY
476 # save information regarding artifact into file
478 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
479 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
480 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
481 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
482 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
483 echo "OPNFV_BUILD_URL=$BUILD_URL"
484 ) > $BUILD_DIRECTORY/opnfv.properties
486 echo "--------------------------------------------------------"
490 name: 'builder-compass-deploy-virtual-flavor'
499 # log info to console
500 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
501 echo "--------------------------------------------------------"
504 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
506 ./deploy.sh $FLAVOR_CONF
509 echo "--------------------------------------------------------"
513 name: 'builder-compass-upload-artifact'
521 # log info to console
522 echo "Uploading the $INSTALLER artifact. This could take some time..."
523 echo "--------------------------------------------------------"
526 # source the opnfv.properties to get ARTIFACT_VERSION
527 source $BUILD_DIRECTORY/opnfv.properties
529 # upload artifact and additional files to google storage
530 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
531 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
532 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
536 echo "--------------------------------------------------------"
538 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
541 name: 'builder-compass-download-artifact'
549 # log info to console
550 echo "Downloading the $INSTALLER artifact. This could take some time..."
551 echo "--------------------------------------------------------"
554 # get the latest.properties file in order to get info regarding latest artifact
555 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
557 # check if we got the file
558 [[ -f latest.properties ]] || exit 1
560 # source the file so we get OPNFV vars
561 source latest.properties
564 curl -s -o $WORKSPACE/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
567 ls -al $WORKSPACE/compass.iso
570 echo "--------------------------------------------------------"
574 name: 'builder-compass-workspace-cleanup'
582 # delete everything that is in $WORKSPACE
583 /bin/rm -rf $WORKSPACE
586 name: 'builder-compass-ci-preclean-workspace'
595 sudo rm $WORKSPACE -rf
596 git clone $GIT_BASE $WORKSPACE
599 name: 'builder-compass-backup-logs'
602 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
603 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null