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 DEPLOY_SCENARIO="os-odl_l2-nofeature-ha"
101 - 'apex-workspace-cleanup'
104 name: 'apex-merge-{stream}'
106 # builder-merge job to run JJB update
108 # This job's purpose is to update all the JJB
116 gs-pathname: '{gs-pathname}'
123 default: https://gerrit.opnfv.org/gerrit/$PROJECT
124 description: "Used for overriding the GIT URL coming from parameters macro."
127 - gerrit-trigger-scm:
128 credentials-id: '{ssh-credentials}'
130 choosing-strategy: 'default'
135 - change-merged-event
136 - comment-added-contains-event:
137 comment-contains-value: 'remerge'
139 - project-compare-type: 'ANT'
140 project-pattern: 'apex'
142 - branch-compare-type: 'ANT'
143 branch-pattern: '**/master'
144 forbidden-file-paths:
150 - 'apex-deploy-virtual'
151 - 'apex-workspace-cleanup'
154 name: 'apex-build-{stream}'
156 # Job template for builds
158 # Required Variables:
159 # stream: branch with - in place of / (eg. stable)
160 # branch: branch (eg. stable)
169 gs-pathname: '{gs-pathname}'
174 default: https://gerrit.opnfv.org/gerrit/$PROJECT
175 description: "Used for overriding the GIT URL coming from parameters macro."
179 credentials-id: '{ssh-credentials}'
185 use-build-blocker: true
191 - 'apex-deploy-virtual'
192 - 'apex-upload-artifact'
193 - 'apex-workspace-cleanup'
196 name: 'apex-deploy-virtual-{scenario}-{stream}'
198 # Job template for virtual deployment
200 # Required Variables:
201 # stream: branch with - in place of / (eg. stable)
202 # branch: branch (eg. stable)
209 credentials-id: '{ssh-credentials}'
217 gs-pathname: '{gs-pathname}'
219 name: DEPLOY_SCENARIO
220 default: '{scenario}'
221 description: "Scenario to deploy with."
225 use-build-blocker: true
232 - 'apex-deploy-virtual'
233 - 'apex-workspace-cleanup'
236 name: 'apex-deploy-baremetal-{scenario}-{stream}'
238 # Job template for baremetal deployment
240 # Required Variables:
241 # stream: branch with - in place of / (eg. stable)
242 # branch: branch (eg. stable)
249 credentials-id: '{ssh-credentials}'
257 gs-pathname: '{gs-pathname}'
259 name: DEPLOY_SCENARIO
260 default: '{scenario}'
261 description: "Scenario to deploy with."
265 use-build-blocker: true
273 - 'apex-deploy-baremetal'
274 - 'apex-workspace-cleanup'
277 name: 'apex-daily-{stream}'
279 # Job template for daily build
281 # Required Variables:
282 # stream: branch with - in place of / (eg. stable)
283 # branch: branch (eg. stable)
290 credentials-id: '{ssh-credentials}'
298 gs-pathname: '{gs-pathname}'
302 use-build-blocker: true
313 - project: 'apex-build-{stream}'
315 current-parameters: true
318 - project: 'apex-deploy-baremetal-os-odl_l2-nofeature-ha-{stream}'
319 predefined-parameters:
320 DEPLOY_SCENARIO="os-odl_l2-nofeature-ha"
324 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
327 build-step-failure-threshold: 'never'
328 failure-threshold: 'never'
329 unstable-threshold: 'FAILURE'
331 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
334 build-step-failure-threshold: 'never'
335 failure-threshold: 'never'
336 unstable-threshold: 'FAILURE'
338 ########################
340 ########################
347 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
349 name: ARTIFACT_VERSION
351 description: "Artifact version type"
353 name: BUILD_DIRECTORY
354 default: $WORKSPACE/build_output
355 description: "Directory where the build artifact will be located upon the completion of the build."
357 name: CACHE_DIRECTORY
358 default: $HOME/opnfv/cache{gs-pathname}
359 description: "Directory where the cache to be used during the build is located."
362 default: https://gerrit.opnfv.org/gerrit/$PROJECT
363 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
366 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
367 description: "URL to Google Storage."
369 ########################
371 ########################
380 # log info to console
381 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
382 echo "---------------------------------------------------------------------------------------"
384 # create the cache directory if it doesn't exist
385 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
386 # set OPNFV_ARTIFACT_VERSION
387 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
388 export OPNFV_ARTIFACT_VERSION="bramaputra.1.rc0"
390 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
391 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
392 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
393 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
395 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
400 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
401 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
402 # list the contents of BUILD_OUTPUT directory
403 ls -al $BUILD_DIRECTORY
404 # save information regarding artifact into file
406 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
407 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
408 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
409 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
410 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
411 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
412 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
413 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
414 echo "OPNFV_BUILD_URL=$BUILD_URL"
415 ) > $WORKSPACE/opnfv.properties
417 echo "--------------------------------------------------------"
420 name: 'apex-workspace-cleanup'
428 # delete everything that is in $WORKSPACE
429 /bin/rm -rf $WORKSPACE
432 name: 'apex-upload-artifact'
440 # log info to console
441 echo "Uploading the Apex artifact. This could take some time..."
442 echo "--------------------------------------------------------"
445 # source the opnfv.properties to get ARTIFACT_VERSION
446 source $WORKSPACE/opnfv.properties
448 # upload artifact and additional files to google storage
449 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
450 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL) gs://$GS_URL/$(basename $OPNFV_RPM_URL) > gsutil.iso.log 2>&1
451 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL) gs://$GS_URL/$(basename $OPNFV_SRPM_URL) > gsutil.iso.log 2>&1
452 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
453 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
456 echo "--------------------------------------------------------"
458 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
459 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
462 name: 'apex-deploy-virtual'
470 # log info to console
471 echo "Starting the Apex virtual deployment."
472 echo "--------------------------------------------------------"
475 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
476 # if artifact name is passed the pull a
477 # specific artifact from artifacts.opnfv.org
478 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
480 if [[ -f opnfv.properties ]]; then
481 # if opnfv.properties exists then use the
482 # local build. Source the file so we get local OPNFV vars
483 source opnfv.properties
484 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
486 # no opnfv.properties means use the latest from artifacts.opnfv.org
487 # get the latest.properties to get the link to the latest artifact
488 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
489 [[ -f opnfv.properties ]] || exit 1
490 # source the file so we get OPNFV vars
491 source opnfv.properties
492 RPM_INSTALL_PATH=$OPNFV_RPM_URL
496 source opnfv.properties
497 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
498 if [ ! -e "$RPM_INSTALL_PATH" ]; then
499 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
502 RPM_LIST=$RPM_INSTALL_PATH
503 for pkg in common undercloud; do
504 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
507 # update / install the new rpm
508 if rpm -q opnfv-apex > /dev/null; then
509 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
510 echo "RPM is already installed"
511 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
512 if ! sudo yum downgrade -y $RPM_LIST; then
513 sudo yum remove -y opnfv-undercloud opnfv-common
514 sudo yum downgrade -y $RPM_INSTALL_PATH
518 sudo yum install -y $RPM_LIST;
521 # cleanup virtual machines before we start
523 # initiate virtual deployment
524 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
525 if [ -n "$DEPLOY_SCENARIO" ]; then
526 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
527 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
528 sudo opnfv-deploy -v -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml -n /etc/opnfv-apex/network_settings.yaml
530 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
534 echo "Deploy scenario not set!"
540 echo "--------------------------------------------------------"
544 name: 'apex-deploy-baremetal'
552 # log info to console
553 echo "Starting the Apex baremetal deployment."
554 echo "--------------------------------------------------------"
557 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
558 # if artifact name is passed the pull a
559 # specific artifact from artifacts.opnfv.org
560 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
562 if [[ -f opnfv.properties ]]; then
563 # if opnfv.properties exists then use the
564 # local build. Source the file so we get local OPNFV vars
565 source opnfv.properties
566 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
568 # no opnfv.properties means use the latest from artifacts.opnfv.org
569 # get the latest.properties to get the link to the latest artifact
570 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
571 [[ -f opnfv.properties ]] || exit 1
572 # source the file so we get OPNFV vars
573 source opnfv.properties
574 RPM_INSTALL_PATH=$OPNFV_RPM_URL
578 source opnfv.properties
579 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
580 if [ ! -e "$RPM_INSTALL_PATH" ]; then
581 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
584 RPM_LIST=$RPM_INSTALL_PATH
585 for pkg in common undercloud; do
586 RPM_LIST+=" ${RPM_INSTALL_PATH/opnfv-apex/opnfv-apex-${pkg}}"
589 # update / install the new rpm
590 if rpm -q opnfv-apex > /dev/null; then
591 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
592 echo "RPM is already installed"
593 elif sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
594 if ! sudo yum downgrade -y $RPM_LIST; then
595 sudo yum remove -y opnfv-undercloud opnfv-common
596 sudo yum downgrade -y $RPM_INSTALL_PATH
600 sudo yum install -y $RPM_LIST;
603 # cleanup environment before we start
605 # initiate baremetal deployment
606 if [ -e /etc/opnfv-apex/network_settings.yaml ]; then
607 if [ -n "$DEPLOY_SCENARIO" ]; then
608 echo "Deploy Scenario set to ${DEPLOY_SCENARIO}"
609 if [ -e /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml ]; then
610 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
611 -d /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml \
612 -n /root/network_settings.yaml
614 echo "File does not exist /etc/opnfv-apex/${DEPLOY_SCENARIO}.yaml"
618 echo "Deploy scenario not set!"
621 echo "File /etc/opnfv-apex/network_settings.yaml does not exist!"
626 echo "--------------------------------------------------------"
629 #######################
631 ########################