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
197 - 'apex-deploy-virtual'
198 - 'apex-upload-artifact'
199 - 'apex-workspace-cleanup'
202 name: 'apex-deploy-virtual-{scenario}-{stream}'
204 # Job template for virtual deployment
206 # Required Variables:
207 # stream: branch with - in place of / (eg. stable)
208 # branch: branch (eg. stable)
215 credentials-id: '{ssh-credentials}'
223 gs-pathname: '{gs-pathname}'
225 name: DEPLOY_SCENARIO
226 default: '{scenario}'
227 description: "Scenario to deploy with."
231 use-build-blocker: true
237 - 'apex-deploy-virtual'
238 - 'apex-workspace-cleanup'
241 name: 'apex-deploy-baremetal-{scenario}-{stream}'
243 # Job template for baremetal deployment
245 # Required Variables:
246 # stream: branch with - in place of / (eg. stable)
247 # branch: branch (eg. stable)
254 credentials-id: '{ssh-credentials}'
262 gs-pathname: '{gs-pathname}'
264 name: DEPLOY_SCENARIO
265 default: '{scenario}'
266 description: "Scenario to deploy with."
270 use-build-blocker: true
278 - 'apex-deploy-baremetal'
279 - 'apex-workspace-cleanup'
282 name: 'apex-daily-{stream}'
284 # Job template for daily build
286 # Required Variables:
287 # stream: branch with - in place of / (eg. stable)
288 # branch: branch (eg. stable)
295 credentials-id: '{ssh-credentials}'
303 gs-pathname: '{gs-pathname}'
307 use-build-blocker: true
318 - project: 'apex-build-{stream}'
320 current-parameters: true
323 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
324 predefined-parameters:
325 BUILD_DIRECTORY=apex-build-master/build_output
329 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
332 build-step-failure-threshold: 'never'
333 failure-threshold: 'never'
334 unstable-threshold: 'FAILURE'
336 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
339 build-step-failure-threshold: 'never'
340 failure-threshold: 'never'
341 unstable-threshold: 'FAILURE'
343 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream}'
344 predefined-parameters:
345 BUILD_DIRECTORY=apex-build-master/build_output
349 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
352 build-step-failure-threshold: 'never'
353 failure-threshold: 'never'
354 unstable-threshold: 'FAILURE'
356 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
359 build-step-failure-threshold: 'never'
360 failure-threshold: 'never'
361 unstable-threshold: 'FAILURE'
363 ########################
365 ########################
372 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
374 name: ARTIFACT_VERSION
376 description: "Artifact version type"
378 name: BUILD_DIRECTORY
379 default: $WORKSPACE/build_output
380 description: "Directory where the build artifact will be located upon the completion of the build."
382 name: CACHE_DIRECTORY
383 default: $HOME/opnfv/cache{gs-pathname}
384 description: "Directory where the cache to be used during the build is located."
387 default: https://gerrit.opnfv.org/gerrit/$PROJECT
388 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
391 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
392 description: "URL to Google Storage."
394 ########################
396 ########################
405 # log info to console
406 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
407 echo "---------------------------------------------------------------------------------------"
409 # create the cache directory if it doesn't exist
410 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
411 # set OPNFV_ARTIFACT_VERSION
412 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
413 export OPNFV_ARTIFACT_VERSION="bramaputra.1.rc0"
415 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
416 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
417 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
418 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
420 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
425 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
426 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
427 # list the contents of BUILD_OUTPUT directory
428 ls -al $BUILD_DIRECTORY
429 # save information regarding artifact into file
431 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
432 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
433 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
434 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
435 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
436 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
437 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
438 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
439 echo "OPNFV_BUILD_URL=$BUILD_URL"
440 ) > $WORKSPACE/opnfv.properties
442 echo "--------------------------------------------------------"
445 name: 'apex-workspace-cleanup'
453 # delete everything that is in $WORKSPACE
454 /bin/rm -rf $WORKSPACE
457 name: 'apex-upload-artifact'
465 # log info to console
466 echo "Uploading the Apex artifact. This could take some time..."
467 echo "--------------------------------------------------------"
470 # source the opnfv.properties to get ARTIFACT_VERSION
471 source $WORKSPACE/opnfv.properties
473 # upload artifact and additional files to google storage
474 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
475 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
476 RPM_LIST=$RPM_INSTALL_PATH
477 for pkg in common undercloud; do
478 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
480 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
481 SRPM_LIST=$SRPM_INSTALL_PATH
482 for pkg in common undercloud; do
483 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
485 for artifact in $RPM_LIST $SRPM_LIST; do
486 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
488 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
489 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
492 echo "--------------------------------------------------------"
494 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
495 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
498 name: 'apex-deploy-virtual'
506 # log info to console
507 echo "Starting the Apex virtual deployment."
508 echo "--------------------------------------------------------"
511 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
512 # if artifact name is passed the pull a
513 # specific artifact from artifacts.opnfv.org
514 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
516 if [[ $BUILD_DIRECTORY == *verify* ]]; then
517 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
518 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
521 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
522 # if opnfv.properties exists then use the
523 # local build. Source the file so we get local OPNFV vars
524 source ${BUILD_DIRECTORY}/../opnfv.properties
525 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
527 if [[ $BUILD_DIRECTORY == *verify* ]]; then
528 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
529 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
532 # no opnfv.properties means use the latest from artifacts.opnfv.org
533 # get the latest.properties to get the link to the latest artifact
534 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
535 [[ -f opnfv.properties ]] || exit 1
536 # source the file so we get OPNFV vars
537 source opnfv.properties
538 RPM_INSTALL_PATH=$OPNFV_RPM_URL
542 RPM_LIST=$RPM_INSTALL_PATH
543 for pkg in common undercloud; do
544 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
547 # update / install the new rpm
548 if rpm -q opnfv-apex > /dev/null; then
549 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
550 echo "RPM is already installed"
551 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
552 if ! sudo yum downgrade -y $RPM_LIST; then
553 sudo yum remove -y opnfv-undercloud opnfv-common
554 sudo yum downgrade -y $RPM_INSTALL_PATH
558 sudo yum install -y $RPM_LIST;
561 # cleanup virtual machines before we start
563 # initiate virtual deployment
564 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
565 if [ -n "$DEPLOY_SCENARIO" ]; then
566 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
567 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
568 sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml
570 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
574 echo "Deploy scenario not set!"
581 echo "--------------------------------------------------------"
585 name: 'apex-deploy-baremetal'
593 # log info to console
594 echo "Starting the Apex baremetal deployment."
595 echo "--------------------------------------------------------"
598 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
599 # if artifact name is passed the pull a
600 # specific artifact from artifacts.opnfv.org
601 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
603 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
604 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
605 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
607 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
608 # if opnfv.properties exists then use the
609 # local build. Source the file so we get local OPNFV vars
610 source ${BUILD_DIRECTORY}/../opnfv.properties
611 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
613 # no opnfv.properties means use the latest from artifacts.opnfv.org
614 # get the latest.properties to get the link to the latest artifact
615 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
616 [[ -f opnfv.properties ]] || exit 1
617 # source the file so we get OPNFV vars
618 source opnfv.properties
619 RPM_INSTALL_PATH=$OPNFV_RPM_URL
623 if [ ! -e "$RPM_INSTALL_PATH" ]; then
624 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
627 RPM_LIST=$RPM_INSTALL_PATH
628 for pkg in common undercloud; do
629 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
632 # update / install the new rpm
633 if rpm -q opnfv-apex > /dev/null; then
634 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
635 echo "RPM is already installed"
636 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
637 if ! sudo yum downgrade -y $RPM_LIST; then
638 sudo yum remove -y opnfv-undercloud opnfv-common
639 sudo yum downgrade -y $RPM_INSTALL_PATH
643 sudo yum install -y $RPM_LIST;
646 # cleanup environment before we start
648 # initiate baremetal deployment
649 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
650 if [ -n "$DEPLOY_SCENARIO" ]; then
651 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
652 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
653 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
654 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
655 -n /root/network_settings.yaml
657 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
661 echo "Deploy scenario not set!"
665 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
670 echo "--------------------------------------------------------"
673 #######################
675 ########################