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}'
93 use-build-blocker: true
99 - 'apex-verify-{block-stream}'
104 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
105 predefined-parameters:
106 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'
116 - project: 'apex-deploy-virtual-os-odl_l3-nofeature-ha-{stream}'
117 predefined-parameters:
118 BUILD_DIRECTORY='apex-verify-{stream}/build_output'
121 - 'apex-workspace-cleanup'
124 name: 'apex-runner-{platform}-{scenario}-{stream}'
126 # runner jobs for deploying manually
134 gs-pathname: '{gs-pathname}'
141 default: https://gerrit.opnfv.org/gerrit/$PROJECT
142 description: "Used for overriding the GIT URL coming from parameters macro."
145 - gerrit-trigger-scm:
146 credentials-id: '{ssh-credentials}'
148 choosing-strategy: 'default'
152 use-build-blocker: true
159 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
163 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
164 predefined-parameters:
165 DEPLOY_SCENARIO='{scenario}'
168 build-step-failure-threshold: 'never'
169 failure-threshold: 'never'
170 unstable-threshold: 'FAILURE'
172 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
175 build-step-failure-threshold: 'never'
176 failure-threshold: 'never'
177 unstable-threshold: 'FAILURE'
180 name: 'apex-build-{stream}'
182 # Job template for builds
184 # Required Variables:
185 # stream: branch with - in place of / (eg. stable)
186 # branch: branch (eg. stable)
195 gs-pathname: '{gs-pathname}'
200 default: https://gerrit.opnfv.org/gerrit/$PROJECT
201 description: "Used for overriding the GIT URL coming from parameters macro."
205 credentials-id: '{ssh-credentials}'
211 use-build-blocker: true
218 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
219 predefined-parameters:
220 BUILD_DIRECTORY='apex-build-{stream}/build_output'
223 - 'apex-upload-artifact'
226 name: 'apex-deploy-virtual-{scenario}-{stream}'
228 # Job template for virtual deployment
230 # Required Variables:
231 # stream: branch with - in place of / (eg. stable)
232 # branch: branch (eg. stable)
239 credentials-id: '{ssh-credentials}'
247 gs-pathname: '{gs-pathname}'
249 name: DEPLOY_SCENARIO
250 default: '{scenario}'
251 description: "Scenario to deploy with."
255 use-build-blocker: true
260 - 'apex-deploy-virtual'
261 - 'apex-workspace-cleanup'
264 name: 'apex-deploy-baremetal-{scenario}-{stream}'
266 # Job template for baremetal deployment
268 # Required Variables:
269 # stream: branch with - in place of / (eg. stable)
270 # branch: branch (eg. stable)
277 credentials-id: '{ssh-credentials}'
285 gs-pathname: '{gs-pathname}'
287 name: DEPLOY_SCENARIO
288 default: '{scenario}'
289 description: "Scenario to deploy with."
293 use-build-blocker: true
301 - 'apex-deploy-baremetal'
302 - 'apex-workspace-cleanup'
305 name: 'apex-daily-{stream}'
307 # Job template for daily build
309 # Required Variables:
310 # stream: branch with - in place of / (eg. stable)
311 # branch: branch (eg. stable)
318 credentials-id: '{ssh-credentials}'
326 gs-pathname: '{gs-pathname}'
330 use-build-blocker: true
342 - project: 'apex-build-{stream}'
344 current-parameters: true
347 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
348 predefined-parameters:
349 BUILD_DIRECTORY='apex-build-{stream}/build_output'
353 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
354 predefined-parameters:
355 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
358 build-step-failure-threshold: 'never'
359 failure-threshold: 'never'
360 unstable-threshold: 'FAILURE'
362 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
365 build-step-failure-threshold: 'never'
366 failure-threshold: 'never'
367 unstable-threshold: 'FAILURE'
369 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream}'
370 predefined-parameters:
371 BUILD_DIRECTORY='apex-build-{stream}/build_output'
375 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
376 predefined-parameters:
377 DEPLOY_SCENARIO=os-onos-nofeature-ha
380 build-step-failure-threshold: 'never'
381 failure-threshold: 'never'
382 unstable-threshold: 'FAILURE'
384 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
387 build-step-failure-threshold: 'never'
388 failure-threshold: 'never'
389 unstable-threshold: 'FAILURE'
391 # - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream}'
392 # predefined-parameters:
393 # BUILD_DIRECTORY=apex-build-master/build_output
397 # - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
398 # predefined-parameters:
399 # DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
402 # build-step-failure-threshold: 'never'
403 # failure-threshold: 'never'
404 # unstable-threshold: 'FAILURE'
406 # - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
409 # build-step-failure-threshold: 'never'
410 # failure-threshold: 'never'
411 # unstable-threshold: 'FAILURE'
413 ########################
415 ########################
422 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
424 name: ARTIFACT_VERSION
426 description: "Artifact version type"
428 name: BUILD_DIRECTORY
429 default: $WORKSPACE/build_output
430 description: "Directory where the build artifact will be located upon the completion of the build."
432 name: CACHE_DIRECTORY
433 default: $HOME/opnfv/cache{gs-pathname}
434 description: "Directory where the cache to be used during the build is located."
437 default: https://gerrit.opnfv.org/gerrit/$PROJECT
438 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
441 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
442 description: "URL to Google Storage."
444 ########################
446 ########################
455 # log info to console
456 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
457 echo "---------------------------------------------------------------------------------------"
459 # create the cache directory if it doesn't exist
460 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
461 # set OPNFV_ARTIFACT_VERSION
462 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
463 export OPNFV_ARTIFACT_VERSION="bramaputra.1.rc0"
465 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
466 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
467 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
468 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
470 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
475 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
476 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
477 # list the contents of BUILD_OUTPUT directory
478 ls -al $BUILD_DIRECTORY
479 # save information regarding artifact into file
481 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
482 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
483 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
484 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
485 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
486 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
487 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
488 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
489 echo "OPNFV_BUILD_URL=$BUILD_URL"
490 ) > $WORKSPACE/opnfv.properties
492 echo "--------------------------------------------------------"
495 name: 'apex-workspace-cleanup'
503 # delete everything that is in $WORKSPACE
504 /bin/rm -rf $WORKSPACE
507 name: 'apex-upload-artifact'
515 # log info to console
516 echo "Uploading the Apex artifact. This could take some time..."
517 echo "--------------------------------------------------------"
520 # source the opnfv.properties to get ARTIFACT_VERSION
521 source $WORKSPACE/opnfv.properties
523 # upload artifact and additional files to google storage
524 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
525 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
526 RPM_LIST=$RPM_INSTALL_PATH
527 for pkg in common undercloud opendaylight-sfc; do
528 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
530 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
531 SRPM_LIST=$SRPM_INSTALL_PATH
532 for pkg in common undercloud opendaylight-sfc; do
533 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
535 for artifact in $RPM_LIST $SRPM_LIST; do
536 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
538 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
539 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
542 echo "--------------------------------------------------------"
544 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
545 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
548 name: 'apex-deploy-virtual'
556 # log info to console
557 echo "Starting the Apex virtual deployment."
558 echo "--------------------------------------------------------"
561 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
562 # if artifact name is passed the pull a
563 # specific artifact from artifacts.opnfv.org
564 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
566 if [[ $BUILD_DIRECTORY == *verify* ]]; then
567 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
568 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
569 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
570 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
571 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
574 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
575 # if opnfv.properties exists then use the
576 # local build. Source the file so we get local OPNFV vars
577 source ${BUILD_DIRECTORY}/../opnfv.properties
578 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
580 if [[ $BUILD_DIRECTORY == *verify* ]]; then
581 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
582 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
584 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
585 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
586 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
589 # no opnfv.properties means use the latest from artifacts.opnfv.org
590 # get the latest.properties to get the link to the latest artifact
591 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
592 [[ -f opnfv.properties ]] || exit 1
593 # source the file so we get OPNFV vars
594 source opnfv.properties
595 RPM_INSTALL_PATH=$OPNFV_RPM_URL
599 RPM_LIST=$RPM_INSTALL_PATH
600 for pkg in common undercloud; do
601 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
604 # update / install the new rpm
605 if rpm -q opnfv-apex > /dev/null; then
606 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
607 echo "RPM is already installed"
608 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
609 if ! sudo yum downgrade -y $RPM_LIST; then
610 sudo yum remove -y opnfv-undercloud opnfv-common
611 sudo yum downgrade -y $RPM_INSTALL_PATH
615 sudo yum install -y $RPM_LIST;
618 # cleanup virtual machines before we start
620 # initiate virtual deployment
621 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
622 if [ -n "$DEPLOY_SCENARIO" ]; then
623 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
624 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
625 sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml --debug
627 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
631 echo "Deploy scenario not set!"
638 echo "--------------------------------------------------------"
642 name: 'apex-deploy-baremetal'
650 # log info to console
651 echo "Starting the Apex baremetal deployment."
652 echo "--------------------------------------------------------"
655 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
656 # if artifact name is passed the pull a
657 # specific artifact from artifacts.opnfv.org
658 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
660 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
661 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
662 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
664 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
665 # if opnfv.properties exists then use the
666 # local build. Source the file so we get local OPNFV vars
667 source ${BUILD_DIRECTORY}/../opnfv.properties
668 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
670 # no opnfv.properties means use the latest from artifacts.opnfv.org
671 # get the latest.properties to get the link to the latest artifact
672 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
673 [[ -f opnfv.properties ]] || exit 1
674 # source the file so we get OPNFV vars
675 source opnfv.properties
676 RPM_INSTALL_PATH=$OPNFV_RPM_URL
680 if [ ! -e "$RPM_INSTALL_PATH" ]; then
681 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
684 RPM_LIST=$RPM_INSTALL_PATH
685 for pkg in common undercloud; do
686 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
689 # update / install the new rpm
690 if rpm -q opnfv-apex > /dev/null; then
691 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
692 echo "RPM is already installed"
693 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
694 if ! sudo yum downgrade -y $RPM_LIST; then
695 sudo yum remove -y opnfv-undercloud opnfv-common
696 sudo yum downgrade -y $RPM_INSTALL_PATH
700 sudo yum install -y $RPM_LIST;
703 # cleanup environment before we start
705 # initiate baremetal deployment
706 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
707 if [ -n "$DEPLOY_SCENARIO" ]; then
708 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
709 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
710 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
711 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
712 -n /root/network/network_settings.yaml --debug
714 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
718 echo "Deploy scenario not set!"
722 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
727 echo "--------------------------------------------------------"
730 #######################
732 ########################
736 - timed: '0 3 * 12 *'
738 name: 'apex-brahmaputra'