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
113 - project: 'apex-deploy-virtual-os-odl_l3-nofeature-ha-{stream}'
114 predefined-parameters:
115 BUILD_DIRECTORY=apex-verify-master/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: 'functest-apex-opnfv-jump-1-daily-{stream}'
161 predefined-parameters:
162 DEPLOY_SCENARIO='{scenario}'
165 build-step-failure-threshold: 'never'
166 failure-threshold: 'never'
167 unstable-threshold: 'FAILURE'
169 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
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-master/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-master/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-master/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-master/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 $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
460 export OPNFV_ARTIFACT_VERSION="bramaputra.1.rc0"
462 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
463 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
464 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
465 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
467 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
472 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
473 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
474 # list the contents of BUILD_OUTPUT directory
475 ls -al $BUILD_DIRECTORY
476 # save information regarding artifact into file
478 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
479 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
480 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
481 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
482 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
483 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
484 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
485 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
486 echo "OPNFV_BUILD_URL=$BUILD_URL"
487 ) > $WORKSPACE/opnfv.properties
489 echo "--------------------------------------------------------"
492 name: 'apex-workspace-cleanup'
500 # delete everything that is in $WORKSPACE
501 /bin/rm -rf $WORKSPACE
504 name: 'apex-upload-artifact'
512 # log info to console
513 echo "Uploading the Apex artifact. This could take some time..."
514 echo "--------------------------------------------------------"
517 # source the opnfv.properties to get ARTIFACT_VERSION
518 source $WORKSPACE/opnfv.properties
520 # upload artifact and additional files to google storage
521 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
522 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
523 RPM_LIST=$RPM_INSTALL_PATH
524 for pkg in common undercloud; do
525 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
527 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
528 SRPM_LIST=$SRPM_INSTALL_PATH
529 for pkg in common undercloud; do
530 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
532 for artifact in $RPM_LIST $SRPM_LIST; do
533 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
535 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
536 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
539 echo "--------------------------------------------------------"
541 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
542 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
545 name: 'apex-deploy-virtual'
553 # log info to console
554 echo "Starting the Apex virtual deployment."
555 echo "--------------------------------------------------------"
558 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
559 # if artifact name is passed the pull a
560 # specific artifact from artifacts.opnfv.org
561 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
563 if [[ $BUILD_DIRECTORY == *verify* ]]; then
564 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
565 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
566 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
567 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
568 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
571 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
572 # if opnfv.properties exists then use the
573 # local build. Source the file so we get local OPNFV vars
574 source ${BUILD_DIRECTORY}/../opnfv.properties
575 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
577 if [[ $BUILD_DIRECTORY == *verify* ]]; then
578 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
579 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
581 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
582 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
583 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
586 # no opnfv.properties means use the latest from artifacts.opnfv.org
587 # get the latest.properties to get the link to the latest artifact
588 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
589 [[ -f opnfv.properties ]] || exit 1
590 # source the file so we get OPNFV vars
591 source opnfv.properties
592 RPM_INSTALL_PATH=$OPNFV_RPM_URL
596 RPM_LIST=$RPM_INSTALL_PATH
597 for pkg in common undercloud; do
598 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
601 # update / install the new rpm
602 if rpm -q opnfv-apex > /dev/null; then
603 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
604 echo "RPM is already installed"
605 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
606 if ! sudo yum downgrade -y $RPM_LIST; then
607 sudo yum remove -y opnfv-undercloud opnfv-common
608 sudo yum downgrade -y $RPM_INSTALL_PATH
612 sudo yum install -y $RPM_LIST;
615 # cleanup virtual machines before we start
617 # initiate virtual deployment
618 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
619 if [ -n "$DEPLOY_SCENARIO" ]; then
620 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
621 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
622 sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml
624 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
628 echo "Deploy scenario not set!"
635 echo "--------------------------------------------------------"
639 name: 'apex-deploy-baremetal'
647 # log info to console
648 echo "Starting the Apex baremetal deployment."
649 echo "--------------------------------------------------------"
652 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
653 # if artifact name is passed the pull a
654 # specific artifact from artifacts.opnfv.org
655 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
657 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
658 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
659 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
661 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
662 # if opnfv.properties exists then use the
663 # local build. Source the file so we get local OPNFV vars
664 source ${BUILD_DIRECTORY}/../opnfv.properties
665 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
667 # no opnfv.properties means use the latest from artifacts.opnfv.org
668 # get the latest.properties to get the link to the latest artifact
669 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
670 [[ -f opnfv.properties ]] || exit 1
671 # source the file so we get OPNFV vars
672 source opnfv.properties
673 RPM_INSTALL_PATH=$OPNFV_RPM_URL
677 if [ ! -e "$RPM_INSTALL_PATH" ]; then
678 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
681 RPM_LIST=$RPM_INSTALL_PATH
682 for pkg in common undercloud; do
683 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
686 # update / install the new rpm
687 if rpm -q opnfv-apex > /dev/null; then
688 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
689 echo "RPM is already installed"
690 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
691 if ! sudo yum downgrade -y $RPM_LIST; then
692 sudo yum remove -y opnfv-undercloud opnfv-common
693 sudo yum downgrade -y $RPM_INSTALL_PATH
697 sudo yum install -y $RPM_LIST;
700 # cleanup environment before we start
702 # initiate baremetal deployment
703 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
704 if [ -n "$DEPLOY_SCENARIO" ]; then
705 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
706 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
707 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
708 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
709 -n /root/network/network_settings.yaml
711 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
715 echo "Deploy scenario not set!"
719 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
724 echo "--------------------------------------------------------"
727 #######################
729 ########################
735 name: 'apex-brahmaputra'
737 - timed: '0 6 * * 2050'