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 use-build-blocker: true
273 - 'apex-deploy-virtual'
274 - 'apex-workspace-cleanup'
277 name: 'apex-deploy-baremetal-{scenario}-{stream}'
279 # Job template for baremetal deployment
281 # Required Variables:
282 # stream: branch with - in place of / (eg. stable)
283 # branch: branch (eg. stable)
290 credentials-id: '{ssh-credentials}'
298 gs-pathname: '{gs-pathname}'
300 name: DEPLOY_SCENARIO
301 default: '{scenario}'
302 description: "Scenario to deploy with."
306 use-build-blocker: true
314 - 'apex-deploy-baremetal'
315 - 'apex-workspace-cleanup'
318 name: 'apex-daily-{stream}'
320 # Job template for daily build
322 # Required Variables:
323 # stream: branch with - in place of / (eg. stable)
324 # branch: branch (eg. stable)
331 credentials-id: '{ssh-credentials}'
339 gs-pathname: '{gs-pathname}'
343 use-build-blocker: true
355 - project: 'apex-build-{stream}'
357 current-parameters: true
360 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
361 predefined-parameters: |
362 BUILD_DIRECTORY=apex-build-{stream}/build_output
367 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
368 predefined-parameters:
369 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
372 build-step-failure-threshold: 'never'
373 failure-threshold: 'never'
374 unstable-threshold: 'FAILURE'
376 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
377 predefined-parameters:
378 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
381 build-step-failure-threshold: 'never'
382 failure-threshold: 'never'
383 unstable-threshold: 'FAILURE'
385 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream}'
386 predefined-parameters:
387 BUILD_DIRECTORY=apex-build-{stream}/build_output
391 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
392 predefined-parameters:
393 DEPLOY_SCENARIO=os-onos-nofeature-ha
396 build-step-failure-threshold: 'never'
397 failure-threshold: 'never'
398 unstable-threshold: 'FAILURE'
400 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
401 predefined-parameters:
402 DEPLOY_SCENARIO=os-onos-nofeature-ha
405 build-step-failure-threshold: 'never'
406 failure-threshold: 'never'
407 unstable-threshold: 'FAILURE'
409 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream}'
410 predefined-parameters:
411 BUILD_DIRECTORY=apex-build-{stream}/build_output
415 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
416 predefined-parameters:
417 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
420 build-step-failure-threshold: 'never'
421 failure-threshold: 'never'
422 unstable-threshold: 'FAILURE'
424 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
425 predefined-parameters:
426 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
429 build-step-failure-threshold: 'never'
430 failure-threshold: 'never'
431 unstable-threshold: 'FAILURE'
433 ########################
435 ########################
442 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
444 name: ARTIFACT_VERSION
446 description: "Artifact version type"
448 name: BUILD_DIRECTORY
449 default: $WORKSPACE/build_output
450 description: "Directory where the build artifact will be located upon the completion of the build."
452 name: CACHE_DIRECTORY
453 default: $HOME/opnfv/cache{gs-pathname}
454 description: "Directory where the cache to be used during the build is located."
457 default: https://gerrit.opnfv.org/gerrit/$PROJECT
458 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
461 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
462 description: "URL to Google Storage."
466 description: "Use yes in lower case to invoke clean. Indicates if the deploy environment should be cleaned before deployment"
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="-c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
491 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
492 export BUILD_ARGS="-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="-c file://$CACHE_DIRECTORY $BUILD_DIRECTORY"
499 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
500 export BUILD_ARGS="-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 [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
594 # if artifact name is passed the pull a
595 # specific artifact from artifacts.opnfv.org
596 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
598 if [[ $BUILD_DIRECTORY == *verify* ]]; then
599 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
600 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
601 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
602 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
603 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
606 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
607 # if opnfv.properties exists then use the
608 # local build. Source the file so we get local OPNFV vars
609 source ${BUILD_DIRECTORY}/../opnfv.properties
610 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
612 if [[ $BUILD_DIRECTORY == *verify* ]]; then
613 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
614 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
616 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
617 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
618 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
621 # no opnfv.properties means use the latest from artifacts.opnfv.org
622 # get the latest.properties to get the link to the latest artifact
623 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
624 [[ -f opnfv.properties ]] || exit 1
625 # source the file so we get OPNFV vars
626 source opnfv.properties
627 RPM_INSTALL_PATH=$OPNFV_RPM_URL
631 if [ -z "$DEPLOY_SCENARIO" ]; then
632 echo "Deploy scenario not set!"
636 # use local build for verify
637 if [[ $BUILD_DIRECTORY == *verify* ]]; then
638 if [ ! -e "${WORKSPACE}/build/lib" ]; then ln -s ${WORKSPACE}/lib ${WORKSPACE}/build/lib; fi
639 DEPLOY_CMD="./deploy.sh -c ${WORKSPACE}/build -r ${WORKSPACE}/build/images/"
640 DEPLOY_FILE="${WORKSPACE}/config/deploy/${DEPLOY_SCENARIO}.yaml"
641 NETWORK_FILE="${WORKSPACE}/config/deploy/network/network_settings.yaml"
643 RPM_LIST=$RPM_INSTALL_PATH
644 for pkg in common undercloud opendaylight-sfc; do
645 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
648 # update / install the new rpm
649 if rpm -q opnfv-apex > /dev/null; then
650 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
651 echo "RPM is already installed"
652 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
653 if ! sudo yum downgrade -y $RPM_LIST; then
654 sudo yum remove -y opnfv-undercloud opnfv-common
655 sudo yum downgrade -y $RPM_INSTALL_PATH
659 sudo yum install -y $RPM_LIST;
661 DEPLOY_CMD=opnfv-deploy
662 DEPLOY_FILE="/etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
663 NETWORK_FILE="/etc/opnfv-apex/network_settings.yaml"
666 if [ "$OPNFV_CLEAN" == 'yes' ]; then
669 # initiate virtual deployment
670 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
671 if [ -e $DEPLOY_FILE ]; then
672 sudo $DEPLOY_CMD -v -d ${DEPLOY_FILE} -n $NETWORK_FILE --debug
674 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
678 echo "--------------------------------------------------------"
682 name: 'apex-deploy-baremetal'
690 # log info to console
691 echo "Starting the Apex baremetal deployment."
692 echo "--------------------------------------------------------"
695 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
696 # if artifact name is passed the pull a
697 # specific artifact from artifacts.opnfv.org
698 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
700 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
701 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
702 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
704 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
705 # if opnfv.properties exists then use the
706 # local build. Source the file so we get local OPNFV vars
707 source ${BUILD_DIRECTORY}/../opnfv.properties
708 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
710 # no opnfv.properties means use the latest from artifacts.opnfv.org
711 # get the latest.properties to get the link to the latest artifact
712 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
713 [[ -f opnfv.properties ]] || exit 1
714 # source the file so we get OPNFV vars
715 source opnfv.properties
716 RPM_INSTALL_PATH=$OPNFV_RPM_URL
720 if [ ! -e "$RPM_INSTALL_PATH" ]; then
721 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
724 RPM_LIST=$RPM_INSTALL_PATH
725 for pkg in common undercloud; do
726 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
729 # update / install the new rpm
730 if rpm -q opnfv-apex > /dev/null; then
731 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
732 echo "RPM is already installed"
733 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
734 if ! sudo yum downgrade -y $RPM_LIST; then
735 sudo yum remove -y opnfv-undercloud opnfv-common
736 sudo yum downgrade -y $RPM_INSTALL_PATH
740 sudo yum install -y $RPM_LIST;
743 # cleanup environment before we start
745 # initiate baremetal deployment
746 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
747 if [ -n "$DEPLOY_SCENARIO" ]; then
748 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
749 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
750 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
751 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
752 -n /root/network/network_settings.yaml --debug
754 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
758 echo "Deploy scenario not set!"
762 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
767 echo "--------------------------------------------------------"
770 #######################
772 ########################
776 - timed: '0 3 * 12 *'
778 name: 'apex-brahmaputra'