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"
524 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
525 # if opnfv.properties exists then use the
526 # local build. Source the file so we get local OPNFV vars
527 source ${BUILD_DIRECTORY}/../opnfv.properties
528 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
530 if [[ $BUILD_DIRECTORY == *verify* ]]; then
531 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
532 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
535 # no opnfv.properties means use the latest from artifacts.opnfv.org
536 # get the latest.properties to get the link to the latest artifact
537 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
538 [[ -f opnfv.properties ]] || exit 1
539 # source the file so we get OPNFV vars
540 source opnfv.properties
541 RPM_INSTALL_PATH=$OPNFV_RPM_URL
545 RPM_LIST=$RPM_INSTALL_PATH
546 for pkg in common undercloud; do
547 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
550 # update / install the new rpm
551 if rpm -q opnfv-apex > /dev/null; then
552 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
553 echo "RPM is already installed"
554 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
555 if ! sudo yum downgrade -y $RPM_LIST; then
556 sudo yum remove -y opnfv-undercloud opnfv-common
557 sudo yum downgrade -y $RPM_INSTALL_PATH
561 sudo yum install -y $RPM_LIST;
564 # cleanup virtual machines before we start
566 # initiate virtual deployment
567 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
568 if [ -n "$DEPLOY_SCENARIO" ]; then
569 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
570 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
571 sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml
573 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
577 echo "Deploy scenario not set!"
584 echo "--------------------------------------------------------"
588 name: 'apex-deploy-baremetal'
596 # log info to console
597 echo "Starting the Apex baremetal deployment."
598 echo "--------------------------------------------------------"
601 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
602 # if artifact name is passed the pull a
603 # specific artifact from artifacts.opnfv.org
604 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
606 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
607 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
608 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
610 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
611 # if opnfv.properties exists then use the
612 # local build. Source the file so we get local OPNFV vars
613 source ${BUILD_DIRECTORY}/../opnfv.properties
614 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
616 # no opnfv.properties means use the latest from artifacts.opnfv.org
617 # get the latest.properties to get the link to the latest artifact
618 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
619 [[ -f opnfv.properties ]] || exit 1
620 # source the file so we get OPNFV vars
621 source opnfv.properties
622 RPM_INSTALL_PATH=$OPNFV_RPM_URL
626 if [ ! -e "$RPM_INSTALL_PATH" ]; then
627 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
630 RPM_LIST=$RPM_INSTALL_PATH
631 for pkg in common undercloud; do
632 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
635 # update / install the new rpm
636 if rpm -q opnfv-apex > /dev/null; then
637 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
638 echo "RPM is already installed"
639 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
640 if ! sudo yum downgrade -y $RPM_LIST; then
641 sudo yum remove -y opnfv-undercloud opnfv-common
642 sudo yum downgrade -y $RPM_INSTALL_PATH
646 sudo yum install -y $RPM_LIST;
649 # cleanup environment before we start
651 # initiate baremetal deployment
652 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
653 if [ -n "$DEPLOY_SCENARIO" ]; then
654 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
655 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
656 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
657 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
658 -n /root/network_settings.yaml
660 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
664 echo "Deploy scenario not set!"
668 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
673 echo "--------------------------------------------------------"
676 #######################
678 ########################