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
112 - 'apex-workspace-cleanup'
115 name: 'apex-runner-{platform}-{scenario}-{stream}'
117 # runner jobs for deploying manually
125 gs-pathname: '{gs-pathname}'
132 default: https://gerrit.opnfv.org/gerrit/$PROJECT
133 description: "Used for overriding the GIT URL coming from parameters macro."
136 - gerrit-trigger-scm:
137 credentials-id: '{ssh-credentials}'
139 choosing-strategy: 'default'
143 use-build-blocker: true
150 - project: 'apex-deploy-{platform}-{scenario}-{stream}'
154 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
155 predefined-parameters:
156 DEPLOY_SCENARIO='{scenario}'
159 build-step-failure-threshold: 'never'
160 failure-threshold: 'never'
161 unstable-threshold: 'FAILURE'
163 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
166 build-step-failure-threshold: 'never'
167 failure-threshold: 'never'
168 unstable-threshold: 'FAILURE'
171 name: 'apex-build-{stream}'
173 # Job template for builds
175 # Required Variables:
176 # stream: branch with - in place of / (eg. stable)
177 # branch: branch (eg. stable)
186 gs-pathname: '{gs-pathname}'
191 default: https://gerrit.opnfv.org/gerrit/$PROJECT
192 description: "Used for overriding the GIT URL coming from parameters macro."
196 credentials-id: '{ssh-credentials}'
202 use-build-blocker: true
209 - project: 'apex-deploy-virtual-os-odl_l2-nofeature-ha-{stream}'
210 predefined-parameters:
211 BUILD_DIRECTORY=apex-build-master/build_output
214 - 'apex-upload-artifact'
217 name: 'apex-deploy-virtual-{scenario}-{stream}'
219 # Job template for virtual deployment
221 # Required Variables:
222 # stream: branch with - in place of / (eg. stable)
223 # branch: branch (eg. stable)
230 credentials-id: '{ssh-credentials}'
238 gs-pathname: '{gs-pathname}'
240 name: DEPLOY_SCENARIO
241 default: '{scenario}'
242 description: "Scenario to deploy with."
246 use-build-blocker: true
251 - 'apex-deploy-virtual'
252 - 'apex-workspace-cleanup'
255 name: 'apex-deploy-baremetal-{scenario}-{stream}'
257 # Job template for baremetal deployment
259 # Required Variables:
260 # stream: branch with - in place of / (eg. stable)
261 # branch: branch (eg. stable)
268 credentials-id: '{ssh-credentials}'
276 gs-pathname: '{gs-pathname}'
278 name: DEPLOY_SCENARIO
279 default: '{scenario}'
280 description: "Scenario to deploy with."
284 use-build-blocker: true
292 - 'apex-deploy-baremetal'
293 - 'apex-workspace-cleanup'
296 name: 'apex-daily-{stream}'
298 # Job template for daily build
300 # Required Variables:
301 # stream: branch with - in place of / (eg. stable)
302 # branch: branch (eg. stable)
309 credentials-id: '{ssh-credentials}'
317 gs-pathname: '{gs-pathname}'
321 use-build-blocker: true
333 - project: 'apex-build-{stream}'
335 current-parameters: true
338 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
339 predefined-parameters:
340 BUILD_DIRECTORY=apex-build-master/build_output
344 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
345 predefined-parameters:
346 DEPLOY_SCENARIO=os-odl_l2-nofeature-ha
349 build-step-failure-threshold: 'never'
350 failure-threshold: 'never'
351 unstable-threshold: 'FAILURE'
353 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
356 build-step-failure-threshold: 'never'
357 failure-threshold: 'never'
358 unstable-threshold: 'FAILURE'
360 - project: 'apex-deploy-baremetal-os-onos-nofeature-ha-{stream}'
361 predefined-parameters:
362 BUILD_DIRECTORY=apex-build-master/build_output
366 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
367 predefined-parameters:
368 DEPLOY_SCENARIO=os-onos-nofeature-ha
371 build-step-failure-threshold: 'never'
372 failure-threshold: 'never'
373 unstable-threshold: 'FAILURE'
375 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
378 build-step-failure-threshold: 'never'
379 failure-threshold: 'never'
380 unstable-threshold: 'FAILURE'
382 ########################
384 ########################
391 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
393 name: ARTIFACT_VERSION
395 description: "Artifact version type"
397 name: BUILD_DIRECTORY
398 default: $WORKSPACE/build_output
399 description: "Directory where the build artifact will be located upon the completion of the build."
401 name: CACHE_DIRECTORY
402 default: $HOME/opnfv/cache{gs-pathname}
403 description: "Directory where the cache to be used during the build is located."
406 default: https://gerrit.opnfv.org/gerrit/$PROJECT
407 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
410 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
411 description: "URL to Google Storage."
413 ########################
415 ########################
424 # log info to console
425 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
426 echo "---------------------------------------------------------------------------------------"
428 # create the cache directory if it doesn't exist
429 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
430 # set OPNFV_ARTIFACT_VERSION
431 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
432 export OPNFV_ARTIFACT_VERSION="bramaputra.1.rc0"
434 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
435 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
436 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
437 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
439 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
444 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
445 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
446 # list the contents of BUILD_OUTPUT directory
447 ls -al $BUILD_DIRECTORY
448 # save information regarding artifact into file
450 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
451 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
452 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
453 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
454 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
455 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
456 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
457 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
458 echo "OPNFV_BUILD_URL=$BUILD_URL"
459 ) > $WORKSPACE/opnfv.properties
461 echo "--------------------------------------------------------"
464 name: 'apex-workspace-cleanup'
472 # delete everything that is in $WORKSPACE
473 /bin/rm -rf $WORKSPACE
476 name: 'apex-upload-artifact'
484 # log info to console
485 echo "Uploading the Apex artifact. This could take some time..."
486 echo "--------------------------------------------------------"
489 # source the opnfv.properties to get ARTIFACT_VERSION
490 source $WORKSPACE/opnfv.properties
492 # upload artifact and additional files to google storage
493 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
494 RPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL)
495 RPM_LIST=$RPM_INSTALL_PATH
496 for pkg in common undercloud; do
497 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
499 SRPM_INSTALL_PATH=$BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL)
500 SRPM_LIST=$SRPM_INSTALL_PATH
501 for pkg in common undercloud; do
502 SRPM_LIST+=" ${SRPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
504 for artifact in $RPM_LIST $SRPM_LIST; do
505 gsutil cp $artifact gs://$GS_URL/$(basename $artifact) > gsutil.iso.log 2>&1
507 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
508 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
511 echo "--------------------------------------------------------"
513 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
514 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
517 name: 'apex-deploy-virtual'
525 # log info to console
526 echo "Starting the Apex virtual deployment."
527 echo "--------------------------------------------------------"
530 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
531 # if artifact name is passed the pull a
532 # specific artifact from artifacts.opnfv.org
533 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
535 if [[ $BUILD_DIRECTORY == *verify* ]]; then
536 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
537 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
538 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
539 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
540 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
543 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
544 # if opnfv.properties exists then use the
545 # local build. Source the file so we get local OPNFV vars
546 source ${BUILD_DIRECTORY}/../opnfv.properties
547 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
549 if [[ $BUILD_DIRECTORY == *verify* ]]; then
550 echo "BUILD_DIRECTORY is from a verify job, so will not use latest from URL"
551 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
553 elif [[ $BUILD_DIRECTORY == *apex-build* ]]; then
554 echo "BUILD_DIRECTORY is from a daily job, so will not use latest from URL"
555 echo "Check that the slave has opnfv.properties in $BUILD_DIRECTORY"
558 # no opnfv.properties means use the latest from artifacts.opnfv.org
559 # get the latest.properties to get the link to the latest artifact
560 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
561 [[ -f opnfv.properties ]] || exit 1
562 # source the file so we get OPNFV vars
563 source opnfv.properties
564 RPM_INSTALL_PATH=$OPNFV_RPM_URL
568 RPM_LIST=$RPM_INSTALL_PATH
569 for pkg in common undercloud; do
570 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
573 # update / install the new rpm
574 if rpm -q opnfv-apex > /dev/null; then
575 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
576 echo "RPM is already installed"
577 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
578 if ! sudo yum downgrade -y $RPM_LIST; then
579 sudo yum remove -y opnfv-undercloud opnfv-common
580 sudo yum downgrade -y $RPM_INSTALL_PATH
584 sudo yum install -y $RPM_LIST;
587 # cleanup virtual machines before we start
589 # initiate virtual deployment
590 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
591 if [ -n "$DEPLOY_SCENARIO" ]; then
592 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
593 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
594 sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml
596 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
600 echo "Deploy scenario not set!"
607 echo "--------------------------------------------------------"
611 name: 'apex-deploy-baremetal'
619 # log info to console
620 echo "Starting the Apex baremetal deployment."
621 echo "--------------------------------------------------------"
624 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
625 # if artifact name is passed the pull a
626 # specific artifact from artifacts.opnfv.org
627 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
629 if [[ $BUILD_DIRECTORY == *apex-build* ]]; then
630 BUILD_DIRECTORY=$WORKSPACE/../$BUILD_DIRECTORY
631 echo "BUILD DIRECTORY modified to $BUILD_DIRECTORY"
633 if [[ -f ${BUILD_DIRECTORY}/../opnfv.properties ]]; then
634 # if opnfv.properties exists then use the
635 # local build. Source the file so we get local OPNFV vars
636 source ${BUILD_DIRECTORY}/../opnfv.properties
637 RPM_INSTALL_PATH=${BUILD_DIRECTORY}/$(basename $OPNFV_RPM_URL)
639 # no opnfv.properties means use the latest from artifacts.opnfv.org
640 # get the latest.properties to get the link to the latest artifact
641 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
642 [[ -f opnfv.properties ]] || exit 1
643 # source the file so we get OPNFV vars
644 source opnfv.properties
645 RPM_INSTALL_PATH=$OPNFV_RPM_URL
649 if [ ! -e "$RPM_INSTALL_PATH" ]; then
650 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
653 RPM_LIST=$RPM_INSTALL_PATH
654 for pkg in common undercloud; do
655 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
658 # update / install the new rpm
659 if rpm -q opnfv-apex > /dev/null; then
660 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
661 echo "RPM is already installed"
662 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
663 if ! sudo yum downgrade -y $RPM_LIST; then
664 sudo yum remove -y opnfv-undercloud opnfv-common
665 sudo yum downgrade -y $RPM_INSTALL_PATH
669 sudo yum install -y $RPM_LIST;
672 # cleanup environment before we start
674 # initiate baremetal deployment
675 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
676 if [ -n "$DEPLOY_SCENARIO" ]; then
677 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
678 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
679 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
680 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
681 -n /root/network/network_settings.yaml
683 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
687 echo "Deploy scenario not set!"
691 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
696 echo "--------------------------------------------------------"
699 #######################
701 ########################
707 name: 'apex-brahmaputra'
709 - timed: '0 6 * * 2050'