1 # this is the job configuration for bgs
10 - 'compass-verify-on-ericsson-node'
12 - 'compass-daily-{stream}'
14 - 'compass-deploy-virtual-{flavor}'
16 # stream: branch with - in place of / (eg. stable-helium)
17 # branch: branch (eg. stable/helium)
27 conf: 'virtual_cluster'
32 project: 'compass4nfv'
34 ########################
36 ########################
38 name: 'compass-verify-on-ericsson-node'
40 project-type: freestyle
49 artifactDaysToKeep: -1
58 installer: '{installer}'
62 credentials-id: '{ssh-credentials}'
63 refspec: '$GERRIT_REFSPEC'
64 choosing-strategy: 'gerrit'
67 - ssh-agent-credentials:
68 user: '{ssh-credentials}'
73 - patchset-created-event:
74 exclude-drafts: 'false'
75 exclude-trivial-rebase: 'false'
76 exclude-no-code-change: 'false'
77 - draft-published-event
78 - comment-added-contains-event:
79 comment-contains-value: 'recheck'
80 - comment-added-contains-event:
81 comment-contains-value: 'reverify'
83 - project-compare-type: 'ANT'
84 project-pattern: '{project}'
86 - branch-compare-type: 'ANT'
87 branch-pattern: '**/master'
94 - 'compass-workspace-cleanup'
97 name: 'compass-verify'
99 project-type: freestyle
108 artifactDaysToKeep: -1
109 artifactNumToKeep: -1
117 installer: '{installer}'
120 default: 'virtual_cluster'
123 - gerrit-trigger-scm:
124 credentials-id: '{ssh-credentials}'
125 refspec: '$GERRIT_REFSPEC'
126 choosing-strategy: 'gerrit'
129 - ssh-agent-credentials:
130 user: '{ssh-credentials}'
135 - patchset-created-event:
136 exclude-drafts: 'false'
137 exclude-trivial-rebase: 'false'
138 exclude-no-code-change: 'false'
139 - draft-published-event
140 - comment-added-contains-event:
141 comment-contains-value: 'recheck'
142 - comment-added-contains-event:
143 comment-contains-value: 'reverify'
145 - project-compare-type: 'ANT'
146 project-pattern: '{project}'
148 - branch-compare-type: 'ANT'
149 branch-pattern: '**/master'
150 forbidden-file-paths:
156 # - 'compass-deploy-virtual-flavor'
157 # - 'compass-backup-logs'
160 # artifacts: 'ansible.log'
161 # allow-empty: 'true'
165 name: 'compass-merge'
167 # builder-merge job to run JJB update
169 # This job's purpose is to update all the JJB
171 project-type: freestyle
178 artifactDaysToKeep: -1
187 installer: '{installer}'
190 - gerrit-trigger-scm:
191 credentials-id: '{ssh-credentials}'
193 choosing-strategy: 'default'
196 - ssh-agent-credentials:
197 user: '{ssh-credentials}'
202 - change-merged-event
203 - comment-added-contains-event:
204 comment-contains-value: 'remerge'
206 - project-compare-type: 'ANT'
207 project-pattern: '{project}'
209 - branch-compare-type: 'ANT'
210 branch-pattern: '**/master'
215 name: 'compass-daily-{stream}'
217 project-type: freestyle
225 installer: '{installer}'
229 credentials-id: '{ssh-credentials}'
234 - pollscm: '@midnight'
239 artifactDaysToKeep: -1
240 artifactNumToKeep: -1
244 #- 'compass-upload-artifact'
245 #- 'compass-workspace-cleanup'
248 echo "compass-deploy-virtual job will be triggered!"
252 project: 'compass-build'
255 project: 'compass-deploy-virtual-cluster'
259 name: 'compass-build'
261 project-type: freestyle
268 artifactDaysToKeep: -1
269 artifactNumToKeep: -1
275 installer: '{installer}'
279 credentials-id: '{ssh-credentials}'
286 - 'compass-upload-artifact'
287 - 'compass-workspace-cleanup'
290 name: 'compass-deploy-virtual-{flavor}'
292 project-type: freestyle
302 installer: '{installer}'
309 - pollscm: "H/2 * * * *"
314 artifactDaysToKeep: -1
315 artifactNumToKeep: -1
318 - 'compass-ci-preclean-workspace'
319 - 'compass-download-artifact'
320 - 'compass-deploy-virtual-flavor'
321 - 'compass-backup-logs'
324 artifacts: 'ansible.log'
328 ########################
330 ########################
332 name: compass-parameter
336 default: '{installer}'
337 description: "Installer to use."
339 name: BUILD_DIRECTORY
340 default: $WORKSPACE/build_output
341 description: "Directory where the build artifact will be located upon the completion of the build."
343 name: CACHE_DIRECTORY
344 default: $HOME/opnfv/cache/$PROJECT
345 description: "Directory where the cache to be used during the build is located."
348 default: https://gerrit.opnfv.org/gerrit/$PROJECT
349 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
352 default: artifacts.opnfv.org/$PROJECT/
353 description: "URL to Google Storage."
356 default: build.opnfv.org/artifacts/$PROJECT/
357 description: "URL to Google Storage proxy"
359 name: INTERNAL_REPO_XA
360 default: "root@192.168.127.11:~/xh/work/build/work"
361 description: "Artifact Repository"
368 default: "http://58.251.166.184:9999"
371 default: "$WORKSPACE/work/repo/"
373 ########################
375 ########################
384 name: 'compass-make-ppa'
397 for i in `find *.gz *.iso *.img -type f`
399 md5="md5sum $i | cut -d ' ' -f1"
403 for i in `find *.* -type f`
409 name: 'compass-build'
417 # log info to console
418 echo "Starting the build of $INSTALLER. This could take some time..."
419 echo "--------------------------------------------------------"
422 # create the cache directory if it doesn't exist
423 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
424 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
426 # set OPNFV_ARTIFACT_VERSION
427 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
432 cp $PPA_CACHE/*.tar.gz $PPA_CACHE/*.iso $PPA_CACHE/*.img $CACHE_DIRECTORY/ -f
436 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
438 # list the build artifacts
439 ls -al $BUILD_DIRECTORY
441 # save information regarding artifact into file
443 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
444 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
445 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
446 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
447 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
448 echo "OPNFV_BUILD_URL=$BUILD_URL"
449 ) > $BUILD_DIRECTORY/opnfv.properties
451 echo "--------------------------------------------------------"
455 name: 'compass-deploy-virtual-flavor'
464 # log info to console
465 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
466 echo "--------------------------------------------------------"
469 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
471 ./deploy.sh $FLAVOR_CONF
474 echo "--------------------------------------------------------"
478 name: 'compass-upload-artifact'
486 # log info to console
487 echo "Uploading the $INSTALLER artifact. This could take some time..."
488 echo "--------------------------------------------------------"
491 # source the opnfv.properties to get ARTIFACT_VERSION
492 source $BUILD_DIRECTORY/opnfv.properties
494 # upload artifact and additional files to google storage
495 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
496 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
497 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
501 echo "--------------------------------------------------------"
503 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
506 name: 'compass-download-artifact'
514 # log info to console
515 echo "Downloading the $INSTALLER artifact. This could take some time..."
516 echo "--------------------------------------------------------"
519 # get the latest.properties file in order to get info regarding latest artifact
520 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
522 # check if we got the file
523 [[ -f latest.properties ]] || exit 1
525 # source the file so we get OPNFV vars
526 source latest.properties
529 curl -s -o $WORKSPACE/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
532 ls -al $WORKSPACE/compass.iso
535 echo "--------------------------------------------------------"
539 name: 'compass-workspace-cleanup'
547 # delete everything that is in $WORKSPACE
548 /bin/rm -rf $WORKSPACE
551 name: 'compass-ci-preclean-workspace'
560 sudo rm $WORKSPACE -rf
561 git clone $GIT_BASE $WORKSPACE
564 name: 'compass-backup-logs'
567 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
568 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null