4 - 'apex-verify-{stream}'
5 - 'apex-merge-{stream}'
6 - 'apex-build-{stream}'
7 - 'apex-deploy-virtual-{scenario}-{stream}'
8 - 'apex-deploy-baremetal-{scenario}-{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'
25 - 'os-odl_l2-nofeature-ha'
27 - 'os-odl_l3-nofeature-ha'
28 - 'os-onos-nofeature-ha'
29 - 'os-opencontrail-nofeature-ha'
32 name: 'apex-verify-{stream}'
38 gs-pathname: '{gs-pathname}'
45 default: https://gerrit.opnfv.org/gerrit/$PROJECT
46 description: "Used for overriding the GIT URL coming from parameters macro."
50 credentials-id: '{ssh-credentials}'
51 refspec: '$GERRIT_REFSPEC'
52 choosing-strategy: 'gerrit'
57 - patchset-created-event:
58 exclude-drafts: 'false'
59 exclude-trivial-rebase: 'false'
60 exclude-no-code-change: 'false'
61 - draft-published-event
62 - comment-added-contains-event:
63 comment-contains-value: 'recheck'
64 - comment-added-contains-event:
65 comment-contains-value: 'reverify'
67 - project-compare-type: 'ANT'
68 project-pattern: 'apex'
70 - branch-compare-type: 'ANT'
71 branch-pattern: '**/{branch}'
87 use-build-blocker: true
96 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
97 predefined-parameters:
98 BUILD_DIRECTORY=apex-verify-master/build_output
102 - project: 'apex-deploy-virtual-os-onos-nofeature-ha-{stream}'
103 predefined-parameters:
104 BUILD_DIRECTORY=apex-verify-master/build_output
107 - 'apex-workspace-cleanup'
110 name: 'apex-merge-{stream}'
112 # builder-merge job to run JJB update
114 # This job's purpose is to update all the JJB
122 gs-pathname: '{gs-pathname}'
129 default: https://gerrit.opnfv.org/gerrit/$PROJECT
130 description: "Used for overriding the GIT URL coming from parameters macro."
133 - gerrit-trigger-scm:
134 credentials-id: '{ssh-credentials}'
136 choosing-strategy: 'default'
141 - change-merged-event
142 - comment-added-contains-event:
143 comment-contains-value: 'remerge'
145 - project-compare-type: 'ANT'
146 project-pattern: 'apex'
148 - branch-compare-type: 'ANT'
149 branch-pattern: '**/master'
150 forbidden-file-paths:
156 - 'apex-deploy-virtual'
157 - 'apex-workspace-cleanup'
160 name: 'apex-build-{stream}'
162 # Job template for builds
164 # Required Variables:
165 # stream: branch with - in place of / (eg. stable)
166 # branch: branch (eg. stable)
175 gs-pathname: '{gs-pathname}'
180 default: https://gerrit.opnfv.org/gerrit/$PROJECT
181 description: "Used for overriding the GIT URL coming from parameters macro."
185 credentials-id: '{ssh-credentials}'
191 use-build-blocker: true
198 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
199 predefined-parameters:
200 BUILD_DIRECTORY=apex-build-master/build_output
203 - 'apex-upload-artifact'
204 - 'apex-workspace-cleanup'
207 name: 'apex-deploy-virtual-{scenario}-{stream}'
209 # Job template for virtual deployment
211 # Required Variables:
212 # stream: branch with - in place of / (eg. stable)
213 # branch: branch (eg. stable)
220 credentials-id: '{ssh-credentials}'
228 gs-pathname: '{gs-pathname}'
230 name: DEPLOY_SCENARIO
231 default: '{scenario}'
232 description: "Scenario to deploy with."
236 use-build-blocker: true
242 - 'apex-deploy-virtual'
243 - 'apex-workspace-cleanup'
246 name: 'apex-deploy-baremetal-{scenario}-{stream}'
248 # Job template for baremetal deployment
250 # Required Variables:
251 # stream: branch with - in place of / (eg. stable)
252 # branch: branch (eg. stable)
259 credentials-id: '{ssh-credentials}'
267 gs-pathname: '{gs-pathname}'
269 name: DEPLOY_SCENARIO
270 default: '{scenario}'
271 description: "Scenario to deploy with."
275 use-build-blocker: true
283 - 'apex-deploy-baremetal'
284 - 'apex-workspace-cleanup'
287 name: 'apex-daily-{stream}'
289 # Job template for daily build
291 # Required Variables:
292 # stream: branch with - in place of / (eg. stable)
293 # branch: branch (eg. stable)
300 credentials-id: '{ssh-credentials}'
308 gs-pathname: '{gs-pathname}'
312 use-build-blocker: true
323 - project: 'apex-build-{stream}'
325 current-parameters: true
328 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
329 predefined-parameters:
330 BUILD_DIRECTORY=apex-build-master/build_output
334 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
337 build-step-failure-threshold: 'never'
338 failure-threshold: 'never'
339 unstable-threshold: 'FAILURE'
341 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
344 build-step-failure-threshold: 'never'
345 failure-threshold: 'never'
346 unstable-threshold: 'FAILURE'
348 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream}'
349 predefined-parameters:
350 BUILD_DIRECTORY=apex-build-master/build_output
354 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
357 build-step-failure-threshold: 'never'
358 failure-threshold: 'never'
359 unstable-threshold: 'FAILURE'
361 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
364 build-step-failure-threshold: 'never'
365 failure-threshold: 'never'
366 unstable-threshold: 'FAILURE'
368 ########################
370 ########################
377 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
379 name: ARTIFACT_VERSION
381 description: "Artifact version type"
383 name: BUILD_DIRECTORY
384 default: $WORKSPACE/build_output
385 description: "Directory where the build artifact will be located upon the completion of the build."
387 name: CACHE_DIRECTORY
388 default: $HOME/opnfv/cache{gs-pathname}
389 description: "Directory where the cache to be used during the build is located."
392 default: https://gerrit.opnfv.org/gerrit/$PROJECT
393 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
396 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
397 description: "URL to Google Storage."
399 ########################
401 ########################
410 # log info to console
411 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
412 echo "---------------------------------------------------------------------------------------"
414 # create the cache directory if it doesn't exist
415 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
416 # set OPNFV_ARTIFACT_VERSION
417 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
418 export OPNFV_ARTIFACT_VERSION="bramaputra.1.rc0"
420 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
421 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
422 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
423 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
425 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
430 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
431 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
432 # list the contents of BUILD_OUTPUT directory
433 ls -al $BUILD_DIRECTORY
434 # save information regarding artifact into file
436 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
437 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
438 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
439 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
440 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
441 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
442 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
443 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
444 echo "OPNFV_BUILD_URL=$BUILD_URL"
445 ) > $WORKSPACE/opnfv.properties
447 echo "--------------------------------------------------------"
450 name: 'apex-workspace-cleanup'
458 # delete everything that is in $WORKSPACE
459 /bin/rm -rf $WORKSPACE
462 name: 'apex-upload-artifact'
470 # log info to console
471 echo "Uploading the Apex artifact. This could take some time..."
472 echo "--------------------------------------------------------"
475 # source the opnfv.properties to get ARTIFACT_VERSION
476 source $WORKSPACE/opnfv.properties
478 # upload artifact and additional files to google storage
479 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
480 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
481 RPM_LIST=$RPM_INSTALL_PATH
482 for pkg in common undercloud; do
483 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
485 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
486 SRPM_LIST=$SRPM_INSTALL_PATH
487 for pkg in common undercloud; do
488 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
490 for artifact in $RPM_LIST $SRPM_LIST; do
491 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
493 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
494 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
497 echo "--------------------------------------------------------"
499 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
500 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
503 name: 'apex-deploy-virtual'
511 # log info to console
512 echo "Starting the Apex virtual deployment."
513 echo "--------------------------------------------------------"
516 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
517 # if artifact name is passed the pull a
518 # specific artifact from artifacts.opnfv.org
519 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
521 if [[ $BUILD_DIRECTORY == *verify* ]]; then
522 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
523 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
526 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
527 # if opnfv.properties exists then use the
528 # local build. Source the file so we get local OPNFV vars
529 source ${BUILD_DIRECTORY}/../opnfv.properties
530 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
532 if [[ $BUILD_DIRECTORY == *verify* ]]; then
533 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
534 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
537 # no opnfv.properties means use the latest from artifacts.opnfv.org
538 # get the latest.properties to get the link to the latest artifact
539 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
540 [[ -f opnfv.properties ]] || exit 1
541 # source the file so we get OPNFV vars
542 source opnfv.properties
543 RPM_INSTALL_PATH=$OPNFV_RPM_URL
547 RPM_LIST=$RPM_INSTALL_PATH
548 for pkg in common undercloud; do
549 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
552 # update / install the new rpm
553 if rpm -q opnfv-apex > /dev/null; then
554 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
555 echo "RPM is already installed"
556 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
557 if ! sudo yum downgrade -y $RPM_LIST; then
558 sudo yum remove -y opnfv-undercloud opnfv-common
559 sudo yum downgrade -y $RPM_INSTALL_PATH
563 sudo yum install -y $RPM_LIST;
566 # cleanup virtual machines before we start
568 # initiate virtual deployment
569 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
570 if [ -n "$DEPLOY_SCENARIO" ]; then
571 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
572 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
573 sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml
575 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
579 echo "Deploy scenario not set!"
586 echo "--------------------------------------------------------"
590 name: 'apex-deploy-baremetal'
598 # log info to console
599 echo "Starting the Apex baremetal deployment."
600 echo "--------------------------------------------------------"
603 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
604 # if artifact name is passed the pull a
605 # specific artifact from artifacts.opnfv.org
606 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
608 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
609 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
610 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
612 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
613 # if opnfv.properties exists then use the
614 # local build. Source the file so we get local OPNFV vars
615 source ${BUILD_DIRECTORY}/../opnfv.properties
616 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
618 # no opnfv.properties means use the latest from artifacts.opnfv.org
619 # get the latest.properties to get the link to the latest artifact
620 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
621 [[ -f opnfv.properties ]] || exit 1
622 # source the file so we get OPNFV vars
623 source opnfv.properties
624 RPM_INSTALL_PATH=$OPNFV_RPM_URL
628 if [ ! -e "$RPM_INSTALL_PATH" ]; then
629 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
632 RPM_LIST=$RPM_INSTALL_PATH
633 for pkg in common undercloud; do
634 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
637 # update / install the new rpm
638 if rpm -q opnfv-apex > /dev/null; then
639 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
640 echo "RPM is already installed"
641 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
642 if ! sudo yum downgrade -y $RPM_LIST; then
643 sudo yum remove -y opnfv-undercloud opnfv-common
644 sudo yum downgrade -y $RPM_INSTALL_PATH
648 sudo yum install -y $RPM_LIST;
651 # cleanup environment before we start
653 # initiate baremetal deployment
654 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
655 if [ -n "$DEPLOY_SCENARIO" ]; then
656 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
657 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
658 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
659 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
660 -n /root/network_settings.yaml
662 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
666 echo "Deploy scenario not set!"
670 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
675 echo "--------------------------------------------------------"
678 #######################
680 ########################