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)
21 name: 'apex-verify-{stream}'
27 gs-pathname: '{gs-pathname}'
34 default: https://gerrit.opnfv.org/gerrit/$PROJECT
35 description: "Used for overriding the GIT URL coming from parameters macro."
39 credentials-id: '{ssh-credentials}'
40 refspec: '$GERRIT_REFSPEC'
41 choosing-strategy: 'gerrit'
46 - patchset-created-event:
47 exclude-drafts: 'false'
48 exclude-trivial-rebase: 'false'
49 exclude-no-code-change: 'false'
50 - draft-published-event
51 - comment-added-contains-event:
52 comment-contains-value: 'recheck'
53 - comment-added-contains-event:
54 comment-contains-value: 'reverify'
56 - project-compare-type: 'ANT'
57 project-pattern: 'apex'
59 - branch-compare-type: 'ANT'
60 branch-pattern: '**/master'
76 use-build-blocker: true
84 - 'apex-deploy-virtual'
85 - 'apex-workspace-cleanup'
88 name: 'apex-merge-{stream}'
90 # builder-merge job to run JJB update
92 # This job's purpose is to update all the JJB
100 gs-pathname: '{gs-pathname}'
107 default: https://gerrit.opnfv.org/gerrit/$PROJECT
108 description: "Used for overriding the GIT URL coming from parameters macro."
111 - gerrit-trigger-scm:
112 credentials-id: '{ssh-credentials}'
114 choosing-strategy: 'default'
119 - change-merged-event
120 - comment-added-contains-event:
121 comment-contains-value: 'remerge'
123 - project-compare-type: 'ANT'
124 project-pattern: 'apex'
126 - branch-compare-type: 'ANT'
127 branch-pattern: '**/master'
128 forbidden-file-paths:
134 - 'apex-deploy-virtual'
135 - 'apex-workspace-cleanup'
138 name: 'apex-build-{stream}'
140 # Job template for builds
142 # Required Variables:
143 # stream: branch with - in place of / (eg. stable)
144 # branch: branch (eg. stable)
153 gs-pathname: '{gs-pathname}'
158 default: https://gerrit.opnfv.org/gerrit/$PROJECT
159 description: "Used for overriding the GIT URL coming from parameters macro."
163 credentials-id: '{ssh-credentials}'
169 use-build-blocker: true
175 - 'apex-deploy-virtual'
176 - 'apex-upload-artifact'
177 - 'apex-workspace-cleanup'
180 name: 'apex-deploy-virtual-{stream}'
182 # Job template for virtual deployment
184 # Required Variables:
185 # stream: branch with - in place of / (eg. stable)
186 # branch: branch (eg. stable)
193 credentials-id: '{ssh-credentials}'
201 gs-pathname: '{gs-pathname}'
205 use-build-blocker: true
213 - 'apex-deploy-virtual'
214 - 'apex-workspace-cleanup'
217 name: 'apex-deploy-baremetal-{stream}'
219 # Job template for baremetal 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}'
242 use-build-blocker: true
250 - 'apex-deploy-baremetal'
251 - 'apex-workspace-cleanup'
254 name: 'apex-daily-{stream}'
256 # Job template for daily build
258 # Required Variables:
259 # stream: branch with - in place of / (eg. stable)
260 # branch: branch (eg. stable)
267 credentials-id: '{ssh-credentials}'
275 gs-pathname: '{gs-pathname}'
279 use-build-blocker: true
290 - project: 'apex-build-{stream}'
294 - project: 'apex-deploy-virtual-{stream}'
298 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
301 build-step-failure-threshold: 'never'
302 failure-threshold: 'never'
303 unstable-threshold: 'FAILURE'
305 ########################
307 ########################
314 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
316 name: BUILD_DIRECTORY
317 default: $WORKSPACE/build_output
318 description: "Directory where the build artifact will be located upon the completion of the build."
320 name: CACHE_DIRECTORY
321 default: $HOME/opnfv/cache/{gs-pathname}
322 description: "Directory where the cache to be used during the build is located."
325 default: https://gerrit.opnfv.org/gerrit/$PROJECT
326 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
329 default: artifacts.opnfv.org/$PROJECT/{gs-pathname}
330 description: "URL to Google Storage."
332 ########################
334 ########################
343 # log info to console
344 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
345 echo "---------------------------------------------------------------------------------------"
347 # create the cache directory if it doesn't exist
348 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
349 # set OPNFV_ARTIFACT_VERSION
350 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
353 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
354 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
355 # list the contents of BUILD_OUTPUT directory
356 ls -al $BUILD_DIRECTORY
357 # save information regarding artifact into file
359 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
360 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
361 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
362 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
363 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
364 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
365 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
366 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
367 echo "OPNFV_BUILD_URL=$BUILD_URL"
368 ) > $WORKSPACE/opnfv.properties
370 echo "--------------------------------------------------------"
373 name: 'apex-workspace-cleanup'
381 # delete everything that is in $WORKSPACE
382 /bin/rm -rf $WORKSPACE
385 name: 'apex-upload-artifact'
393 # log info to console
394 echo "Uploading the Apex artifact. This could take some time..."
395 echo "--------------------------------------------------------"
398 # source the opnfv.properties to get ARTIFACT_VERSION
399 source $WORKSPACE/opnfv.properties
401 # upload artifact and additional files to google storage
402 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
403 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL) gs://$GS_URL/$(basename $OPNFV_RPM_URL) > gsutil.iso.log 2>&1
404 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL) gs://$GS_URL/$(basename $OPNFV_SRPM_URL) > gsutil.iso.log 2>&1
405 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
406 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
409 echo "--------------------------------------------------------"
411 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
412 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
415 name: 'apex-deploy-virtual'
423 # log info to console
424 echo "Starting the Apex virtual deployment."
425 echo "--------------------------------------------------------"
428 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
429 # if artifact name is passed the pull a
430 # specific artifact from artifacts.opnfv.org
431 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
433 if [[ -f opnfv.properties ]]; then
434 # if opnfv.properties exists then use the
435 # local build. Source the file so we get local OPNFV vars
436 source opnfv.properties
437 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
439 # no opnfv.properties means use the latest from artifacts.opnfv.org
440 # get the latest.properties to get the link to the latest artifact
441 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
442 [[ -f opnfv.properties ]] || exit 1
443 # source the file so we get OPNFV vars
444 source opnfv.properties
445 RPM_INSTALL_PATH=$OPNFV_RPM_URL
449 source opnfv.properties
450 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
452 # update / install the new rpm
453 if rpm -q opnfv-apex > /dev/null; then
454 if sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
455 sudo yum downgrade -y $RPM_INSTALL_PATH;
458 sudo yum install -y $RPM_INSTALL_PATH;
461 # cleanup virtual machines before we start
463 # initiate virtual deployment
464 if [ -e /usr/share/doc/opnfv/network_settings.yaml.example ]; then
465 sudo opnfv-deploy -v -d /usr/share/doc/opnfv/deploy_settings.yaml.example -n /usr/share/doc/opnfv/network_settings.yaml.example
470 echo "--------------------------------------------------------"
474 name: 'apex-deploy-baremetal'
482 # log info to console
483 echo "Starting the Apex baremetal deployment."
484 echo "--------------------------------------------------------"
487 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
488 # if artifact name is passed the pull a
489 # specific artifact from artifacts.opnfv.org
490 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
492 if [[ -f opnfv.properties ]]; then
493 # if opnfv.properties exists then use the
494 # local build. Source the file so we get local OPNFV vars
495 source opnfv.properties
496 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
498 # no opnfv.properties means use the latest from artifacts.opnfv.org
499 # get the latest.properties to get the link to the latest artifact
500 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
501 [[ -f opnfv.properties ]] || exit 1
502 # source the file so we get OPNFV vars
503 source opnfv.properties
504 RPM_INSTALL_PATH=$OPNFV_RPM_URL
508 source opnfv.properties
509 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
510 if [ ! -e "$RPM_INSTALL_PATH" ]; then
511 RPM_INSTALL_PATH=http://${OPNFV_RPM_URL}
514 # update / install the new rpm
515 if rpm -q opnfv-apex > /dev/null; then
516 if [ $(basename $OPNFV_RPM_URL) == $(rpm -q opnfv-apex).rpm ]; then
517 echo "RPM is already installed"
518 elif sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
519 sudo yum downgrade -y $RPM_INSTALL_PATH;
522 sudo yum install -y $RPM_INSTALL_PATH;
525 # cleanup environment before we start
527 # initiate baremetal deployment
528 sudo opnfv-deploy -i /root/inventory/pod_settings.yaml \
529 -d /usr/share/doc/opnfv/deploy_settings.yaml.example \
530 -n /root/network/network_settings.yaml
533 echo "--------------------------------------------------------"
536 #######################
538 ########################