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 ########################
313 ########################
320 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
322 name: ARTIFACT_VERSION
324 description: "Artifact version type"
326 name: BUILD_DIRECTORY
327 default: $WORKSPACE/build_output
328 description: "Directory where the build artifact will be located upon the completion of the build."
330 name: CACHE_DIRECTORY
331 default: $HOME/opnfv/cache{gs-pathname}
332 description: "Directory where the cache to be used during the build is located."
335 default: https://gerrit.opnfv.org/gerrit/$PROJECT
336 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
339 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
340 description: "URL to Google Storage."
342 ########################
344 ########################
353 # log info to console
354 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
355 echo "---------------------------------------------------------------------------------------"
357 # create the cache directory if it doesn't exist
358 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
359 # set OPNFV_ARTIFACT_VERSION
360 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
361 export OPNFV_ARTIFACT_VERSION="bramaputra.1.rc0"
363 if [ "$ARTIFACT_VERSION" == "dev" ]; then
364 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
365 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
366 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
368 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
373 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
374 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
375 # list the contents of BUILD_OUTPUT directory
376 ls -al $BUILD_DIRECTORY
377 # save information regarding artifact into file
379 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
380 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
381 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
382 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
383 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
384 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
385 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
386 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
387 echo "OPNFV_BUILD_URL=$BUILD_URL"
388 ) > $WORKSPACE/opnfv.properties
390 echo "--------------------------------------------------------"
393 name: 'apex-workspace-cleanup'
401 # delete everything that is in $WORKSPACE
402 /bin/rm -rf $WORKSPACE
405 name: 'apex-upload-artifact'
413 # log info to console
414 echo "Uploading the Apex artifact. This could take some time..."
415 echo "--------------------------------------------------------"
418 # source the opnfv.properties to get ARTIFACT_VERSION
419 source $WORKSPACE/opnfv.properties
421 # upload artifact and additional files to google storage
422 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
423 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL) gs://$GS_URL/$(basename $OPNFV_RPM_URL) > gsutil.iso.log 2>&1
424 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL) gs://$GS_URL/$(basename $OPNFV_SRPM_URL) > gsutil.iso.log 2>&1
425 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
426 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
429 echo "--------------------------------------------------------"
431 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
432 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
435 name: 'apex-deploy-virtual'
443 # log info to console
444 echo "Starting the Apex virtual deployment."
445 echo "--------------------------------------------------------"
448 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
449 # if artifact name is passed the pull a
450 # specific artifact from artifacts.opnfv.org
451 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
453 if [[ -f opnfv.properties ]]; then
454 # if opnfv.properties exists then use the
455 # local build. Source the file so we get local OPNFV vars
456 source opnfv.properties
457 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
459 # no opnfv.properties means use the latest from artifacts.opnfv.org
460 # get the latest.properties to get the link to the latest artifact
461 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
462 [[ -f opnfv.properties ]] || exit 1
463 # source the file so we get OPNFV vars
464 source opnfv.properties
465 RPM_INSTALL_PATH=$OPNFV_RPM_URL
469 source opnfv.properties
470 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
472 # update / install the new rpm
473 if rpm -q opnfv-apex > /dev/null; then
474 if sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
475 sudo yum downgrade -y $RPM_INSTALL_PATH;
478 sudo yum install -y $RPM_INSTALL_PATH;
481 # cleanup virtual machines before we start
483 # initiate virtual deployment
484 if [ -e /usr/share/doc/opnfv/network_settings.yaml.example ]; then
485 sudo opnfv-deploy -v -d /usr/share/doc/opnfv/deploy_settings.yaml.example -n /usr/share/doc/opnfv/network_settings.yaml.example
490 echo "--------------------------------------------------------"
494 name: 'apex-deploy-baremetal'
502 # log info to console
503 echo "Starting the Apex baremetal deployment."
504 echo "--------------------------------------------------------"
507 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
508 # if artifact name is passed the pull a
509 # specific artifact from artifacts.opnfv.org
510 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
512 if [[ -f opnfv.properties ]]; then
513 # if opnfv.properties exists then use the
514 # local build. Source the file so we get local OPNFV vars
515 source opnfv.properties
516 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
518 # no opnfv.properties means use the latest from artifacts.opnfv.org
519 # get the latest.properties to get the link to the latest artifact
520 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
521 [[ -f opnfv.properties ]] || exit 1
522 # source the file so we get OPNFV vars
523 source opnfv.properties
524 RPM_INSTALL_PATH=$OPNFV_RPM_URL
528 source opnfv.properties
529 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
530 if [ ! -e "$RPM_INSTALL_PATH" ]; then
531 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
534 # update / install the new rpm
535 if rpm -q opnfv-apex > /dev/null; then
536 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
537 echo "RPM is already installed"
538 elif sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
539 sudo yum downgrade -y $RPM_INSTALL_PATH;
542 sudo yum install -y $RPM_INSTALL_PATH;
545 # cleanup environment before we start
547 # initiate baremetal deployment
548 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
549 -d /usr/share/doc/opnfv/deploy_settings.yaml.example \
550 -n /root/network/network_settings.yaml
553 echo "--------------------------------------------------------"
556 #######################
558 ########################