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'
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: 'false'
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
118 - 'apex-workspace-cleanup'
121 name: 'apex-runner-{platform}-{scenario}-{stream}'
123 # runner jobs for deploying manually
131 gs-pathname: '{gs-pathname}'
138 default: https://gerrit.opnfv.org/gerrit/$PROJECT
139 description: "Used for overriding the GIT URL coming from parameters macro."
142 - gerrit-trigger-scm:
143 credentials-id: '{ssh-credentials}'
145 choosing-strategy: 'default'
149 use-build-blocker: true
156 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
160 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
163 build-step-failure-threshold: 'never'
164 failure-threshold: 'never'
165 unstable-threshold: 'FAILURE'
167 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
168 predefined-parameters:
169 DEPLOY_SCENARIO={scenario}
172 build-step-failure-threshold: 'never'
173 failure-threshold: 'never'
174 unstable-threshold: 'FAILURE'
177 name: 'apex-build-{stream}'
179 # Job template for builds
181 # Required Variables:
182 # stream: branch with - in place of / (eg. stable)
183 # branch: branch (eg. stable)
192 gs-pathname: '{gs-pathname}'
197 default: https://gerrit.opnfv.org/gerrit/$PROJECT
198 description: "Used for overriding the GIT URL coming from parameters macro."
202 credentials-id: '{ssh-credentials}'
208 use-build-blocker: true
215 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
216 predefined-parameters:
217 BUILD_DIRECTORY=apex-build-{stream}/build_output
220 - 'apex-upload-artifact'
223 name: 'apex-deploy-virtual-{scenario}-{stream}'
225 # Job template for virtual deployment
227 # Required Variables:
228 # stream: branch with - in place of / (eg. stable)
229 # branch: branch (eg. stable)
236 credentials-id: '{ssh-credentials}'
244 gs-pathname: '{gs-pathname}'
246 name: DEPLOY_SCENARIO
247 default: '{scenario}'
248 description: "Scenario to deploy with."
252 use-build-blocker: true
257 - 'apex-deploy-virtual'
258 - 'apex-workspace-cleanup'
261 name: 'apex-deploy-baremetal-{scenario}-{stream}'
263 # Job template for baremetal deployment
265 # Required Variables:
266 # stream: branch with - in place of / (eg. stable)
267 # branch: branch (eg. stable)
274 credentials-id: '{ssh-credentials}'
282 gs-pathname: '{gs-pathname}'
284 name: DEPLOY_SCENARIO
285 default: '{scenario}'
286 description: "Scenario to deploy with."
290 use-build-blocker: true
298 - 'apex-deploy-baremetal'
299 - 'apex-workspace-cleanup'
302 name: 'apex-daily-{stream}'
304 # Job template for daily build
306 # Required Variables:
307 # stream: branch with - in place of / (eg. stable)
308 # branch: branch (eg. stable)
315 credentials-id: '{ssh-credentials}'
323 gs-pathname: '{gs-pathname}'
327 use-build-blocker: true
339 - project: 'apex-build-{stream}'
341 current-parameters: true
344 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
345 predefined-parameters:
346 BUILD_DIRECTORY=apex-build-{stream}/build_output
350 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
351 predefined-parameters:
352 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
355 build-step-failure-threshold: 'never'
356 failure-threshold: 'never'
357 unstable-threshold: 'FAILURE'
359 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
362 build-step-failure-threshold: 'never'
363 failure-threshold: 'never'
364 unstable-threshold: 'FAILURE'
366 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream}'
367 predefined-parameters:
368 BUILD_DIRECTORY=apex-build-{stream}/build_output
372 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
373 predefined-parameters:
374 DEPLOY_SCENARIO=os-onos-nofeature-ha
377 build-step-failure-threshold: 'never'
378 failure-threshold: 'never'
379 unstable-threshold: 'FAILURE'
381 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
384 build-step-failure-threshold: 'never'
385 failure-threshold: 'never'
386 unstable-threshold: 'FAILURE'
388 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream}'
389 predefined-parameters:
390 BUILD_DIRECTORY=apex-build-{stream}/build_output
394 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
395 predefined-parameters:
396 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
399 build-step-failure-threshold: 'never'
400 failure-threshold: 'never'
401 unstable-threshold: 'FAILURE'
403 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
406 build-step-failure-threshold: 'never'
407 failure-threshold: 'never'
408 unstable-threshold: 'FAILURE'
410 ########################
412 ########################
419 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
421 name: ARTIFACT_VERSION
423 description: "Artifact version type"
425 name: BUILD_DIRECTORY
426 default: $WORKSPACE/build_output
427 description: "Directory where the build artifact will be located upon the completion of the build."
429 name: CACHE_DIRECTORY
430 default: $HOME/opnfv/cache{gs-pathname}
431 description: "Directory where the cache to be used during the build is located."
434 default: https://gerrit.opnfv.org/gerrit/$PROJECT
435 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
438 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
439 description: "URL to Google Storage."
441 ########################
443 ########################
452 # log info to console
453 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
454 echo "---------------------------------------------------------------------------------------"
456 # create the cache directory if it doesn't exist
457 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
458 # set OPNFV_ARTIFACT_VERSION
459 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
460 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
461 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
463 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
465 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
466 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
467 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
469 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
472 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
476 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
477 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
478 # list the contents of BUILD_OUTPUT directory
479 ls -al $BUILD_DIRECTORY
480 # save information regarding artifact into file
482 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
483 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
484 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
485 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
486 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
487 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
488 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
489 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
490 echo "OPNFV_BUILD_URL=$BUILD_URL"
491 ) > $WORKSPACE/opnfv.properties
493 echo "--------------------------------------------------------"
496 name: 'apex-workspace-cleanup'
504 # delete everything that is in $WORKSPACE
505 /bin/rm -rf $WORKSPACE
508 name: 'apex-upload-artifact'
516 # log info to console
517 echo "Uploading the Apex artifact. This could take some time..."
518 echo "--------------------------------------------------------"
521 # source the opnfv.properties to get ARTIFACT_VERSION
522 source $WORKSPACE/opnfv.properties
524 # upload artifact and additional files to google storage
525 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
526 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
527 RPM_LIST=$RPM_INSTALL_PATH
528 for pkg in common undercloud opendaylight-sfc; do
529 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
531 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
532 SRPM_LIST=$SRPM_INSTALL_PATH
533 for pkg in common undercloud opendaylight-sfc; do
534 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
536 for artifact in $RPM_LIST $SRPM_LIST; do
537 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
539 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
540 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
543 echo "--------------------------------------------------------"
545 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
546 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
549 name: 'apex-deploy-virtual'
557 # log info to console
558 echo "Starting the Apex virtual deployment."
559 echo "--------------------------------------------------------"
562 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
563 # if artifact name is passed the pull a
564 # specific artifact from artifacts.opnfv.org
565 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
567 if [[ $BUILD_DIRECTORY == *verify* ]]; then
568 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
569 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
570 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
571 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
572 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
575 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
576 # if opnfv.properties exists then use the
577 # local build. Source the file so we get local OPNFV vars
578 source ${BUILD_DIRECTORY}/../opnfv.properties
579 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
581 if [[ $BUILD_DIRECTORY == *verify* ]]; then
582 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
583 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
585 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
586 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
587 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
590 # no opnfv.properties means use the latest from artifacts.opnfv.org
591 # get the latest.properties to get the link to the latest artifact
592 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
593 [[ -f opnfv.properties ]] || exit 1
594 # source the file so we get OPNFV vars
595 source opnfv.properties
596 RPM_INSTALL_PATH=$OPNFV_RPM_URL
600 RPM_LIST=$RPM_INSTALL_PATH
601 for pkg in common undercloud; do
602 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
605 # update / install the new rpm
606 if rpm -q opnfv-apex > /dev/null; then
607 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
608 echo "RPM is already installed"
609 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
610 if ! sudo yum downgrade -y $RPM_LIST; then
611 sudo yum remove -y opnfv-undercloud opnfv-common
612 sudo yum downgrade -y $RPM_INSTALL_PATH
616 sudo yum install -y $RPM_LIST;
619 # cleanup virtual machines before we start
621 # initiate virtual deployment
622 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
623 if [ -n "$DEPLOY_SCENARIO" ]; then
624 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
625 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
626 sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml --debug
628 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
632 echo "Deploy scenario not set!"
639 echo "--------------------------------------------------------"
643 name: 'apex-deploy-baremetal'
651 # log info to console
652 echo "Starting the Apex baremetal deployment."
653 echo "--------------------------------------------------------"
656 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
657 # if artifact name is passed the pull a
658 # specific artifact from artifacts.opnfv.org
659 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
661 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
662 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
663 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
665 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
666 # if opnfv.properties exists then use the
667 # local build. Source the file so we get local OPNFV vars
668 source ${BUILD_DIRECTORY}/../opnfv.properties
669 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
671 # no opnfv.properties means use the latest from artifacts.opnfv.org
672 # get the latest.properties to get the link to the latest artifact
673 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
674 [[ -f opnfv.properties ]] || exit 1
675 # source the file so we get OPNFV vars
676 source opnfv.properties
677 RPM_INSTALL_PATH=$OPNFV_RPM_URL
681 if [ ! -e "$RPM_INSTALL_PATH" ]; then
682 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
685 RPM_LIST=$RPM_INSTALL_PATH
686 for pkg in common undercloud; do
687 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
690 # update / install the new rpm
691 if rpm -q opnfv-apex > /dev/null; then
692 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
693 echo "RPM is already installed"
694 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
695 if ! sudo yum downgrade -y $RPM_LIST; then
696 sudo yum remove -y opnfv-undercloud opnfv-common
697 sudo yum downgrade -y $RPM_INSTALL_PATH
701 sudo yum install -y $RPM_LIST;
704 # cleanup environment before we start
706 # initiate baremetal deployment
707 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
708 if [ -n "$DEPLOY_SCENARIO" ]; then
709 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
710 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
711 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
712 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
713 -n /root/network/network_settings.yaml --debug
715 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
719 echo "Deploy scenario not set!"
723 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
728 echo "--------------------------------------------------------"
731 #######################
733 ########################
737 - timed: '0 3 * 12 *'
739 name: 'apex-brahmaputra'