4 - 'apex-verify-{stream}'
5 - 'apex-merge-{stream}'
6 - 'apex-build-{stream}'
7 - 'apex-deploy-virtual-{stream}'
8 - 'apex-deploy-baremetal-{stream}'
9 - 'apex-daily-{stream}'
11 # stream: branch with - in place of / (eg. stable-arno)
12 # branch: branch (eg. stable/arno)
18 branch: 'stable/brahmaputra'
19 gs-pathname: '/brahmaputra'
24 name: 'apex-verify-{stream}'
30 gs-pathname: '{gs-pathname}'
31 ARTIFACT_VERSION: 'dev'
38 default: https://gerrit.opnfv.org/gerrit/$PROJECT
39 description: "Used for overriding the GIT URL coming from parameters macro."
43 credentials-id: '{ssh-credentials}'
44 refspec: '$GERRIT_REFSPEC'
45 choosing-strategy: 'gerrit'
50 - patchset-created-event:
51 exclude-drafts: 'false'
52 exclude-trivial-rebase: 'false'
53 exclude-no-code-change: 'false'
54 - draft-published-event
55 - comment-added-contains-event:
56 comment-contains-value: 'recheck'
57 - comment-added-contains-event:
58 comment-contains-value: 'reverify'
60 - project-compare-type: 'ANT'
61 project-pattern: 'apex'
63 - branch-compare-type: 'ANT'
64 branch-pattern: '**/master'
80 use-build-blocker: true
88 - 'apex-deploy-virtual'
89 - 'apex-workspace-cleanup'
92 name: 'apex-merge-{stream}'
94 # builder-merge job to run JJB update
96 # This job's purpose is to update all the JJB
104 gs-pathname: '{gs-pathname}'
111 default: https://gerrit.opnfv.org/gerrit/$PROJECT
112 description: "Used for overriding the GIT URL coming from parameters macro."
115 - gerrit-trigger-scm:
116 credentials-id: '{ssh-credentials}'
118 choosing-strategy: 'default'
123 - change-merged-event
124 - comment-added-contains-event:
125 comment-contains-value: 'remerge'
127 - project-compare-type: 'ANT'
128 project-pattern: 'apex'
130 - branch-compare-type: 'ANT'
131 branch-pattern: '**/master'
132 forbidden-file-paths:
138 - 'apex-deploy-virtual'
139 - 'apex-workspace-cleanup'
142 name: 'apex-build-{stream}'
144 # Job template for builds
146 # Required Variables:
147 # stream: branch with - in place of / (eg. stable)
148 # branch: branch (eg. stable)
157 gs-pathname: '{gs-pathname}'
162 default: https://gerrit.opnfv.org/gerrit/$PROJECT
163 description: "Used for overriding the GIT URL coming from parameters macro."
167 credentials-id: '{ssh-credentials}'
173 use-build-blocker: true
179 - 'apex-deploy-virtual'
180 - 'apex-upload-artifact'
181 - 'apex-workspace-cleanup'
184 name: 'apex-deploy-virtual-{stream}'
186 # Job template for virtual deployment
188 # Required Variables:
189 # stream: branch with - in place of / (eg. stable)
190 # branch: branch (eg. stable)
197 credentials-id: '{ssh-credentials}'
205 gs-pathname: '{gs-pathname}'
209 use-build-blocker: true
216 - 'apex-deploy-virtual'
217 - 'apex-workspace-cleanup'
220 name: 'apex-deploy-baremetal-{stream}'
222 # Job template for baremetal deployment
224 # Required Variables:
225 # stream: branch with - in place of / (eg. stable)
226 # branch: branch (eg. stable)
233 credentials-id: '{ssh-credentials}'
241 gs-pathname: '{gs-pathname}'
245 use-build-blocker: true
253 - 'apex-deploy-baremetal'
254 - 'apex-workspace-cleanup'
257 name: 'apex-daily-{stream}'
259 # Job template for daily build
261 # Required Variables:
262 # stream: branch with - in place of / (eg. stable)
263 # branch: branch (eg. stable)
270 credentials-id: '{ssh-credentials}'
278 gs-pathname: '{gs-pathname}'
282 use-build-blocker: true
293 - project: 'apex-build-{stream}'
297 - project: 'apex-deploy-baremetal-{stream}'
301 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
304 build-step-failure-threshold: 'never'
305 failure-threshold: 'never'
306 unstable-threshold: 'FAILURE'
308 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
311 build-step-failure-threshold: 'never'
312 failure-threshold: 'never'
313 unstable-threshold: 'FAILURE'
315 ########################
317 ########################
324 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
326 name: ARTIFACT_VERSION
328 description: "Artifact version type"
330 name: BUILD_DIRECTORY
331 default: $WORKSPACE/build_output
332 description: "Directory where the build artifact will be located upon the completion of the build."
334 name: CACHE_DIRECTORY
335 default: $HOME/opnfv/cache{gs-pathname}
336 description: "Directory where the cache to be used during the build is located."
339 default: https://gerrit.opnfv.org/gerrit/$PROJECT
340 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
343 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
344 description: "URL to Google Storage."
346 ########################
348 ########################
357 # log info to console
358 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
359 echo "---------------------------------------------------------------------------------------"
361 # create the cache directory if it doesn't exist
362 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
363 # set OPNFV_ARTIFACT_VERSION
364 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
365 export OPNFV_ARTIFACT_VERSION="bramaputra.1.rc0"
367 if [ "$ARTIFACT_VERSION" == "dev" ]; then
368 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
369 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
370 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
372 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
377 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
378 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
379 # list the contents of BUILD_OUTPUT directory
380 ls -al $BUILD_DIRECTORY
381 # save information regarding artifact into file
383 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
384 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
385 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
386 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
387 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
388 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
389 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
390 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
391 echo "OPNFV_BUILD_URL=$BUILD_URL"
392 ) > $WORKSPACE/opnfv.properties
394 echo "--------------------------------------------------------"
397 name: 'apex-workspace-cleanup'
405 # delete everything that is in $WORKSPACE
406 /bin/rm -rf $WORKSPACE
409 name: 'apex-upload-artifact'
417 # log info to console
418 echo "Uploading the Apex artifact. This could take some time..."
419 echo "--------------------------------------------------------"
422 # source the opnfv.properties to get ARTIFACT_VERSION
423 source $WORKSPACE/opnfv.properties
425 # upload artifact and additional files to google storage
426 gsutil cp $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso > gsutil.iso.log 2>&1
427 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL) gs://$GS_URL/$(basename $OPNFV_RPM_URL) > gsutil.iso.log 2>&1
428 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL) gs://$GS_URL/$(basename $OPNFV_SRPM_URL) > gsutil.iso.log 2>&1
429 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
430 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
433 echo "--------------------------------------------------------"
435 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
436 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
439 name: 'apex-deploy-virtual'
447 # log info to console
448 echo "Starting the Apex virtual deployment."
449 echo "--------------------------------------------------------"
452 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
453 # if artifact name is passed the pull a
454 # specific artifact from artifacts.opnfv.org
455 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
457 if [[ -f opnfv.properties ]]; then
458 # if opnfv.properties exists then use the
459 # local build. Source the file so we get local OPNFV vars
460 source opnfv.properties
461 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
463 # no opnfv.properties means use the latest from artifacts.opnfv.org
464 # get the latest.properties to get the link to the latest artifact
465 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
466 [[ -f opnfv.properties ]] || exit 1
467 # source the file so we get OPNFV vars
468 source opnfv.properties
469 RPM_INSTALL_PATH=$OPNFV_RPM_URL
473 source opnfv.properties
474 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
476 # update / install the new rpm
477 if rpm -q opnfv-apex > /dev/null; then
478 if sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
479 sudo yum downgrade -y $RPM_INSTALL_PATH;
482 sudo yum install -y $RPM_INSTALL_PATH;
485 # cleanup virtual machines before we start
487 # initiate virtual deployment
488 if [ -e /usr/share/doc/opnfv/network_settings.yaml.example ]; then
489 sudo opnfv-deploy -v -d /usr/share/doc/opnfv/deploy_settings.yaml.example -n /usr/share/doc/opnfv/network_settings.yaml.example
494 echo "--------------------------------------------------------"
498 name: 'apex-deploy-baremetal'
506 # log info to console
507 echo "Starting the Apex baremetal deployment."
508 echo "--------------------------------------------------------"
511 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
512 # if artifact name is passed the pull a
513 # specific artifact from artifacts.opnfv.org
514 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
516 if [[ -f opnfv.properties ]]; then
517 # if opnfv.properties exists then use the
518 # local build. Source the file so we get local OPNFV vars
519 source opnfv.properties
520 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
522 # no opnfv.properties means use the latest from artifacts.opnfv.org
523 # get the latest.properties to get the link to the latest artifact
524 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
525 [[ -f opnfv.properties ]] || exit 1
526 # source the file so we get OPNFV vars
527 source opnfv.properties
528 RPM_INSTALL_PATH=$OPNFV_RPM_URL
532 source opnfv.properties
533 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
534 if [ ! -e "$RPM_INSTALL_PATH" ]; then
535 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
538 # update / install the new rpm
539 if rpm -q opnfv-apex > /dev/null; then
540 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
541 echo "RPM is already installed"
542 elif sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
543 sudo yum downgrade -y $RPM_INSTALL_PATH;
546 sudo yum install -y $RPM_INSTALL_PATH;
549 # cleanup environment before we start
551 # initiate baremetal deployment
552 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
553 -d /usr/share/doc/opnfv/deploy_settings.yaml.example \
554 -n /root/network/network_settings.yaml
557 echo "--------------------------------------------------------"
560 #######################
562 ########################