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)
18 branch: 'stable/brahmaputra'
19 gs-pathname: '/brahmaputra'
25 - 'os-odl_l2-nofeature-ha'
27 - 'os-odl_l3-nofeature-ha'
28 - 'os-onos-nofeature-ha'
29 - 'os-opencontrail-nofeature-ha'
36 name: 'apex-verify-{stream}'
42 gs-pathname: '{gs-pathname}'
49 default: https://gerrit.opnfv.org/gerrit/$PROJECT
50 description: "Used for overriding the GIT URL coming from parameters macro."
54 credentials-id: '{ssh-credentials}'
55 refspec: '$GERRIT_REFSPEC'
56 choosing-strategy: 'gerrit'
61 - patchset-created-event:
62 exclude-drafts: 'false'
63 exclude-trivial-rebase: 'false'
64 exclude-no-code-change: 'false'
65 - draft-published-event
66 - comment-added-contains-event:
67 comment-contains-value: 'recheck'
68 - comment-added-contains-event:
69 comment-contains-value: 'reverify'
71 - project-compare-type: 'ANT'
72 project-pattern: 'apex'
74 - branch-compare-type: 'ANT'
75 branch-pattern: '**/{branch}'
91 use-build-blocker: true
101 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
102 predefined-parameters:
103 BUILD_DIRECTORY=apex-verify-master/build_output
107 - project: 'apex-deploy-virtual-os-onos-nofeature-ha-{stream}'
108 predefined-parameters:
109 BUILD_DIRECTORY=apex-verify-master/build_output
112 - 'apex-workspace-cleanup'
115 name: 'apex-runner-{platform}-{scenario}-{stream}'
117 # runner jobs for deploying manually
125 gs-pathname: '{gs-pathname}'
132 default: https://gerrit.opnfv.org/gerrit/$PROJECT
133 description: "Used for overriding the GIT URL coming from parameters macro."
136 - gerrit-trigger-scm:
137 credentials-id: '{ssh-credentials}'
139 choosing-strategy: 'default'
143 use-build-blocker: true
150 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
154 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
155 predefined-parameters:
156 DEPLOY_SCENARIO='{scenario}'
159 build-step-failure-threshold: 'never'
160 failure-threshold: 'never'
161 unstable-threshold: 'FAILURE'
163 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
166 build-step-failure-threshold: 'never'
167 failure-threshold: 'never'
168 unstable-threshold: 'FAILURE'
171 name: 'apex-build-{stream}'
173 # Job template for builds
175 # Required Variables:
176 # stream: branch with - in place of / (eg. stable)
177 # branch: branch (eg. stable)
186 gs-pathname: '{gs-pathname}'
191 default: https://gerrit.opnfv.org/gerrit/$PROJECT
192 description: "Used for overriding the GIT URL coming from parameters macro."
196 credentials-id: '{ssh-credentials}'
202 use-build-blocker: true
209 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
210 predefined-parameters:
211 BUILD_DIRECTORY=apex-build-master/build_output
214 - 'apex-upload-artifact'
217 name: 'apex-deploy-virtual-{scenario}-{stream}'
219 # Job template for virtual deployment
221 # Required Variables:
222 # stream: branch with - in place of / (eg. stable)
223 # branch: branch (eg. stable)
230 credentials-id: '{ssh-credentials}'
238 gs-pathname: '{gs-pathname}'
240 name: DEPLOY_SCENARIO
241 default: '{scenario}'
242 description: "Scenario to deploy with."
246 use-build-blocker: true
251 - 'apex-deploy-virtual'
252 - 'apex-workspace-cleanup'
255 name: 'apex-deploy-baremetal-{scenario}-{stream}'
257 # Job template for baremetal deployment
259 # Required Variables:
260 # stream: branch with - in place of / (eg. stable)
261 # branch: branch (eg. stable)
268 credentials-id: '{ssh-credentials}'
276 gs-pathname: '{gs-pathname}'
278 name: DEPLOY_SCENARIO
279 default: '{scenario}'
280 description: "Scenario to deploy with."
284 use-build-blocker: true
292 - 'apex-deploy-baremetal'
293 - 'apex-workspace-cleanup'
296 name: 'apex-daily-{stream}'
298 # Job template for daily build
300 # Required Variables:
301 # stream: branch with - in place of / (eg. stable)
302 # branch: branch (eg. stable)
309 credentials-id: '{ssh-credentials}'
317 gs-pathname: '{gs-pathname}'
321 use-build-blocker: true
333 - project: 'apex-build-{stream}'
335 current-parameters: true
338 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
339 predefined-parameters:
340 BUILD_DIRECTORY=apex-build-master/build_output
344 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
345 predefined-parameters:
346 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
349 build-step-failure-threshold: 'never'
350 failure-threshold: 'never'
351 unstable-threshold: 'FAILURE'
353 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
356 build-step-failure-threshold: 'never'
357 failure-threshold: 'never'
358 unstable-threshold: 'FAILURE'
360 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream}'
361 predefined-parameters:
362 BUILD_DIRECTORY=apex-build-master/build_output
366 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
367 predefined-parameters:
368 DEPLOY_SCENARIO=os-onos-nofeature-ha
371 build-step-failure-threshold: 'never'
372 failure-threshold: 'never'
373 unstable-threshold: 'FAILURE'
375 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
378 build-step-failure-threshold: 'never'
379 failure-threshold: 'never'
380 unstable-threshold: 'FAILURE'
382 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream}'
383 predefined-parameters:
384 BUILD_DIRECTORY=apex-build-master/build_output
388 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
389 predefined-parameters:
390 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
393 build-step-failure-threshold: 'never'
394 failure-threshold: 'never'
395 unstable-threshold: 'FAILURE'
397 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
400 build-step-failure-threshold: 'never'
401 failure-threshold: 'never'
402 unstable-threshold: 'FAILURE'
404 ########################
406 ########################
413 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
415 name: ARTIFACT_VERSION
417 description: "Artifact version type"
419 name: BUILD_DIRECTORY
420 default: $WORKSPACE/build_output
421 description: "Directory where the build artifact will be located upon the completion of the build."
423 name: CACHE_DIRECTORY
424 default: $HOME/opnfv/cache{gs-pathname}
425 description: "Directory where the cache to be used during the build is located."
428 default: https://gerrit.opnfv.org/gerrit/$PROJECT
429 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
432 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
433 description: "URL to Google Storage."
435 ########################
437 ########################
446 # log info to console
447 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
448 echo "---------------------------------------------------------------------------------------"
450 # create the cache directory if it doesn't exist
451 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
452 # set OPNFV_ARTIFACT_VERSION
453 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
454 export OPNFV_ARTIFACT_VERSION="bramaputra.1.rc0"
456 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
457 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
458 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
459 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
461 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
466 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
467 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
468 # list the contents of BUILD_OUTPUT directory
469 ls -al $BUILD_DIRECTORY
470 # save information regarding artifact into file
472 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
473 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
474 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
475 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
476 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
477 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
478 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
479 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
480 echo "OPNFV_BUILD_URL=$BUILD_URL"
481 ) > $WORKSPACE/opnfv.properties
483 echo "--------------------------------------------------------"
486 name: 'apex-workspace-cleanup'
494 # delete everything that is in $WORKSPACE
495 /bin/rm -rf $WORKSPACE
498 name: 'apex-upload-artifact'
506 # log info to console
507 echo "Uploading the Apex artifact. This could take some time..."
508 echo "--------------------------------------------------------"
511 # source the opnfv.properties to get ARTIFACT_VERSION
512 source $WORKSPACE/opnfv.properties
514 # upload artifact and additional files to google storage
515 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
516 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
517 RPM_LIST=$RPM_INSTALL_PATH
518 for pkg in common undercloud; do
519 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
521 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
522 SRPM_LIST=$SRPM_INSTALL_PATH
523 for pkg in common undercloud; do
524 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
526 for artifact in $RPM_LIST $SRPM_LIST; do
527 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
529 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
530 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
533 echo "--------------------------------------------------------"
535 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
536 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
539 name: 'apex-deploy-virtual'
547 # log info to console
548 echo "Starting the Apex virtual deployment."
549 echo "--------------------------------------------------------"
552 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
553 # if artifact name is passed the pull a
554 # specific artifact from artifacts.opnfv.org
555 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
557 if [[ $BUILD_DIRECTORY == *verify* ]]; then
558 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
559 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
560 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
561 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
562 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
565 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
566 # if opnfv.properties exists then use the
567 # local build. Source the file so we get local OPNFV vars
568 source ${BUILD_DIRECTORY}/../opnfv.properties
569 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
571 if [[ $BUILD_DIRECTORY == *verify* ]]; then
572 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
573 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
575 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
576 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
577 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
580 # no opnfv.properties means use the latest from artifacts.opnfv.org
581 # get the latest.properties to get the link to the latest artifact
582 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
583 [[ -f opnfv.properties ]] || exit 1
584 # source the file so we get OPNFV vars
585 source opnfv.properties
586 RPM_INSTALL_PATH=$OPNFV_RPM_URL
590 RPM_LIST=$RPM_INSTALL_PATH
591 for pkg in common undercloud; do
592 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
595 # update / install the new rpm
596 if rpm -q opnfv-apex > /dev/null; then
597 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
598 echo "RPM is already installed"
599 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
600 if ! sudo yum downgrade -y $RPM_LIST; then
601 sudo yum remove -y opnfv-undercloud opnfv-common
602 sudo yum downgrade -y $RPM_INSTALL_PATH
606 sudo yum install -y $RPM_LIST;
609 # cleanup virtual machines before we start
611 # initiate virtual deployment
612 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
613 if [ -n "$DEPLOY_SCENARIO" ]; then
614 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
615 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
616 sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml
618 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
622 echo "Deploy scenario not set!"
629 echo "--------------------------------------------------------"
633 name: 'apex-deploy-baremetal'
641 # log info to console
642 echo "Starting the Apex baremetal deployment."
643 echo "--------------------------------------------------------"
646 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
647 # if artifact name is passed the pull a
648 # specific artifact from artifacts.opnfv.org
649 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
651 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
652 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
653 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
655 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
656 # if opnfv.properties exists then use the
657 # local build. Source the file so we get local OPNFV vars
658 source ${BUILD_DIRECTORY}/../opnfv.properties
659 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
661 # no opnfv.properties means use the latest from artifacts.opnfv.org
662 # get the latest.properties to get the link to the latest artifact
663 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
664 [[ -f opnfv.properties ]] || exit 1
665 # source the file so we get OPNFV vars
666 source opnfv.properties
667 RPM_INSTALL_PATH=$OPNFV_RPM_URL
671 if [ ! -e "$RPM_INSTALL_PATH" ]; then
672 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
675 RPM_LIST=$RPM_INSTALL_PATH
676 for pkg in common undercloud; do
677 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
680 # update / install the new rpm
681 if rpm -q opnfv-apex > /dev/null; then
682 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
683 echo "RPM is already installed"
684 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
685 if ! sudo yum downgrade -y $RPM_LIST; then
686 sudo yum remove -y opnfv-undercloud opnfv-common
687 sudo yum downgrade -y $RPM_INSTALL_PATH
691 sudo yum install -y $RPM_LIST;
694 # cleanup environment before we start
696 # initiate baremetal deployment
697 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
698 if [ -n "$DEPLOY_SCENARIO" ]; then
699 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
700 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
701 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
702 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
703 -n /root/network/network_settings.yaml
705 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
709 echo "Deploy scenario not set!"
713 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
718 echo "--------------------------------------------------------"
721 #######################
723 ########################
729 name: 'apex-brahmaputra'
731 - timed: '0 6 * * 2050'