4 - 'apex-verify-{stream}'
5 - 'apex-merge-{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'
32 name: 'apex-verify-{stream}'
38 gs-pathname: '{gs-pathname}'
45 default: https://gerrit.opnfv.org/gerrit/$PROJECT
46 description: "Used for overriding the GIT URL coming from parameters macro."
50 credentials-id: '{ssh-credentials}'
51 refspec: '$GERRIT_REFSPEC'
52 choosing-strategy: 'gerrit'
57 - patchset-created-event:
58 exclude-drafts: 'false'
59 exclude-trivial-rebase: 'false'
60 exclude-no-code-change: 'false'
61 - draft-published-event
62 - comment-added-contains-event:
63 comment-contains-value: 'recheck'
64 - comment-added-contains-event:
65 comment-contains-value: 'reverify'
67 - project-compare-type: 'ANT'
68 project-pattern: 'apex'
70 - branch-compare-type: 'ANT'
71 branch-pattern: '**/{branch}'
87 use-build-blocker: true
96 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
97 predefined-parameters:
98 BUILD_DIRECTORY=apex-verify-master/build_output
102 - project: 'apex-deploy-virtual-os-onos-nofeature-ha-{stream}'
103 predefined-parameters:
104 BUILD_DIRECTORY=apex-verify-master/build_output
107 - 'apex-workspace-cleanup'
110 name: 'apex-merge-{stream}'
112 # builder-merge job to run JJB update
114 # This job's purpose is to update all the JJB
122 gs-pathname: '{gs-pathname}'
129 default: https://gerrit.opnfv.org/gerrit/$PROJECT
130 description: "Used for overriding the GIT URL coming from parameters macro."
133 - gerrit-trigger-scm:
134 credentials-id: '{ssh-credentials}'
136 choosing-strategy: 'default'
141 - change-merged-event
142 - comment-added-contains-event:
143 comment-contains-value: 'remerge'
145 - project-compare-type: 'ANT'
146 project-pattern: 'apex'
148 - branch-compare-type: 'ANT'
149 branch-pattern: '**/master'
150 forbidden-file-paths:
156 - 'apex-deploy-virtual'
157 - 'apex-workspace-cleanup'
160 name: 'apex-build-{stream}'
162 # Job template for builds
164 # Required Variables:
165 # stream: branch with - in place of / (eg. stable)
166 # branch: branch (eg. stable)
175 gs-pathname: '{gs-pathname}'
180 default: https://gerrit.opnfv.org/gerrit/$PROJECT
181 description: "Used for overriding the GIT URL coming from parameters macro."
185 credentials-id: '{ssh-credentials}'
191 use-build-blocker: true
198 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
199 predefined-parameters:
200 BUILD_DIRECTORY=apex-build-master/build_output
203 - 'apex-upload-artifact'
206 name: 'apex-deploy-virtual-{scenario}-{stream}'
208 # Job template for virtual deployment
210 # Required Variables:
211 # stream: branch with - in place of / (eg. stable)
212 # branch: branch (eg. stable)
219 credentials-id: '{ssh-credentials}'
227 gs-pathname: '{gs-pathname}'
229 name: DEPLOY_SCENARIO
230 default: '{scenario}'
231 description: "Scenario to deploy with."
235 use-build-blocker: true
240 - 'apex-deploy-virtual'
241 - 'apex-workspace-cleanup'
244 name: 'apex-deploy-baremetal-{scenario}-{stream}'
246 # Job template for baremetal deployment
248 # Required Variables:
249 # stream: branch with - in place of / (eg. stable)
250 # branch: branch (eg. stable)
257 credentials-id: '{ssh-credentials}'
265 gs-pathname: '{gs-pathname}'
267 name: DEPLOY_SCENARIO
268 default: '{scenario}'
269 description: "Scenario to deploy with."
273 use-build-blocker: true
281 - 'apex-deploy-baremetal'
282 - 'apex-workspace-cleanup'
285 name: 'apex-daily-{stream}'
287 # Job template for daily build
289 # Required Variables:
290 # stream: branch with - in place of / (eg. stable)
291 # branch: branch (eg. stable)
298 credentials-id: '{ssh-credentials}'
306 gs-pathname: '{gs-pathname}'
310 use-build-blocker: true
321 - project: 'apex-build-{stream}'
323 current-parameters: true
326 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
327 predefined-parameters:
328 BUILD_DIRECTORY=apex-build-master/build_output
332 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
335 build-step-failure-threshold: 'never'
336 failure-threshold: 'never'
337 unstable-threshold: 'FAILURE'
339 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
342 build-step-failure-threshold: 'never'
343 failure-threshold: 'never'
344 unstable-threshold: 'FAILURE'
346 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream}'
347 predefined-parameters:
348 BUILD_DIRECTORY=apex-build-master/build_output
352 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
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 ########################
368 ########################
375 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
377 name: ARTIFACT_VERSION
379 description: "Artifact version type"
381 name: BUILD_DIRECTORY
382 default: $WORKSPACE/build_output
383 description: "Directory where the build artifact will be located upon the completion of the build."
385 name: CACHE_DIRECTORY
386 default: $HOME/opnfv/cache{gs-pathname}
387 description: "Directory where the cache to be used during the build is located."
390 default: https://gerrit.opnfv.org/gerrit/$PROJECT
391 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
394 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
395 description: "URL to Google Storage."
397 ########################
399 ########################
408 # log info to console
409 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
410 echo "---------------------------------------------------------------------------------------"
412 # create the cache directory if it doesn't exist
413 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
414 # set OPNFV_ARTIFACT_VERSION
415 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
416 export OPNFV_ARTIFACT_VERSION="bramaputra.1.rc0"
418 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
419 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
420 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
421 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
423 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
428 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
429 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
430 # list the contents of BUILD_OUTPUT directory
431 ls -al $BUILD_DIRECTORY
432 # save information regarding artifact into file
434 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
435 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
436 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
437 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
438 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
439 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
440 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
441 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
442 echo "OPNFV_BUILD_URL=$BUILD_URL"
443 ) > $WORKSPACE/opnfv.properties
445 echo "--------------------------------------------------------"
448 name: 'apex-workspace-cleanup'
456 # delete everything that is in $WORKSPACE
457 /bin/rm -rf $WORKSPACE
460 name: 'apex-upload-artifact'
468 # log info to console
469 echo "Uploading the Apex artifact. This could take some time..."
470 echo "--------------------------------------------------------"
473 # source the opnfv.properties to get ARTIFACT_VERSION
474 source $WORKSPACE/opnfv.properties
476 # upload artifact and additional files to google storage
477 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
478 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
479 RPM_LIST=$RPM_INSTALL_PATH
480 for pkg in common undercloud; do
481 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
483 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
484 SRPM_LIST=$SRPM_INSTALL_PATH
485 for pkg in common undercloud; do
486 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
488 for artifact in $RPM_LIST $SRPM_LIST; do
489 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
491 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
492 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
495 echo "--------------------------------------------------------"
497 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
498 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
501 name: 'apex-deploy-virtual'
509 # log info to console
510 echo "Starting the Apex virtual deployment."
511 echo "--------------------------------------------------------"
514 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
515 # if artifact name is passed the pull a
516 # specific artifact from artifacts.opnfv.org
517 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
519 if [[ $BUILD_DIRECTORY == *verify* ]]; then
520 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
521 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
522 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
523 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
524 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
527 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
528 # if opnfv.properties exists then use the
529 # local build. Source the file so we get local OPNFV vars
530 source ${BUILD_DIRECTORY}/../opnfv.properties
531 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
533 if [[ $BUILD_DIRECTORY == *verify* ]]; then
534 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
535 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
537 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
538 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
539 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
542 # no opnfv.properties means use the latest from artifacts.opnfv.org
543 # get the latest.properties to get the link to the latest artifact
544 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
545 [[ -f opnfv.properties ]] || exit 1
546 # source the file so we get OPNFV vars
547 source opnfv.properties
548 RPM_INSTALL_PATH=$OPNFV_RPM_URL
552 RPM_LIST=$RPM_INSTALL_PATH
553 for pkg in common undercloud; do
554 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
557 # update / install the new rpm
558 if rpm -q opnfv-apex > /dev/null; then
559 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
560 echo "RPM is already installed"
561 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
562 if ! sudo yum downgrade -y $RPM_LIST; then
563 sudo yum remove -y opnfv-undercloud opnfv-common
564 sudo yum downgrade -y $RPM_INSTALL_PATH
568 sudo yum install -y $RPM_LIST;
571 # cleanup virtual machines before we start
573 # initiate virtual deployment
574 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
575 if [ -n "$DEPLOY_SCENARIO" ]; then
576 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
577 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
578 sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml
580 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
584 echo "Deploy scenario not set!"
591 echo "--------------------------------------------------------"
595 name: 'apex-deploy-baremetal'
603 # log info to console
604 echo "Starting the Apex baremetal deployment."
605 echo "--------------------------------------------------------"
608 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
609 # if artifact name is passed the pull a
610 # specific artifact from artifacts.opnfv.org
611 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
613 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
614 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
615 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
617 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
618 # if opnfv.properties exists then use the
619 # local build. Source the file so we get local OPNFV vars
620 source ${BUILD_DIRECTORY}/../opnfv.properties
621 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
623 # no opnfv.properties means use the latest from artifacts.opnfv.org
624 # get the latest.properties to get the link to the latest artifact
625 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
626 [[ -f opnfv.properties ]] || exit 1
627 # source the file so we get OPNFV vars
628 source opnfv.properties
629 RPM_INSTALL_PATH=$OPNFV_RPM_URL
633 if [ ! -e "$RPM_INSTALL_PATH" ]; then
634 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
637 RPM_LIST=$RPM_INSTALL_PATH
638 for pkg in common undercloud; do
639 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
642 # update / install the new rpm
643 if rpm -q opnfv-apex > /dev/null; then
644 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
645 echo "RPM is already installed"
646 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
647 if ! sudo yum downgrade -y $RPM_LIST; then
648 sudo yum remove -y opnfv-undercloud opnfv-common
649 sudo yum downgrade -y $RPM_INSTALL_PATH
653 sudo yum install -y $RPM_LIST;
656 # cleanup environment before we start
658 # initiate baremetal deployment
659 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
660 if [ -n "$DEPLOY_SCENARIO" ]; then
661 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
662 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
663 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
664 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
665 -n /root/network_settings.yaml
667 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
671 echo "Deploy scenario not set!"
675 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
680 echo "--------------------------------------------------------"
683 #######################
685 ########################
691 name: 'apex-brahmaputra'
693 - timed: '0 6 * * 2050'