4 - 'apex-verify-{stream}'
5 - 'apex-merge-{stream}'
6 - 'apex-build-{stream}'
7 - 'apex-deploy-virtual-{stream}'
8 - 'apex-deploy-baremetal-{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'
24 name: 'apex-verify-{stream}'
30 gs-pathname: '{gs-pathname}'
37 default: https://gerrit.opnfv.org/gerrit/$PROJECT
38 description: "Used for overriding the GIT URL coming from parameters macro."
40 name: ARTIFACT_VERSION
42 description: "Artifact version type"
46 credentials-id: '{ssh-credentials}'
47 refspec: '$GERRIT_REFSPEC'
48 choosing-strategy: 'gerrit'
53 - patchset-created-event:
54 exclude-drafts: 'false'
55 exclude-trivial-rebase: 'false'
56 exclude-no-code-change: 'false'
57 - draft-published-event
58 - comment-added-contains-event:
59 comment-contains-value: 'recheck'
60 - comment-added-contains-event:
61 comment-contains-value: 'reverify'
63 - project-compare-type: 'ANT'
64 project-pattern: 'apex'
66 - branch-compare-type: 'ANT'
67 branch-pattern: '**/master'
83 use-build-blocker: true
91 - 'apex-deploy-virtual'
92 - 'apex-workspace-cleanup'
95 name: 'apex-merge-{stream}'
97 # builder-merge job to run JJB update
99 # This job's purpose is to update all the JJB
107 gs-pathname: '{gs-pathname}'
114 default: https://gerrit.opnfv.org/gerrit/$PROJECT
115 description: "Used for overriding the GIT URL coming from parameters macro."
118 - gerrit-trigger-scm:
119 credentials-id: '{ssh-credentials}'
121 choosing-strategy: 'default'
126 - change-merged-event
127 - comment-added-contains-event:
128 comment-contains-value: 'remerge'
130 - project-compare-type: 'ANT'
131 project-pattern: 'apex'
133 - branch-compare-type: 'ANT'
134 branch-pattern: '**/master'
135 forbidden-file-paths:
141 - 'apex-deploy-virtual'
142 - 'apex-workspace-cleanup'
145 name: 'apex-build-{stream}'
147 # Job template for builds
149 # Required Variables:
150 # stream: branch with - in place of / (eg. stable)
151 # branch: branch (eg. stable)
160 gs-pathname: '{gs-pathname}'
165 default: https://gerrit.opnfv.org/gerrit/$PROJECT
166 description: "Used for overriding the GIT URL coming from parameters macro."
170 credentials-id: '{ssh-credentials}'
176 use-build-blocker: true
182 - 'apex-deploy-virtual'
183 - 'apex-upload-artifact'
184 - 'apex-workspace-cleanup'
187 name: 'apex-deploy-virtual-{stream}'
189 # Job template for virtual deployment
191 # Required Variables:
192 # stream: branch with - in place of / (eg. stable)
193 # branch: branch (eg. stable)
200 credentials-id: '{ssh-credentials}'
208 gs-pathname: '{gs-pathname}'
212 use-build-blocker: true
219 - 'apex-deploy-virtual'
220 - 'apex-workspace-cleanup'
223 name: 'apex-deploy-baremetal-{stream}'
225 # Job template for baremetal deployment
227 # Required Variables:
228 # stream: branch with - in place of / (eg. stable)
229 # branch: branch (eg. stable)
236 credentials-id: '{ssh-credentials}'
244 gs-pathname: '{gs-pathname}'
248 use-build-blocker: true
256 - 'apex-deploy-baremetal'
257 - 'apex-workspace-cleanup'
260 name: 'apex-daily-{stream}'
262 # Job template for daily build
264 # Required Variables:
265 # stream: branch with - in place of / (eg. stable)
266 # branch: branch (eg. stable)
273 credentials-id: '{ssh-credentials}'
281 gs-pathname: '{gs-pathname}'
285 use-build-blocker: true
296 - project: 'apex-build-{stream}'
300 - project: 'apex-deploy-baremetal-{stream}'
304 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
307 build-step-failure-threshold: 'never'
308 failure-threshold: 'never'
309 unstable-threshold: 'FAILURE'
311 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
314 build-step-failure-threshold: 'never'
315 failure-threshold: 'never'
316 unstable-threshold: 'FAILURE'
318 ########################
320 ########################
327 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
329 name: ARTIFACT_VERSION
331 description: "Artifact version type"
333 name: BUILD_DIRECTORY
334 default: $WORKSPACE/build_output
335 description: "Directory where the build artifact will be located upon the completion of the build."
337 name: CACHE_DIRECTORY
338 default: $HOME/opnfv/cache{gs-pathname}
339 description: "Directory where the cache to be used during the build is located."
342 default: https://gerrit.opnfv.org/gerrit/$PROJECT
343 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
346 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
347 description: "URL to Google Storage."
349 ########################
351 ########################
360 # log info to console
361 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
362 echo "---------------------------------------------------------------------------------------"
364 # create the cache directory if it doesn't exist
365 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
366 # set OPNFV_ARTIFACT_VERSION
367 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
368 export OPNFV_ARTIFACT_VERSION="bramaputra.1.rc0"
370 if [ "$ARTIFACT_VERSION" == "dev" ]; then
371 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
372 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
373 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
375 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
380 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
381 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
382 # list the contents of BUILD_OUTPUT directory
383 ls -al $BUILD_DIRECTORY
384 # save information regarding artifact into file
386 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
387 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
388 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
389 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
390 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
391 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
392 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
393 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
394 echo "OPNFV_BUILD_URL=$BUILD_URL"
395 ) > $WORKSPACE/opnfv.properties
397 echo "--------------------------------------------------------"
400 name: 'apex-workspace-cleanup'
408 # delete everything that is in $WORKSPACE
409 /bin/rm -rf $WORKSPACE
412 name: 'apex-upload-artifact'
420 # log info to console
421 echo "Uploading the Apex artifact. This could take some time..."
422 echo "--------------------------------------------------------"
425 # source the opnfv.properties to get ARTIFACT_VERSION
426 source $WORKSPACE/opnfv.properties
428 # upload artifact and additional files to google storage
429 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
430 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL) gs://$GS_URL/$(basename $OPNFV_RPM_URL) > gsutil.iso.log 2>&1
431 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL) gs://$GS_URL/$(basename $OPNFV_SRPM_URL) > gsutil.iso.log 2>&1
432 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
433 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
436 echo "--------------------------------------------------------"
438 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
439 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
442 name: 'apex-deploy-virtual'
450 # log info to console
451 echo "Starting the Apex virtual deployment."
452 echo "--------------------------------------------------------"
455 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
456 # if artifact name is passed the pull a
457 # specific artifact from artifacts.opnfv.org
458 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
460 if [[ -f opnfv.properties ]]; then
461 # if opnfv.properties exists then use the
462 # local build. Source the file so we get local OPNFV vars
463 source opnfv.properties
464 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
466 # no opnfv.properties means use the latest from artifacts.opnfv.org
467 # get the latest.properties to get the link to the latest artifact
468 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
469 [[ -f opnfv.properties ]] || exit 1
470 # source the file so we get OPNFV vars
471 source opnfv.properties
472 RPM_INSTALL_PATH=$OPNFV_RPM_URL
476 source opnfv.properties
477 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
479 # update / install the new rpm
480 if rpm -q opnfv-apex > /dev/null; then
481 if sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
482 sudo yum downgrade -y $RPM_INSTALL_PATH;
485 sudo yum install -y $RPM_INSTALL_PATH;
488 # cleanup virtual machines before we start
490 # initiate virtual deployment
491 if [ -e /usr/share/doc/opnfv/network_settings.yaml.example ]; then
492 sudo opnfv-deploy -v -d /usr/share/doc/opnfv/deploy_settings.yaml.example -n /usr/share/doc/opnfv/network_settings.yaml.example
497 echo "--------------------------------------------------------"
501 name: 'apex-deploy-baremetal'
509 # log info to console
510 echo "Starting the Apex baremetal 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 [[ -f opnfv.properties ]]; then
520 # if opnfv.properties exists then use the
521 # local build. Source the file so we get local OPNFV vars
522 source opnfv.properties
523 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
525 # no opnfv.properties means use the latest from artifacts.opnfv.org
526 # get the latest.properties to get the link to the latest artifact
527 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
528 [[ -f opnfv.properties ]] || exit 1
529 # source the file so we get OPNFV vars
530 source opnfv.properties
531 RPM_INSTALL_PATH=$OPNFV_RPM_URL
535 source opnfv.properties
536 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
537 if [ ! -e "$RPM_INSTALL_PATH" ]; then
538 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
541 # update / install the new rpm
542 if rpm -q opnfv-apex > /dev/null; then
543 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
544 echo "RPM is already installed"
545 elif sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
546 sudo yum downgrade -y $RPM_INSTALL_PATH;
549 sudo yum install -y $RPM_INSTALL_PATH;
552 # cleanup environment before we start
554 # initiate baremetal deployment
555 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
556 -d /usr/share/doc/opnfv/deploy_settings.yaml.example \
557 -n /root/network/network_settings.yaml
560 echo "--------------------------------------------------------"
563 #######################
565 ########################