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}'
31 ARTIFACT_VERSION: 'dev'
38 default: https://gerrit.opnfv.org/gerrit/$PROJECT
39 description: "Used for overriding the GIT URL coming from parameters macro."
43 credentials-id: '{ssh-credentials}'
44 refspec: '$GERRIT_REFSPEC'
45 choosing-strategy: 'gerrit'
50 - patchset-created-event:
51 exclude-drafts: 'false'
52 exclude-trivial-rebase: 'false'
53 exclude-no-code-change: 'false'
54 - draft-published-event
55 - comment-added-contains-event:
56 comment-contains-value: 'recheck'
57 - comment-added-contains-event:
58 comment-contains-value: 'reverify'
60 - project-compare-type: 'ANT'
61 project-pattern: 'apex'
63 - branch-compare-type: 'ANT'
64 branch-pattern: '**/{branch}'
80 use-build-blocker: true
88 - 'apex-deploy-virtual'
89 - 'apex-workspace-cleanup'
92 name: 'apex-merge-{stream}'
94 # builder-merge job to run JJB update
96 # This job's purpose is to update all the JJB
104 gs-pathname: '{gs-pathname}'
111 default: https://gerrit.opnfv.org/gerrit/$PROJECT
112 description: "Used for overriding the GIT URL coming from parameters macro."
115 - gerrit-trigger-scm:
116 credentials-id: '{ssh-credentials}'
118 choosing-strategy: 'default'
123 - change-merged-event
124 - comment-added-contains-event:
125 comment-contains-value: 'remerge'
127 - project-compare-type: 'ANT'
128 project-pattern: 'apex'
130 - branch-compare-type: 'ANT'
131 branch-pattern: '**/master'
132 forbidden-file-paths:
138 - 'apex-deploy-virtual'
139 - 'apex-workspace-cleanup'
142 name: 'apex-build-{stream}'
144 # Job template for builds
146 # Required Variables:
147 # stream: branch with - in place of / (eg. stable)
148 # branch: branch (eg. stable)
157 gs-pathname: '{gs-pathname}'
162 default: https://gerrit.opnfv.org/gerrit/$PROJECT
163 description: "Used for overriding the GIT URL coming from parameters macro."
167 credentials-id: '{ssh-credentials}'
173 use-build-blocker: true
179 - 'apex-deploy-virtual'
180 - 'apex-upload-artifact'
181 - 'apex-workspace-cleanup'
184 name: 'apex-deploy-virtual-{stream}'
186 # Job template for virtual deployment
188 # Required Variables:
189 # stream: branch with - in place of / (eg. stable)
190 # branch: branch (eg. stable)
197 credentials-id: '{ssh-credentials}'
205 gs-pathname: '{gs-pathname}'
209 use-build-blocker: true
216 - 'apex-deploy-virtual'
217 - 'apex-workspace-cleanup'
220 name: 'apex-deploy-baremetal-{stream}'
222 # Job template for baremetal deployment
224 # Required Variables:
225 # stream: branch with - in place of / (eg. stable)
226 # branch: branch (eg. stable)
233 credentials-id: '{ssh-credentials}'
241 gs-pathname: '{gs-pathname}'
245 use-build-blocker: true
253 - 'apex-deploy-baremetal'
254 - 'apex-workspace-cleanup'
257 name: 'apex-daily-{stream}'
259 # Job template for daily build
261 # Required Variables:
262 # stream: branch with - in place of / (eg. stable)
263 # branch: branch (eg. stable)
270 credentials-id: '{ssh-credentials}'
278 gs-pathname: '{gs-pathname}'
282 use-build-blocker: true
293 - project: 'apex-build-{stream}'
295 current-parameters: true
298 - project: 'apex-deploy-baremetal-{stream}'
302 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
305 build-step-failure-threshold: 'never'
306 failure-threshold: 'never'
307 unstable-threshold: 'FAILURE'
309 - project: 'yardstick-apex-opnfv-jump-1-daily-{stream}'
312 build-step-failure-threshold: 'never'
313 failure-threshold: 'never'
314 unstable-threshold: 'FAILURE'
316 ########################
318 ########################
325 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
327 name: ARTIFACT_VERSION
329 description: "Artifact version type"
331 name: BUILD_DIRECTORY
332 default: $WORKSPACE/build_output
333 description: "Directory where the build artifact will be located upon the completion of the build."
335 name: CACHE_DIRECTORY
336 default: $HOME/opnfv/cache{gs-pathname}
337 description: "Directory where the cache to be used during the build is located."
340 default: https://gerrit.opnfv.org/gerrit/$PROJECT
341 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
344 default: artifacts.opnfv.org/$PROJECT{gs-pathname}
345 description: "URL to Google Storage."
347 ########################
349 ########################
358 # log info to console
359 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
360 echo "---------------------------------------------------------------------------------------"
362 # create the cache directory if it doesn't exist
363 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
364 # set OPNFV_ARTIFACT_VERSION
365 if echo $GERRIT_BRANCH | grep "brahmaputra" 1> /dev/null; then
366 export OPNFV_ARTIFACT_VERSION="bramaputra.1.rc0"
368 if echo $BUILD_TAG | grep "apex-verify" 1> /dev/null; then
369 export OPNFV_ARTIFACT_VERSION=dev${BUILD_NUMBER}
370 elif [ "$ARTIFACT_VERSION" == "daily" ]; then
371 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d")
373 export OPNFV_ARTIFACT_VERSION=${ARTIFACT_VERSION}
378 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
379 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
380 # list the contents of BUILD_OUTPUT directory
381 ls -al $BUILD_DIRECTORY
382 # save information regarding artifact into file
384 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
385 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
386 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
387 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
388 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
389 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
390 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
391 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
392 echo "OPNFV_BUILD_URL=$BUILD_URL"
393 ) > $WORKSPACE/opnfv.properties
395 echo "--------------------------------------------------------"
398 name: 'apex-workspace-cleanup'
406 # delete everything that is in $WORKSPACE
407 /bin/rm -rf $WORKSPACE
410 name: 'apex-upload-artifact'
418 # log info to console
419 echo "Uploading the Apex artifact. This could take some time..."
420 echo "--------------------------------------------------------"
423 # source the opnfv.properties to get ARTIFACT_VERSION
424 source $WORKSPACE/opnfv.properties
426 # upload artifact and additional files to google storage
427 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
428 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL) gs://$GS_URL/$(basename $OPNFV_RPM_URL) > gsutil.iso.log 2>&1
429 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL) gs://$GS_URL/$(basename $OPNFV_SRPM_URL) > gsutil.iso.log 2>&1
430 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
431 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
434 echo "--------------------------------------------------------"
436 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
437 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
440 name: 'apex-deploy-virtual'
448 # log info to console
449 echo "Starting the Apex virtual deployment."
450 echo "--------------------------------------------------------"
453 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
454 # if artifact name is passed the pull a
455 # specific artifact from artifacts.opnfv.org
456 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
458 if [[ -f opnfv.properties ]]; then
459 # if opnfv.properties exists then use the
460 # local build. Source the file so we get local OPNFV vars
461 source opnfv.properties
462 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
464 # no opnfv.properties means use the latest from artifacts.opnfv.org
465 # get the latest.properties to get the link to the latest artifact
466 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
467 [[ -f opnfv.properties ]] || exit 1
468 # source the file so we get OPNFV vars
469 source opnfv.properties
470 RPM_INSTALL_PATH=$OPNFV_RPM_URL
474 source opnfv.properties
475 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
477 # update / install the new rpm
478 if rpm -q opnfv-apex > /dev/null; then
479 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
480 echo "RPM is already installed"
481 elif 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 ########################