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)
23 name: 'apex-verify-{stream}'
30 artifactDaysToKeep: -1
35 gs-pathname: '{gs-pathname}'
43 default: ssh://gerrit.opnfv.org:29418/$PROJECT
44 description: "Used for overriding the GIT URL coming from parameters macro."
48 credentials-id: '{ssh-credentials}'
49 refspec: '$GERRIT_REFSPEC'
50 choosing-strategy: 'gerrit'
55 - patchset-created-event:
56 exclude-drafts: 'false'
57 exclude-trivial-rebase: 'false'
58 exclude-no-code-change: 'false'
59 - draft-published-event
60 - comment-added-contains-event:
61 comment-contains-value: 'recheck'
62 - comment-added-contains-event:
63 comment-contains-value: 'reverify'
65 - project-compare-type: 'ANT'
66 project-pattern: 'apex'
68 - branch-compare-type: 'ANT'
69 branch-pattern: '**/master'
76 use-build-blocker: true
82 - 'apex-deploy-virtual'
83 - 'apex-workspace-cleanup'
86 name: 'apex-merge-{stream}'
88 # builder-merge job to run JJB update
90 # This job's purpose is to update all the JJB
98 gs-pathname: '{gs-pathname}'
106 default: ssh://gerrit.opnfv.org:29418/$PROJECT
107 description: "Used for overriding the GIT URL coming from parameters macro."
110 - gerrit-trigger-scm:
111 credentials-id: '{ssh-credentials}'
113 choosing-strategy: 'default'
118 - change-merged-event
119 - comment-added-contains-event:
120 comment-contains-value: 'remerge'
122 - project-compare-type: 'ANT'
123 project-pattern: 'apex'
125 - branch-compare-type: 'ANT'
126 branch-pattern: '**/master'
127 forbidden-file-paths:
133 - 'apex-deploy-virtual'
134 - 'apex-workspace-cleanup'
137 name: 'apex-build-{stream}'
139 # Job template for builds
141 # Required Variables:
142 # stream: branch with - in place of / (eg. stable)
143 # branch: branch (eg. stable)
152 gs-pathname: '{gs-pathname}'
158 default: ssh://gerrit.opnfv.org:29418/$PROJECT
159 description: "Used for overriding the GIT URL coming from parameters macro."
163 credentials-id: '{ssh-credentials}'
169 - 'apex-deploy-virtual'
170 - 'apex-upload-artifact'
171 - 'apex-workspace-cleanup'
174 name: 'apex-deploy-virtual-{stream}'
176 # Job template for virtual deployment
178 # Required Variables:
179 # stream: branch with - in place of / (eg. stable)
180 # branch: branch (eg. stable)
189 gs-pathname: '{gs-pathname}'
193 - 'apex-deploy-virtual'
194 - 'apex-workspace-cleanup'
197 name: 'apex-deploy-baremetal-{stream}'
199 # Job template for baremetal deployment
201 # Required Variables:
202 # stream: branch with - in place of / (eg. stable)
203 # branch: branch (eg. stable)
212 gs-pathname: '{gs-pathname}'
216 - 'apex-workspace-cleanup'
219 name: 'apex-daily-{stream}'
221 # Job template for daily build
223 # Required Variables:
224 # stream: branch with - in place of / (eg. stable)
225 # branch: branch (eg. stable)
234 gs-pathname: '{gs-pathname}'
239 use-build-blocker: true
248 - project: 'apex-build-{stream}'
252 - project: 'apex-deploy-virtual-{stream}'
256 - project: 'apex-deploy-baremetal-{stream}'
258 - project: 'functest-apex-{stream}'
261 build-step-failure-threshold: 'never'
262 failure-threshold: 'never'
263 unstable-threshold: 'FAILURE'
265 ########################
267 ########################
274 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
276 name: BUILD_DIRECTORY
277 default: $WORKSPACE/build_output
278 description: "Directory where the build artifact will be located upon the completion of the build."
280 name: CACHE_DIRECTORY
281 default: $HOME/opnfv/cache/{gs-pathname}
282 description: "Directory where the cache to be used during the build is located."
285 default: https://gerrit.opnfv.org/gerrit/$PROJECT
286 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
289 default: artifacts.opnfv.org/$PROJECT/{gs-pathname}
290 description: "URL to Google Storage."
294 description: "Build Flags"
296 ########################
298 ########################
307 # log info to console
308 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
309 echo "---------------------------------------------------------------------------------------"
310 echo "Build flags for this build are ${FLAGS}"
311 echo "---------------------------------------------------------------------------------------"
313 # create the cache directory if it doesn't exist
314 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
315 # set OPNFV_ARTIFACT_VERSION
316 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
319 ./build.sh $FLAGS -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
320 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
321 # list the contents of BUILD_OUTPUT directory
322 ls -al $BUILD_DIRECTORY
323 # save information regarding artifact into file
325 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
326 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
327 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
328 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
329 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
330 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
331 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
332 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
333 echo "OPNFV_BUILD_URL=$BUILD_URL"
334 ) > $WORKSPACE/opnfv.properties
336 echo "--------------------------------------------------------"
339 name: 'apex-workspace-cleanup'
347 # delete everything that is in $WORKSPACE
348 /bin/rm -rf $WORKSPACE
351 name: 'apex-upload-artifact'
359 # log info to console
360 echo "Uploading the Apex artifact. This could take some time..."
361 echo "--------------------------------------------------------"
364 # source the opnfv.properties to get ARTIFACT_VERSION
365 source $WORKSPACE/opnfv.properties
367 # upload artifact and additional files to google storage
368 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
369 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL) gs://$GS_URL/$(basename $OPNFV_RPM_URL) > gsutil.iso.log 2>&1
370 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL) gs://$GS_URL/$(basename $OPNFV_SRPM_URL) > gsutil.iso.log 2>&1
371 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
372 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
375 echo "--------------------------------------------------------"
377 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
378 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
381 name: 'apex-deploy-virtual'
389 # log info to console
390 echo "Starting the Apex virtual deployment."
391 echo "--------------------------------------------------------"
394 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
395 # if artifact name is passed the pull a
396 # specific artifact from artifacts.opnfv.org
397 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
399 if [[ -f opnfv.properties ]]; then
400 # if opnfv.properties exists then use the
401 # local build. Source the file so we get local OPNFV vars
402 source opnfv.properties
403 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
405 # no opnfv.properties means use the latest from artifacts.opnfv.org
406 # get the latest.properties to get the link to the latest artifact
407 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
408 [[ -f opnfv.properties ]] || exit 1
409 # source the file so we get OPNFV vars
410 source opnfv.properties
411 RPM_INSTALL_PATH=$RPM_URL
415 source opnfv.properties
416 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
418 # update / install the new rpm
419 if rpm -q opnfv-apex > /dev/null; then
420 if sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
421 sudo yum downgrade -y $RPM_INSTALL_PATH;
424 sudo yum install -y $RPM_INSTALL_PATH;
427 # cleanup virtual machines before we start
429 # initiate virtual deployment
433 echo "--------------------------------------------------------"
436 #######################
438 ########################