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'
20 branch: 'stable/brahmaputra'
21 gs-pathname: '/brahmaputra'
22 block-stream: 'master'
29 - 'os-odl_l2-nofeature-ha'
30 - 'os-odl_l2-sfc-noha'
31 - 'os-odl_l3-nofeature-ha'
32 - 'os-onos-nofeature-ha'
33 - 'os-opencontrail-nofeature-ha'
40 name: 'apex-verify-{stream}'
46 gs-pathname: '{gs-pathname}'
53 default: https://gerrit.opnfv.org/gerrit/$PROJECT
54 description: "Used for overriding the GIT URL coming from parameters macro."
58 credentials-id: '{ssh-credentials}'
59 refspec: '$GERRIT_REFSPEC'
60 choosing-strategy: 'gerrit'
65 - patchset-created-event:
66 exclude-drafts: 'false'
67 exclude-trivial-rebase: 'false'
68 exclude-no-code-change: 'true'
69 - draft-published-event
70 - comment-added-contains-event:
71 comment-contains-value: 'recheck'
72 - comment-added-contains-event:
73 comment-contains-value: 'reverify'
75 - project-compare-type: 'ANT'
76 project-pattern: 'apex'
78 - branch-compare-type: 'ANT'
79 branch-pattern: '**/{branch}'
92 use-build-blocker: true
98 - 'apex-verify-{block-stream}'
103 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
104 predefined-parameters: |
105 BUILD_DIRECTORY=apex-verify-{stream}/build_output
110 - project: 'apex-deploy-virtual-os-onos-nofeature-ha-{stream}'
111 predefined-parameters: |
112 BUILD_DIRECTORY=apex-verify-{stream}/build_output
117 - project: 'apex-deploy-virtual-os-odl_l3-nofeature-ha-{stream}'
118 predefined-parameters: |
119 BUILD_DIRECTORY=apex-verify-{stream}/build_output
124 - project: 'apex-deploy-virtual-os-odl_l2-sfc-noha-{stream}'
125 predefined-parameters: |
126 BUILD_DIRECTORY=apex-verify-{stream}/build_output
130 - 'apex-workspace-cleanup'
133 name: 'apex-runner-{platform}-{scenario}-{stream}'
135 # runner jobs for deploying manually
143 gs-pathname: '{gs-pathname}'
150 default: https://gerrit.opnfv.org/gerrit/$PROJECT
151 description: "Used for overriding the GIT URL coming from parameters macro."
154 - gerrit-trigger-scm:
155 credentials-id: '{ssh-credentials}'
157 choosing-strategy: 'default'
161 use-build-blocker: true
168 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
169 predefined-parameters:
174 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
175 predefined-parameters:
176 DEPLOY_SCENARIO={scenario}
179 build-step-failure-threshold: 'never'
180 failure-threshold: 'never'
181 unstable-threshold: 'FAILURE'
183 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
184 predefined-parameters:
185 DEPLOY_SCENARIO={scenario}
188 build-step-failure-threshold: 'never'
189 failure-threshold: 'never'
190 unstable-threshold: 'FAILURE'
193 name: 'apex-build-{stream}'
195 # Job template for builds
197 # Required Variables:
198 # stream: branch with - in place of / (eg. stable)
199 # branch: branch (eg. stable)
208 gs-pathname: '{gs-pathname}'
213 default: https://gerrit.opnfv.org/gerrit/$PROJECT
214 description: "Used for overriding the GIT URL coming from parameters macro."
218 credentials-id: '{ssh-credentials}'
224 use-build-blocker: true
231 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
232 predefined-parameters:
233 BUILD_DIRECTORY=apex-build-{stream}/build_output
236 - 'apex-upload-artifact'
239 name: 'apex-deploy-virtual-{scenario}-{stream}'
241 # Job template for virtual deployment
243 # Required Variables:
244 # stream: branch with - in place of / (eg. stable)
245 # branch: branch (eg. stable)
252 credentials-id: '{ssh-credentials}'
260 gs-pathname: '{gs-pathname}'
262 name: DEPLOY_SCENARIO
263 default: '{scenario}'
264 description: "Scenario to deploy with."
268 description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
272 use-build-blocker: true
277 - 'apex-deploy-virtual'
278 - 'apex-workspace-cleanup'
281 name: 'apex-deploy-baremetal-{scenario}-{stream}'
283 # Job template for baremetal deployment
285 # Required Variables:
286 # stream: branch with - in place of / (eg. stable)
287 # branch: branch (eg. stable)
294 credentials-id: '{ssh-credentials}'
302 gs-pathname: '{gs-pathname}'
304 name: DEPLOY_SCENARIO
305 default: '{scenario}'
306 description: "Scenario to deploy with."
310 use-build-blocker: true
318 - 'apex-deploy-baremetal'
319 - 'apex-workspace-cleanup'
322 name: 'apex-daily-{stream}'
324 # Job template for daily build
326 # Required Variables:
327 # stream: branch with - in place of / (eg. stable)
328 # branch: branch (eg. stable)
335 credentials-id: '{ssh-credentials}'
343 gs-pathname: '{gs-pathname}'
347 use-build-blocker: true
359 - project: 'apex-build-{stream}'
361 current-parameters: true
364 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
365 predefined-parameters: |
366 BUILD_DIRECTORY=apex-build-{stream}/build_output
371 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
372 predefined-parameters:
373 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
376 build-step-failure-threshold: 'never'
377 failure-threshold: 'never'
378 unstable-threshold: 'FAILURE'
380 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
381 predefined-parameters:
382 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
385 build-step-failure-threshold: 'never'
386 failure-threshold: 'never'
387 unstable-threshold: 'FAILURE'
389 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream}'
390 predefined-parameters:
391 BUILD_DIRECTORY=apex-build-{stream}/build_output
395 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
396 predefined-parameters:
397 DEPLOY_SCENARIO=os-onos-nofeature-ha
400 build-step-failure-threshold: 'never'
401 failure-threshold: 'never'
402 unstable-threshold: 'FAILURE'
404 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
405 predefined-parameters:
406 DEPLOY_SCENARIO=os-onos-nofeature-ha
409 build-step-failure-threshold: 'never'
410 failure-threshold: 'never'
411 unstable-threshold: 'FAILURE'
413 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream}'
414 predefined-parameters:
415 BUILD_DIRECTORY=apex-build-{stream}/build_output
419 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
420 predefined-parameters:
421 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
424 build-step-failure-threshold: 'never'
425 failure-threshold: 'never'
426 unstable-threshold: 'FAILURE'
428 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
429 predefined-parameters:
430 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
433 build-step-failure-threshold: 'never'
434 failure-threshold: 'never'
435 unstable-threshold: 'FAILURE'
437 ########################
439 ########################
446 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
448 name: ARTIFACT_VERSION
450 description: "Artifact version type"
452 name: BUILD_DIRECTORY
453 default: $WORKSPACE/build_output
454 description: "Directory where the build artifact will be located upon the completion of the build."
456 name: CACHE_DIRECTORY
457 default: $HOME/opnfv/cache{gs-pathname}
458 description: "Directory where the cache to be used during the build is located."
461 default: https://gerrit.opnfv.org/gerrit/$PROJECT
462 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
465 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
466 description: "URL to Google Storage."
468 ########################
470 ########################
479 # log info to console
480 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
481 echo "---------------------------------------------------------------------------------------"
483 # create the cache directory if it doesn't exist
484 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
485 # set OPNFV_ARTIFACT_VERSION
486 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
487 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
488 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
489 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
491 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
492 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY"
494 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
495 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
496 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
497 export BUILD_ARGS="-v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
499 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
500 export BUILD_ARGS="-r $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY --iso"
503 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
507 ./build.sh -v $OPNFV_ARTIFACT_VERSION $BUILD_ARGS
508 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
509 # list the contents of BUILD_OUTPUT directory
510 ls -al $BUILD_DIRECTORY
511 # save information regarding artifact into file
513 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
514 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
515 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
516 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
517 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
518 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
519 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
520 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
521 echo "OPNFV_BUILD_URL=$BUILD_URL"
522 ) > $WORKSPACE/opnfv.properties
523 echo "--------------------------------------------------------"
527 name: 'apex-workspace-cleanup'
535 # delete everything that is in $WORKSPACE
536 /bin/rm -rf $WORKSPACE
539 name: 'apex-upload-artifact'
547 # log info to console
548 echo "Uploading the Apex artifact. This could take some time..."
549 echo "--------------------------------------------------------"
552 # source the opnfv.properties to get ARTIFACT_VERSION
553 source $WORKSPACE/opnfv.properties
555 # upload artifact and additional files to google storage
556 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
557 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
558 RPM_LIST=$RPM_INSTALL_PATH
559 for pkg in common undercloud opendaylight-sfc; do
560 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
562 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
563 SRPM_LIST=$SRPM_INSTALL_PATH
564 for pkg in common undercloud opendaylight-sfc; do
565 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
567 for artifact in $RPM_LIST $SRPM_LIST; do
568 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
570 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
571 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
574 echo "--------------------------------------------------------"
576 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
577 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
580 name: 'apex-deploy-virtual'
588 # log info to console
589 echo "Starting the Apex virtual deployment."
590 echo "--------------------------------------------------------"
593 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
594 cd $WORKSPACE/../${BUILD_DIRECTORY/build_output/}
596 echo "WORKSPACE modified to $WORKSPACE"
598 elif [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
599 # if artifact name is passed the pull a
600 # specific artifact from artifacts.opnfv.org
601 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
603 if [[ $BUILD_DIRECTORY == *verify* ]]; then
604 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
605 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
606 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
607 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
608 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
611 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
612 # if opnfv.properties exists then use the
613 # local build. Source the file so we get local OPNFV vars
614 source ${BUILD_DIRECTORY}/../opnfv.properties
615 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
617 if [[ $BUILD_DIRECTORY == *verify* ]]; then
618 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
619 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
621 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
622 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
623 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
626 # no opnfv.properties means use the latest from artifacts.opnfv.org
627 # get the latest.properties to get the link to the latest artifact
628 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
629 [[ -f opnfv.properties ]] || exit 1
630 # source the file so we get OPNFV vars
631 source opnfv.properties
632 RPM_INSTALL_PATH=$OPNFV_RPM_URL
636 if [ -z "$DEPLOY_SCENARIO" ]; then
637 echo "Deploy scenario not set!"
641 # use local build for verify
642 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
643 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
644 DEPLOY_CMD="./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
645 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
646 NETWORK_FILE="${WORKSPACE}/config/network/network_settings.yaml"
648 RPM_LIST=$RPM_INSTALL_PATH
649 for pkg in common undercloud opendaylight-sfc; do
650 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
653 # update / install the new rpm
654 if rpm -q opnfv-apex > /dev/null; then
655 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
656 echo "RPM is already installed"
657 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
658 if ! sudo yum downgrade -y $RPM_LIST; then
659 sudo yum remove -y opnfv-undercloud opnfv-common
660 sudo yum downgrade -y $RPM_INSTALL_PATH
664 sudo yum install -y $RPM_LIST;
666 DEPLOY_CMD=opnfv-deploy
667 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
668 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
671 if [ "$OPNFV_CLEAN" == 'yes' ]; then
672 if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
678 # initiate virtual deployment
679 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
680 if [ -e $DEPLOY_FILE ]; then
681 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
683 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
687 echo "--------------------------------------------------------"
691 name: 'apex-deploy-baremetal'
699 # log info to console
700 echo "Starting the Apex baremetal deployment."
701 echo "--------------------------------------------------------"
704 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
705 # if artifact name is passed the pull a
706 # specific artifact from artifacts.opnfv.org
707 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
709 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
710 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
711 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
713 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
714 # if opnfv.properties exists then use the
715 # local build. Source the file so we get local OPNFV vars
716 source ${BUILD_DIRECTORY}/../opnfv.properties
717 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
719 # no opnfv.properties means use the latest from artifacts.opnfv.org
720 # get the latest.properties to get the link to the latest artifact
721 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
722 [[ -f opnfv.properties ]] || exit 1
723 # source the file so we get OPNFV vars
724 source opnfv.properties
725 RPM_INSTALL_PATH=$OPNFV_RPM_URL
729 if [ ! -e "$RPM_INSTALL_PATH" ]; then
730 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
733 RPM_LIST=$RPM_INSTALL_PATH
734 for pkg in common undercloud; do
735 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
738 # update / install the new rpm
739 if rpm -q opnfv-apex > /dev/null; then
740 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
741 echo "RPM is already installed"
742 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
743 if ! sudo yum downgrade -y $RPM_LIST; then
744 sudo yum remove -y opnfv-undercloud opnfv-common
745 sudo yum downgrade -y $RPM_INSTALL_PATH
749 sudo yum install -y $RPM_LIST;
752 # cleanup environment before we start
754 # initiate baremetal deployment
755 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
756 if [ -n "$DEPLOY_SCENARIO" ]; then
757 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
758 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
759 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
760 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
761 -n /root/network/network_settings.yaml --debug
763 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
767 echo "Deploy scenario not set!"
771 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
776 echo "--------------------------------------------------------"
779 #######################
781 ########################
785 - timed: '0 3 * 12 *'
787 name: 'apex-brahmaputra'