4 - 'apex-verify-{stream}'
5 - 'apex-runner-{platform}-{scenario}-{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)
17 block-stream: 'brahmaputra'
19 branch: 'stable/brahmaputra'
20 gs-pathname: '/brahmaputra'
21 block-stream: 'master'
27 - 'os-odl_l2-nofeature-ha'
28 - 'os-odl_l2-sfc-noha'
29 - 'os-odl_l3-nofeature-ha'
30 - 'os-onos-nofeature-ha'
31 - 'os-opencontrail-nofeature-ha'
38 name: 'apex-verify-{stream}'
44 gs-pathname: '{gs-pathname}'
51 default: https://gerrit.opnfv.org/gerrit/$PROJECT
52 description: "Used for overriding the GIT URL coming from parameters macro."
56 credentials-id: '{ssh-credentials}'
57 refspec: '$GERRIT_REFSPEC'
58 choosing-strategy: 'gerrit'
63 - patchset-created-event:
64 exclude-drafts: 'false'
65 exclude-trivial-rebase: 'false'
66 exclude-no-code-change: 'true'
67 - draft-published-event
68 - comment-added-contains-event:
69 comment-contains-value: 'recheck'
70 - comment-added-contains-event:
71 comment-contains-value: 'reverify'
73 - project-compare-type: 'ANT'
74 project-pattern: 'apex'
76 - branch-compare-type: 'ANT'
77 branch-pattern: '**/{branch}'
90 use-build-blocker: true
96 - 'apex-verify-{block-stream}'
101 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
102 predefined-parameters:
103 BUILD_DIRECTORY=apex-verify-{stream}/build_output
107 - project: 'apex-deploy-virtual-os-onos-nofeature-ha-{stream}'
108 predefined-parameters:
109 BUILD_DIRECTORY=apex-verify-{stream}/build_output
113 - project: 'apex-deploy-virtual-os-odl_l3-nofeature-ha-{stream}'
114 predefined-parameters:
115 BUILD_DIRECTORY=apex-verify-{stream}/build_output
119 - project: 'apex-deploy-virtual-os-odl_l2-sfc-noha-{stream}'
120 predefined-parameters:
121 BUILD_DIRECTORY=apex-verify-{stream}/build_output
124 - 'apex-workspace-cleanup'
127 name: 'apex-runner-{platform}-{scenario}-{stream}'
129 # runner jobs for deploying manually
137 gs-pathname: '{gs-pathname}'
144 default: https://gerrit.opnfv.org/gerrit/$PROJECT
145 description: "Used for overriding the GIT URL coming from parameters macro."
148 - gerrit-trigger-scm:
149 credentials-id: '{ssh-credentials}'
151 choosing-strategy: 'default'
155 use-build-blocker: true
162 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
166 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
169 build-step-failure-threshold: 'never'
170 failure-threshold: 'never'
171 unstable-threshold: 'FAILURE'
173 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
174 predefined-parameters:
175 DEPLOY_SCENARIO={scenario}
178 build-step-failure-threshold: 'never'
179 failure-threshold: 'never'
180 unstable-threshold: 'FAILURE'
183 name: 'apex-build-{stream}'
185 # Job template for builds
187 # Required Variables:
188 # stream: branch with - in place of / (eg. stable)
189 # branch: branch (eg. stable)
198 gs-pathname: '{gs-pathname}'
203 default: https://gerrit.opnfv.org/gerrit/$PROJECT
204 description: "Used for overriding the GIT URL coming from parameters macro."
208 credentials-id: '{ssh-credentials}'
214 use-build-blocker: true
221 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
222 predefined-parameters:
223 BUILD_DIRECTORY=apex-build-{stream}/build_output
226 - 'apex-upload-artifact'
229 name: 'apex-deploy-virtual-{scenario}-{stream}'
231 # Job template for virtual deployment
233 # Required Variables:
234 # stream: branch with - in place of / (eg. stable)
235 # branch: branch (eg. stable)
242 credentials-id: '{ssh-credentials}'
250 gs-pathname: '{gs-pathname}'
252 name: DEPLOY_SCENARIO
253 default: '{scenario}'
254 description: "Scenario to deploy with."
258 use-build-blocker: true
263 - 'apex-deploy-virtual'
264 - 'apex-workspace-cleanup'
267 name: 'apex-deploy-baremetal-{scenario}-{stream}'
269 # Job template for baremetal deployment
271 # Required Variables:
272 # stream: branch with - in place of / (eg. stable)
273 # branch: branch (eg. stable)
280 credentials-id: '{ssh-credentials}'
288 gs-pathname: '{gs-pathname}'
290 name: DEPLOY_SCENARIO
291 default: '{scenario}'
292 description: "Scenario to deploy with."
296 use-build-blocker: true
304 - 'apex-deploy-baremetal'
305 - 'apex-workspace-cleanup'
308 name: 'apex-daily-{stream}'
310 # Job template for daily build
312 # Required Variables:
313 # stream: branch with - in place of / (eg. stable)
314 # branch: branch (eg. stable)
321 credentials-id: '{ssh-credentials}'
329 gs-pathname: '{gs-pathname}'
333 use-build-blocker: true
345 - project: 'apex-build-{stream}'
347 current-parameters: true
350 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
351 predefined-parameters:
352 BUILD_DIRECTORY=apex-build-{stream}/build_output
356 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
357 predefined-parameters:
358 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
361 build-step-failure-threshold: 'never'
362 failure-threshold: 'never'
363 unstable-threshold: 'FAILURE'
365 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
368 build-step-failure-threshold: 'never'
369 failure-threshold: 'never'
370 unstable-threshold: 'FAILURE'
372 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream}'
373 predefined-parameters:
374 BUILD_DIRECTORY=apex-build-{stream}/build_output
378 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
379 predefined-parameters:
380 DEPLOY_SCENARIO=os-onos-nofeature-ha
383 build-step-failure-threshold: 'never'
384 failure-threshold: 'never'
385 unstable-threshold: 'FAILURE'
387 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
390 build-step-failure-threshold: 'never'
391 failure-threshold: 'never'
392 unstable-threshold: 'FAILURE'
394 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream}'
395 predefined-parameters:
396 BUILD_DIRECTORY=apex-build-{stream}/build_output
400 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
401 predefined-parameters:
402 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
405 build-step-failure-threshold: 'never'
406 failure-threshold: 'never'
407 unstable-threshold: 'FAILURE'
409 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
412 build-step-failure-threshold: 'never'
413 failure-threshold: 'never'
414 unstable-threshold: 'FAILURE'
416 ########################
418 ########################
425 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
427 name: ARTIFACT_VERSION
429 description: "Artifact version type"
431 name: BUILD_DIRECTORY
432 default: $WORKSPACE/build_output
433 description: "Directory where the build artifact will be located upon the completion of the build."
435 name: CACHE_DIRECTORY
436 default: $HOME/opnfv/cache{gs-pathname}
437 description: "Directory where the cache to be used during the build is located."
440 default: https://gerrit.opnfv.org/gerrit/$PROJECT
441 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
444 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
445 description: "URL to Google Storage."
447 ########################
449 ########################
458 # log info to console
459 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
460 echo "---------------------------------------------------------------------------------------"
462 # create the cache directory if it doesn't exist
463 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
464 # set OPNFV_ARTIFACT_VERSION
465 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
466 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
467 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
469 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
471 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
472 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
473 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
475 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
478 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
482 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
483 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
484 # list the contents of BUILD_OUTPUT directory
485 ls -al $BUILD_DIRECTORY
486 # save information regarding artifact into file
488 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
489 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
490 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
491 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
492 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
493 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
494 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
495 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
496 echo "OPNFV_BUILD_URL=$BUILD_URL"
497 ) > $WORKSPACE/opnfv.properties
499 echo "--------------------------------------------------------"
502 name: 'apex-workspace-cleanup'
510 # delete everything that is in $WORKSPACE
511 /bin/rm -rf $WORKSPACE
514 name: 'apex-upload-artifact'
522 # log info to console
523 echo "Uploading the Apex artifact. This could take some time..."
524 echo "--------------------------------------------------------"
527 # source the opnfv.properties to get ARTIFACT_VERSION
528 source $WORKSPACE/opnfv.properties
530 # upload artifact and additional files to google storage
531 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
532 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
533 RPM_LIST=$RPM_INSTALL_PATH
534 for pkg in common undercloud opendaylight-sfc; do
535 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
537 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
538 SRPM_LIST=$SRPM_INSTALL_PATH
539 for pkg in common undercloud opendaylight-sfc; do
540 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
542 for artifact in $RPM_LIST $SRPM_LIST; do
543 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
545 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
546 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
549 echo "--------------------------------------------------------"
551 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
552 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
555 name: 'apex-deploy-virtual'
563 # log info to console
564 echo "Starting the Apex virtual deployment."
565 echo "--------------------------------------------------------"
568 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
569 # if artifact name is passed the pull a
570 # specific artifact from artifacts.opnfv.org
571 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
573 if [[ $BUILD_DIRECTORY == *verify* ]]; then
574 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
575 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
576 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
577 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
578 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
581 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
582 # if opnfv.properties exists then use the
583 # local build. Source the file so we get local OPNFV vars
584 source ${BUILD_DIRECTORY}/../opnfv.properties
585 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
587 if [[ $BUILD_DIRECTORY == *verify* ]]; then
588 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
589 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
591 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
592 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
593 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
596 # no opnfv.properties means use the latest from artifacts.opnfv.org
597 # get the latest.properties to get the link to the latest artifact
598 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
599 [[ -f opnfv.properties ]] || exit 1
600 # source the file so we get OPNFV vars
601 source opnfv.properties
602 RPM_INSTALL_PATH=$OPNFV_RPM_URL
606 RPM_LIST=$RPM_INSTALL_PATH
607 for pkg in common undercloud opendaylight-sfc; do
608 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
611 # update / install the new rpm
612 if rpm -q opnfv-apex > /dev/null; then
613 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
614 echo "RPM is already installed"
615 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
616 if ! sudo yum downgrade -y $RPM_LIST; then
617 sudo yum remove -y opnfv-undercloud opnfv-common
618 sudo yum downgrade -y $RPM_INSTALL_PATH
622 sudo yum install -y $RPM_LIST;
625 # cleanup virtual machines before we start
627 # initiate virtual deployment
628 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
629 if [ -n "$DEPLOY_SCENARIO" ]; then
630 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
631 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
632 sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml --debug
634 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
638 echo "Deploy scenario not set!"
645 echo "--------------------------------------------------------"
649 name: 'apex-deploy-baremetal'
657 # log info to console
658 echo "Starting the Apex baremetal deployment."
659 echo "--------------------------------------------------------"
662 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
663 # if artifact name is passed the pull a
664 # specific artifact from artifacts.opnfv.org
665 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
667 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
668 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
669 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
671 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
672 # if opnfv.properties exists then use the
673 # local build. Source the file so we get local OPNFV vars
674 source ${BUILD_DIRECTORY}/../opnfv.properties
675 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
677 # no opnfv.properties means use the latest from artifacts.opnfv.org
678 # get the latest.properties to get the link to the latest artifact
679 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
680 [[ -f opnfv.properties ]] || exit 1
681 # source the file so we get OPNFV vars
682 source opnfv.properties
683 RPM_INSTALL_PATH=$OPNFV_RPM_URL
687 if [ ! -e "$RPM_INSTALL_PATH" ]; then
688 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
691 RPM_LIST=$RPM_INSTALL_PATH
692 for pkg in common undercloud; do
693 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
696 # update / install the new rpm
697 if rpm -q opnfv-apex > /dev/null; then
698 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
699 echo "RPM is already installed"
700 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
701 if ! sudo yum downgrade -y $RPM_LIST; then
702 sudo yum remove -y opnfv-undercloud opnfv-common
703 sudo yum downgrade -y $RPM_INSTALL_PATH
707 sudo yum install -y $RPM_LIST;
710 # cleanup environment before we start
712 # initiate baremetal deployment
713 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
714 if [ -n "$DEPLOY_SCENARIO" ]; then
715 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
716 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
717 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
718 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
719 -n /root/network/network_settings.yaml --debug
721 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
725 echo "Deploy scenario not set!"
729 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
734 echo "--------------------------------------------------------"
737 #######################
739 ########################
743 - timed: '0 3 * 12 *'
745 name: 'apex-brahmaputra'