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-{stream}/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 $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
463 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
464 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
466 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
468 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
469 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
470 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
472 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
475 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
479 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
480 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
481 # list the contents of BUILD_OUTPUT directory
482 ls -al $BUILD_DIRECTORY
483 # save information regarding artifact into file
485 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
486 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
487 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
488 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
489 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
490 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
491 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
492 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
493 echo "OPNFV_BUILD_URL=$BUILD_URL"
494 ) > $WORKSPACE/opnfv.properties
496 echo "--------------------------------------------------------"
499 name: 'apex-workspace-cleanup'
507 # delete everything that is in $WORKSPACE
508 /bin/rm -rf $WORKSPACE
511 name: 'apex-upload-artifact'
519 # log info to console
520 echo "Uploading the Apex artifact. This could take some time..."
521 echo "--------------------------------------------------------"
524 # source the opnfv.properties to get ARTIFACT_VERSION
525 source $WORKSPACE/opnfv.properties
527 # upload artifact and additional files to google storage
528 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
529 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
530 RPM_LIST=$RPM_INSTALL_PATH
531 for pkg in common undercloud opendaylight-sfc; do
532 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
534 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
535 SRPM_LIST=$SRPM_INSTALL_PATH
536 for pkg in common undercloud opendaylight-sfc; do
537 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
539 for artifact in $RPM_LIST $SRPM_LIST; do
540 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
542 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
543 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
546 echo "--------------------------------------------------------"
548 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
549 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
552 name: 'apex-deploy-virtual'
560 # log info to console
561 echo "Starting the Apex virtual deployment."
562 echo "--------------------------------------------------------"
565 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
566 # if artifact name is passed the pull a
567 # specific artifact from artifacts.opnfv.org
568 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
570 if [[ $BUILD_DIRECTORY == *verify* ]]; then
571 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
572 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
573 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
574 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
575 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
578 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
579 # if opnfv.properties exists then use the
580 # local build. Source the file so we get local OPNFV vars
581 source ${BUILD_DIRECTORY}/../opnfv.properties
582 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
584 if [[ $BUILD_DIRECTORY == *verify* ]]; then
585 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
586 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
588 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
589 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
590 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
593 # no opnfv.properties means use the latest from artifacts.opnfv.org
594 # get the latest.properties to get the link to the latest artifact
595 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
596 [[ -f opnfv.properties ]] || exit 1
597 # source the file so we get OPNFV vars
598 source opnfv.properties
599 RPM_INSTALL_PATH=$OPNFV_RPM_URL
603 RPM_LIST=$RPM_INSTALL_PATH
604 for pkg in common undercloud; do
605 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
608 # update / install the new rpm
609 if rpm -q opnfv-apex > /dev/null; then
610 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
611 echo "RPM is already installed"
612 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
613 if ! sudo yum downgrade -y $RPM_LIST; then
614 sudo yum remove -y opnfv-undercloud opnfv-common
615 sudo yum downgrade -y $RPM_INSTALL_PATH
619 sudo yum install -y $RPM_LIST;
622 # cleanup virtual machines before we start
624 # initiate virtual deployment
625 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
626 if [ -n "$DEPLOY_SCENARIO" ]; then
627 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
628 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
629 sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml --debug
631 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
635 echo "Deploy scenario not set!"
642 echo "--------------------------------------------------------"
646 name: 'apex-deploy-baremetal'
654 # log info to console
655 echo "Starting the Apex baremetal deployment."
656 echo "--------------------------------------------------------"
659 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
660 # if artifact name is passed the pull a
661 # specific artifact from artifacts.opnfv.org
662 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
664 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
665 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
666 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
668 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
669 # if opnfv.properties exists then use the
670 # local build. Source the file so we get local OPNFV vars
671 source ${BUILD_DIRECTORY}/../opnfv.properties
672 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
674 # no opnfv.properties means use the latest from artifacts.opnfv.org
675 # get the latest.properties to get the link to the latest artifact
676 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
677 [[ -f opnfv.properties ]] || exit 1
678 # source the file so we get OPNFV vars
679 source opnfv.properties
680 RPM_INSTALL_PATH=$OPNFV_RPM_URL
684 if [ ! -e "$RPM_INSTALL_PATH" ]; then
685 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
688 RPM_LIST=$RPM_INSTALL_PATH
689 for pkg in common undercloud; do
690 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
693 # update / install the new rpm
694 if rpm -q opnfv-apex > /dev/null; then
695 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
696 echo "RPM is already installed"
697 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
698 if ! sudo yum downgrade -y $RPM_LIST; then
699 sudo yum remove -y opnfv-undercloud opnfv-common
700 sudo yum downgrade -y $RPM_INSTALL_PATH
704 sudo yum install -y $RPM_LIST;
707 # cleanup environment before we start
709 # initiate baremetal deployment
710 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
711 if [ -n "$DEPLOY_SCENARIO" ]; then
712 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
713 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
714 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
715 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
716 -n /root/network/network_settings.yaml --debug
718 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
722 echo "Deploy scenario not set!"
726 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
731 echo "--------------------------------------------------------"
734 #######################
736 ########################
740 - timed: '0 3 * 12 *'
742 name: 'apex-brahmaputra'