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}'
167 predefined-parameters:
168 DEPLOY_SCENARIO={scenario}
171 build-step-failure-threshold: 'never'
172 failure-threshold: 'never'
173 unstable-threshold: 'FAILURE'
175 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
176 predefined-parameters:
177 DEPLOY_SCENARIO={scenario}
180 build-step-failure-threshold: 'never'
181 failure-threshold: 'never'
182 unstable-threshold: 'FAILURE'
185 name: 'apex-build-{stream}'
187 # Job template for builds
189 # Required Variables:
190 # stream: branch with - in place of / (eg. stable)
191 # branch: branch (eg. stable)
200 gs-pathname: '{gs-pathname}'
205 default: https://gerrit.opnfv.org/gerrit/$PROJECT
206 description: "Used for overriding the GIT URL coming from parameters macro."
210 credentials-id: '{ssh-credentials}'
216 use-build-blocker: true
223 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
224 predefined-parameters:
225 BUILD_DIRECTORY=apex-build-{stream}/build_output
228 - 'apex-upload-artifact'
231 name: 'apex-deploy-virtual-{scenario}-{stream}'
233 # Job template for virtual deployment
235 # Required Variables:
236 # stream: branch with - in place of / (eg. stable)
237 # branch: branch (eg. stable)
244 credentials-id: '{ssh-credentials}'
252 gs-pathname: '{gs-pathname}'
254 name: DEPLOY_SCENARIO
255 default: '{scenario}'
256 description: "Scenario to deploy with."
260 use-build-blocker: true
265 - 'apex-deploy-virtual'
266 - 'apex-workspace-cleanup'
269 name: 'apex-deploy-baremetal-{scenario}-{stream}'
271 # Job template for baremetal deployment
273 # Required Variables:
274 # stream: branch with - in place of / (eg. stable)
275 # branch: branch (eg. stable)
282 credentials-id: '{ssh-credentials}'
290 gs-pathname: '{gs-pathname}'
292 name: DEPLOY_SCENARIO
293 default: '{scenario}'
294 description: "Scenario to deploy with."
298 use-build-blocker: true
306 - 'apex-deploy-baremetal'
307 - 'apex-workspace-cleanup'
310 name: 'apex-daily-{stream}'
312 # Job template for daily build
314 # Required Variables:
315 # stream: branch with - in place of / (eg. stable)
316 # branch: branch (eg. stable)
323 credentials-id: '{ssh-credentials}'
331 gs-pathname: '{gs-pathname}'
335 use-build-blocker: true
347 - project: 'apex-build-{stream}'
349 current-parameters: true
352 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
353 predefined-parameters:
354 BUILD_DIRECTORY=apex-build-{stream}/build_output
358 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
359 predefined-parameters:
360 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
363 build-step-failure-threshold: 'never'
364 failure-threshold: 'never'
365 unstable-threshold: 'FAILURE'
367 - project: 'yardstick-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: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream}'
377 predefined-parameters:
378 BUILD_DIRECTORY=apex-build-{stream}/build_output
382 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
383 predefined-parameters:
384 DEPLOY_SCENARIO=os-onos-nofeature-ha
387 build-step-failure-threshold: 'never'
388 failure-threshold: 'never'
389 unstable-threshold: 'FAILURE'
391 - project: 'yardstick-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: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream}'
401 predefined-parameters:
402 BUILD_DIRECTORY=apex-build-{stream}/build_output
406 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
407 predefined-parameters:
408 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
411 build-step-failure-threshold: 'never'
412 failure-threshold: 'never'
413 unstable-threshold: 'FAILURE'
415 - project: 'yardstick-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 ########################
426 ########################
433 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
435 name: ARTIFACT_VERSION
437 description: "Artifact version type"
439 name: BUILD_DIRECTORY
440 default: $WORKSPACE/build_output
441 description: "Directory where the build artifact will be located upon the completion of the build."
443 name: CACHE_DIRECTORY
444 default: $HOME/opnfv/cache{gs-pathname}
445 description: "Directory where the cache to be used during the build is located."
448 default: https://gerrit.opnfv.org/gerrit/$PROJECT
449 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
452 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
453 description: "URL to Google Storage."
455 ########################
457 ########################
466 # log info to console
467 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
468 echo "---------------------------------------------------------------------------------------"
470 # create the cache directory if it doesn't exist
471 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
472 # set OPNFV_ARTIFACT_VERSION
473 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
474 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
475 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
477 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
479 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
480 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
481 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
483 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
486 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
490 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
491 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
492 # list the contents of BUILD_OUTPUT directory
493 ls -al $BUILD_DIRECTORY
494 # save information regarding artifact into file
496 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
497 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
498 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
499 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
500 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
501 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
502 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
503 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
504 echo "OPNFV_BUILD_URL=$BUILD_URL"
505 ) > $WORKSPACE/opnfv.properties
507 echo "--------------------------------------------------------"
510 name: 'apex-workspace-cleanup'
518 # delete everything that is in $WORKSPACE
519 /bin/rm -rf $WORKSPACE
522 name: 'apex-upload-artifact'
530 # log info to console
531 echo "Uploading the Apex artifact. This could take some time..."
532 echo "--------------------------------------------------------"
535 # source the opnfv.properties to get ARTIFACT_VERSION
536 source $WORKSPACE/opnfv.properties
538 # upload artifact and additional files to google storage
539 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
540 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
541 RPM_LIST=$RPM_INSTALL_PATH
542 for pkg in common undercloud opendaylight-sfc; do
543 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
545 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
546 SRPM_LIST=$SRPM_INSTALL_PATH
547 for pkg in common undercloud opendaylight-sfc; do
548 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
550 for artifact in $RPM_LIST $SRPM_LIST; do
551 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
553 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
554 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
557 echo "--------------------------------------------------------"
559 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
560 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
563 name: 'apex-deploy-virtual'
571 # log info to console
572 echo "Starting the Apex virtual deployment."
573 echo "--------------------------------------------------------"
576 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
577 # if artifact name is passed the pull a
578 # specific artifact from artifacts.opnfv.org
579 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
581 if [[ $BUILD_DIRECTORY == *verify* ]]; then
582 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
583 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
584 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
585 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
586 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
589 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
590 # if opnfv.properties exists then use the
591 # local build. Source the file so we get local OPNFV vars
592 source ${BUILD_DIRECTORY}/../opnfv.properties
593 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
595 if [[ $BUILD_DIRECTORY == *verify* ]]; then
596 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
597 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
599 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
600 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
601 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
604 # no opnfv.properties means use the latest from artifacts.opnfv.org
605 # get the latest.properties to get the link to the latest artifact
606 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
607 [[ -f opnfv.properties ]] || exit 1
608 # source the file so we get OPNFV vars
609 source opnfv.properties
610 RPM_INSTALL_PATH=$OPNFV_RPM_URL
614 RPM_LIST=$RPM_INSTALL_PATH
615 for pkg in common undercloud opendaylight-sfc; do
616 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
619 # update / install the new rpm
620 if rpm -q opnfv-apex > /dev/null; then
621 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
622 echo "RPM is already installed"
623 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
624 if ! sudo yum downgrade -y $RPM_LIST; then
625 sudo yum remove -y opnfv-undercloud opnfv-common
626 sudo yum downgrade -y $RPM_INSTALL_PATH
630 sudo yum install -y $RPM_LIST;
633 # cleanup virtual machines before we start
635 # initiate virtual deployment
636 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
637 if [ -n "$DEPLOY_SCENARIO" ]; then
638 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
639 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
640 sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml --debug
642 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
646 echo "Deploy scenario not set!"
653 echo "--------------------------------------------------------"
657 name: 'apex-deploy-baremetal'
665 # log info to console
666 echo "Starting the Apex baremetal deployment."
667 echo "--------------------------------------------------------"
670 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
671 # if artifact name is passed the pull a
672 # specific artifact from artifacts.opnfv.org
673 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
675 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
676 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
677 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
679 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
680 # if opnfv.properties exists then use the
681 # local build. Source the file so we get local OPNFV vars
682 source ${BUILD_DIRECTORY}/../opnfv.properties
683 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
685 # no opnfv.properties means use the latest from artifacts.opnfv.org
686 # get the latest.properties to get the link to the latest artifact
687 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
688 [[ -f opnfv.properties ]] || exit 1
689 # source the file so we get OPNFV vars
690 source opnfv.properties
691 RPM_INSTALL_PATH=$OPNFV_RPM_URL
695 if [ ! -e "$RPM_INSTALL_PATH" ]; then
696 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
699 RPM_LIST=$RPM_INSTALL_PATH
700 for pkg in common undercloud; do
701 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
704 # update / install the new rpm
705 if rpm -q opnfv-apex > /dev/null; then
706 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
707 echo "RPM is already installed"
708 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
709 if ! sudo yum downgrade -y $RPM_LIST; then
710 sudo yum remove -y opnfv-undercloud opnfv-common
711 sudo yum downgrade -y $RPM_INSTALL_PATH
715 sudo yum install -y $RPM_LIST;
718 # cleanup environment before we start
720 # initiate baremetal deployment
721 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
722 if [ -n "$DEPLOY_SCENARIO" ]; then
723 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
724 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
725 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
726 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
727 -n /root/network/network_settings.yaml --debug
729 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
733 echo "Deploy scenario not set!"
737 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
742 echo "--------------------------------------------------------"
745 #######################
747 ########################
751 - timed: '0 3 * 12 *'
753 name: 'apex-brahmaputra'