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-iso'
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-ppa'
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}'
317 - timed: 'H 4-18/2 * * *'
320 - 'builder-compass-make-ppa'
323 name: 'compass-deploy-virtual-{flavor}'
325 project-type: freestyle
335 installer: '{installer}'
342 - pollscm: "H/2 * * * *"
347 artifactDaysToKeep: -1
348 artifactNumToKeep: -1
351 - 'builder-compass-ci-preclean-workspace'
352 - 'builder-compass-download-artifact'
353 - 'builder-compass-deploy-virtual-flavor'
354 - 'builder-compass-backup-logs'
357 artifacts: 'ansible.log'
361 ########################
363 ########################
365 name: compass-parameter
369 default: '{installer}'
370 description: "Installer to use."
372 name: BUILD_DIRECTORY
373 default: $WORKSPACE/build_output
374 description: "Directory where the build artifact will be located upon the completion of the build."
376 name: CACHE_DIRECTORY
377 default: $HOME/opnfv/cache/$PROJECT
378 description: "Directory where the cache to be used during the build is located."
381 default: https://gerrit.opnfv.org/gerrit/$PROJECT
382 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
385 default: artifacts.opnfv.org/$PROJECT/
386 description: "URL to Google Storage."
389 default: build.opnfv.org/artifacts/$PROJECT/
390 description: "URL to Google Storage proxy"
392 name: INTERNAL_REPO_XA
393 default: "root@192.168.127.11:~/xh/work/build/work"
394 description: "Artifact Repository"
401 default: "http://58.251.166.184:9999"
404 default: "$WORKSPACE/work/repo/"
406 ########################
408 ########################
410 name: 'builder-compass-merge'
417 name: 'builder-compass-make-ppa'
430 for i in $(find *.gz *.iso *.img -type f)
432 md5=$(md5sum $i | cut -d ' ' -f1)
436 for i in $(find *.gz *.iso *.img *.md5 -type f)
442 name: 'builder-compass-build-iso'
450 # log info to console
451 echo "Starting the build of $INSTALLER. This could take some time..."
452 echo "--------------------------------------------------------"
455 # create the cache directory if it doesn't exist
456 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
457 [[ -d $BUILD_DIRECTORY ]] || mkdir -p $BUILD_DIRECTORY
459 # set OPNFV_ARTIFACT_VERSION
460 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
465 cp $PPA_CACHE/*.tar.gz $PPA_CACHE/*.iso $PPA_CACHE/*.img $CACHE_DIRECTORY/ -f
469 ./build.sh --iso-dir $BUILD_DIRECTORY/ --iso-name compass.iso -c $CACHE_DIRECTORY
471 # list the build artifacts
472 ls -al $BUILD_DIRECTORY
474 # save information regarding artifact into file
476 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
477 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
478 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
479 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
480 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/compass.iso | cut -d' ' -f1)"
481 echo "OPNFV_BUILD_URL=$BUILD_URL"
482 ) > $BUILD_DIRECTORY/opnfv.properties
484 echo "--------------------------------------------------------"
488 name: 'builder-compass-deploy-virtual-flavor'
497 # log info to console
498 echo "Starting the deployment on virtual environment using $INSTALLER. This could take some time..."
499 echo "--------------------------------------------------------"
502 export ISO_URL=file://$BUILD_DIRECTORY/compass.iso
504 ./deploy.sh $FLAVOR_CONF
507 echo "--------------------------------------------------------"
511 name: 'builder-compass-upload-artifact'
519 # log info to console
520 echo "Uploading the $INSTALLER artifact. This could take some time..."
521 echo "--------------------------------------------------------"
524 # source the opnfv.properties to get ARTIFACT_VERSION
525 source $BUILD_DIRECTORY/opnfv.properties
527 # upload artifact and additional files to google storage
528 gsutil cp $BUILD_DIRECTORY/compass.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
529 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
530 gsutil cp $BUILD_DIRECTORY/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
534 echo "--------------------------------------------------------"
536 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
539 name: 'builder-compass-download-artifact'
547 # log info to console
548 echo "Downloading the $INSTALLER artifact. This could take some time..."
549 echo "--------------------------------------------------------"
552 # get the latest.properties file in order to get info regarding latest artifact
553 curl -s -o $WORKSPACE/latest.properties http://$GS_URL/latest.properties
555 # check if we got the file
556 [[ -f latest.properties ]] || exit 1
558 # source the file so we get OPNFV vars
559 source latest.properties
562 curl -s -o $WORKSPACE/compass.iso http://$OPNFV_ARTIFACT_URL > gsutil.iso.log 2>&1
565 ls -al $WORKSPACE/compass.iso
568 echo "--------------------------------------------------------"
572 name: 'builder-compass-workspace-cleanup'
580 # delete everything that is in $WORKSPACE
581 /bin/rm -rf $WORKSPACE
584 name: 'builder-compass-ci-preclean-workspace'
593 sudo rm $WORKSPACE -rf
594 git clone $GIT_BASE $WORKSPACE
597 name: 'builder-compass-backup-logs'
600 ssh_options="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
601 sshpass -p root scp 2>/dev/null $ssh_options root@${installer_ip}:/var/ansible/run/openstack_juno-opnfv2/ansible.log ./ &> /dev/null