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'
20 branch: 'stable/brahmaputra'
21 gs-pathname: '/brahmaputra'
22 block-stream: 'master'
29 - 'os-odl_l2-nofeature-ha'
30 - 'os-odl_l2-sfc-noha'
31 - 'os-odl_l3-nofeature-ha'
32 - 'os-onos-nofeature-ha'
33 - 'os-opencontrail-nofeature-ha'
40 name: 'apex-verify-{stream}'
46 gs-pathname: '{gs-pathname}'
53 default: https://gerrit.opnfv.org/gerrit/$PROJECT
54 description: "Used for overriding the GIT URL coming from parameters macro."
58 credentials-id: '{ssh-credentials}'
59 refspec: '$GERRIT_REFSPEC'
60 choosing-strategy: 'gerrit'
65 - patchset-created-event:
66 exclude-drafts: 'false'
67 exclude-trivial-rebase: 'false'
68 exclude-no-code-change: 'true'
69 - draft-published-event
70 - comment-added-contains-event:
71 comment-contains-value: 'recheck'
72 - comment-added-contains-event:
73 comment-contains-value: 'reverify'
75 - project-compare-type: 'ANT'
76 project-pattern: 'apex'
78 - branch-compare-type: 'ANT'
79 branch-pattern: '**/{branch}'
92 use-build-blocker: true
98 - 'apex-verify-{block-stream}'
103 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
104 predefined-parameters:
105 BUILD_DIRECTORY=apex-verify-{stream}/build_output
109 - project: 'apex-deploy-virtual-os-onos-nofeature-ha-{stream}'
110 predefined-parameters:
111 BUILD_DIRECTORY=apex-verify-{stream}/build_output
115 - project: 'apex-deploy-virtual-os-odl_l3-nofeature-ha-{stream}'
116 predefined-parameters:
117 BUILD_DIRECTORY=apex-verify-{stream}/build_output
121 - project: 'apex-deploy-virtual-os-odl_l2-sfc-noha-{stream}'
122 predefined-parameters:
123 BUILD_DIRECTORY=apex-verify-{stream}/build_output
126 - 'apex-workspace-cleanup'
129 name: 'apex-runner-{platform}-{scenario}-{stream}'
131 # runner jobs for deploying manually
139 gs-pathname: '{gs-pathname}'
146 default: https://gerrit.opnfv.org/gerrit/$PROJECT
147 description: "Used for overriding the GIT URL coming from parameters macro."
150 - gerrit-trigger-scm:
151 credentials-id: '{ssh-credentials}'
153 choosing-strategy: 'default'
157 use-build-blocker: true
164 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
168 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
169 predefined-parameters:
170 DEPLOY_SCENARIO={scenario}
173 build-step-failure-threshold: 'never'
174 failure-threshold: 'never'
175 unstable-threshold: 'FAILURE'
177 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
178 predefined-parameters:
179 DEPLOY_SCENARIO={scenario}
182 build-step-failure-threshold: 'never'
183 failure-threshold: 'never'
184 unstable-threshold: 'FAILURE'
187 name: 'apex-build-{stream}'
189 # Job template for builds
191 # Required Variables:
192 # stream: branch with - in place of / (eg. stable)
193 # branch: branch (eg. stable)
202 gs-pathname: '{gs-pathname}'
207 default: https://gerrit.opnfv.org/gerrit/$PROJECT
208 description: "Used for overriding the GIT URL coming from parameters macro."
212 credentials-id: '{ssh-credentials}'
218 use-build-blocker: true
225 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
226 predefined-parameters:
227 BUILD_DIRECTORY=apex-build-{stream}/build_output
230 - 'apex-upload-artifact'
233 name: 'apex-deploy-virtual-{scenario}-{stream}'
235 # Job template for virtual deployment
237 # Required Variables:
238 # stream: branch with - in place of / (eg. stable)
239 # branch: branch (eg. stable)
246 credentials-id: '{ssh-credentials}'
254 gs-pathname: '{gs-pathname}'
256 name: DEPLOY_SCENARIO
257 default: '{scenario}'
258 description: "Scenario to deploy with."
262 use-build-blocker: true
267 - 'apex-deploy-virtual'
268 - 'apex-workspace-cleanup'
271 name: 'apex-deploy-baremetal-{scenario}-{stream}'
273 # Job template for baremetal deployment
275 # Required Variables:
276 # stream: branch with - in place of / (eg. stable)
277 # branch: branch (eg. stable)
284 credentials-id: '{ssh-credentials}'
292 gs-pathname: '{gs-pathname}'
294 name: DEPLOY_SCENARIO
295 default: '{scenario}'
296 description: "Scenario to deploy with."
300 use-build-blocker: true
308 - 'apex-deploy-baremetal'
309 - 'apex-workspace-cleanup'
312 name: 'apex-daily-{stream}'
314 # Job template for daily build
316 # Required Variables:
317 # stream: branch with - in place of / (eg. stable)
318 # branch: branch (eg. stable)
325 credentials-id: '{ssh-credentials}'
333 gs-pathname: '{gs-pathname}'
337 use-build-blocker: true
349 - project: 'apex-build-{stream}'
351 current-parameters: true
354 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
355 predefined-parameters:
356 BUILD_DIRECTORY=apex-build-{stream}/build_output
360 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
361 predefined-parameters:
362 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
365 build-step-failure-threshold: 'never'
366 failure-threshold: 'never'
367 unstable-threshold: 'FAILURE'
369 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
370 predefined-parameters:
371 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
374 build-step-failure-threshold: 'never'
375 failure-threshold: 'never'
376 unstable-threshold: 'FAILURE'
378 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream}'
379 predefined-parameters:
380 BUILD_DIRECTORY=apex-build-{stream}/build_output
384 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
385 predefined-parameters:
386 DEPLOY_SCENARIO=os-onos-nofeature-ha
389 build-step-failure-threshold: 'never'
390 failure-threshold: 'never'
391 unstable-threshold: 'FAILURE'
393 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
394 predefined-parameters:
395 DEPLOY_SCENARIO=os-onos-nofeature-ha
398 build-step-failure-threshold: 'never'
399 failure-threshold: 'never'
400 unstable-threshold: 'FAILURE'
402 - project: 'apex-deploy-baremetal-os-odl_l3-nofeature-ha-{stream}'
403 predefined-parameters:
404 BUILD_DIRECTORY=apex-build-{stream}/build_output
408 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
409 predefined-parameters:
410 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
413 build-step-failure-threshold: 'never'
414 failure-threshold: 'never'
415 unstable-threshold: 'FAILURE'
417 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
418 predefined-parameters:
419 DEPLOY_SCENARIO=os-odl_l3-nofeature-ha
422 build-step-failure-threshold: 'never'
423 failure-threshold: 'never'
424 unstable-threshold: 'FAILURE'
426 ########################
428 ########################
435 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
437 name: ARTIFACT_VERSION
439 description: "Artifact version type"
441 name: BUILD_DIRECTORY
442 default: $WORKSPACE/build_output
443 description: "Directory where the build artifact will be located upon the completion of the build."
445 name: CACHE_DIRECTORY
446 default: $HOME/opnfv/cache{gs-pathname}
447 description: "Directory where the cache to be used during the build is located."
450 default: https://gerrit.opnfv.org/gerrit/$PROJECT
451 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
454 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
455 description: "URL to Google Storage."
457 ########################
459 ########################
468 # log info to console
469 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
470 echo "---------------------------------------------------------------------------------------"
472 # create the cache directory if it doesn't exist
473 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
474 # set OPNFV_ARTIFACT_VERSION
475 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
476 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
477 export OPNFV_ARTIFACT_VERSION=brahmaputra-dev${BUILD_NUMBER}
479 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
481 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
482 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
483 export OPNFV_ARTIFACT_VERSION=brahmaputra-$(date -u +"%Y-%m-%d")
485 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
488 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
492 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
493 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
494 # list the contents of BUILD_OUTPUT directory
495 ls -al $BUILD_DIRECTORY
496 # save information regarding artifact into file
498 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
499 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
500 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
501 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
502 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
503 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
504 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
505 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
506 echo "OPNFV_BUILD_URL=$BUILD_URL"
507 ) > $WORKSPACE/opnfv.properties
509 echo "--------------------------------------------------------"
512 name: 'apex-workspace-cleanup'
520 # delete everything that is in $WORKSPACE
521 /bin/rm -rf $WORKSPACE
524 name: 'apex-upload-artifact'
532 # log info to console
533 echo "Uploading the Apex artifact. This could take some time..."
534 echo "--------------------------------------------------------"
537 # source the opnfv.properties to get ARTIFACT_VERSION
538 source $WORKSPACE/opnfv.properties
540 # upload artifact and additional files to google storage
541 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
542 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
543 RPM_LIST=$RPM_INSTALL_PATH
544 for pkg in common undercloud opendaylight-sfc; do
545 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
547 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
548 SRPM_LIST=$SRPM_INSTALL_PATH
549 for pkg in common undercloud opendaylight-sfc; do
550 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
552 for artifact in $RPM_LIST $SRPM_LIST; do
553 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
555 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
556 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
559 echo "--------------------------------------------------------"
561 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
562 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
565 name: 'apex-deploy-virtual'
573 # log info to console
574 echo "Starting the Apex virtual deployment."
575 echo "--------------------------------------------------------"
578 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
579 # if artifact name is passed the pull a
580 # specific artifact from artifacts.opnfv.org
581 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
583 if [[ $BUILD_DIRECTORY == *verify* ]]; then
584 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
585 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
586 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
587 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
588 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
591 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
592 # if opnfv.properties exists then use the
593 # local build. Source the file so we get local OPNFV vars
594 source ${BUILD_DIRECTORY}/../opnfv.properties
595 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
597 if [[ $BUILD_DIRECTORY == *verify* ]]; then
598 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
599 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
601 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
602 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
603 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
606 # no opnfv.properties means use the latest from artifacts.opnfv.org
607 # get the latest.properties to get the link to the latest artifact
608 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
609 [[ -f opnfv.properties ]] || exit 1
610 # source the file so we get OPNFV vars
611 source opnfv.properties
612 RPM_INSTALL_PATH=$OPNFV_RPM_URL
616 RPM_LIST=$RPM_INSTALL_PATH
617 for pkg in common undercloud opendaylight-sfc; do
618 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
621 # update / install the new rpm
622 if rpm -q opnfv-apex > /dev/null; then
623 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
624 echo "RPM is already installed"
625 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
626 if ! sudo yum downgrade -y $RPM_LIST; then
627 sudo yum remove -y opnfv-undercloud opnfv-common
628 sudo yum downgrade -y $RPM_INSTALL_PATH
632 sudo yum install -y $RPM_LIST;
635 # cleanup virtual machines before we start
637 # initiate virtual deployment
638 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
639 if [ -n "$DEPLOY_SCENARIO" ]; then
640 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
641 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
642 sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml --debug
644 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
648 echo "Deploy scenario not set!"
655 echo "--------------------------------------------------------"
659 name: 'apex-deploy-baremetal'
667 # log info to console
668 echo "Starting the Apex baremetal deployment."
669 echo "--------------------------------------------------------"
672 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
673 # if artifact name is passed the pull a
674 # specific artifact from artifacts.opnfv.org
675 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
677 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
678 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
679 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
681 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
682 # if opnfv.properties exists then use the
683 # local build. Source the file so we get local OPNFV vars
684 source ${BUILD_DIRECTORY}/../opnfv.properties
685 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
687 # no opnfv.properties means use the latest from artifacts.opnfv.org
688 # get the latest.properties to get the link to the latest artifact
689 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
690 [[ -f opnfv.properties ]] || exit 1
691 # source the file so we get OPNFV vars
692 source opnfv.properties
693 RPM_INSTALL_PATH=$OPNFV_RPM_URL
697 if [ ! -e "$RPM_INSTALL_PATH" ]; then
698 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
701 RPM_LIST=$RPM_INSTALL_PATH
702 for pkg in common undercloud; do
703 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
706 # update / install the new rpm
707 if rpm -q opnfv-apex > /dev/null; then
708 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
709 echo "RPM is already installed"
710 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
711 if ! sudo yum downgrade -y $RPM_LIST; then
712 sudo yum remove -y opnfv-undercloud opnfv-common
713 sudo yum downgrade -y $RPM_INSTALL_PATH
717 sudo yum install -y $RPM_LIST;
720 # cleanup environment before we start
722 # initiate baremetal deployment
723 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
724 if [ -n "$DEPLOY_SCENARIO" ]; then
725 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
726 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
727 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
728 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
729 -n /root/network/network_settings.yaml --debug
731 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
735 echo "Deploy scenario not set!"
739 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
744 echo "--------------------------------------------------------"
747 #######################
749 ########################
753 - timed: '0 3 * 12 *'
755 name: 'apex-brahmaputra'