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: ssh://gerrit.opnfv.org:29418/$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'
67 use-build-blocker: true
73 - 'apex-deploy-virtual'
74 - 'apex-workspace-cleanup'
77 name: 'apex-merge-{stream}'
79 # builder-merge job to run JJB update
81 # This job's purpose is to update all the JJB
89 gs-pathname: '{gs-pathname}'
96 default: ssh://gerrit.opnfv.org:29418/$PROJECT
97 description: "Used for overriding the GIT URL coming from parameters macro."
100 - gerrit-trigger-scm:
101 credentials-id: '{ssh-credentials}'
103 choosing-strategy: 'default'
108 - change-merged-event
109 - comment-added-contains-event:
110 comment-contains-value: 'remerge'
112 - project-compare-type: 'ANT'
113 project-pattern: 'apex'
115 - branch-compare-type: 'ANT'
116 branch-pattern: '**/master'
117 forbidden-file-paths:
123 - 'apex-deploy-virtual'
124 - 'apex-workspace-cleanup'
127 name: 'apex-build-{stream}'
129 # Job template for builds
131 # Required Variables:
132 # stream: branch with - in place of / (eg. stable)
133 # branch: branch (eg. stable)
142 gs-pathname: '{gs-pathname}'
147 default: ssh://gerrit.opnfv.org:29418/$PROJECT
148 description: "Used for overriding the GIT URL coming from parameters macro."
152 credentials-id: '{ssh-credentials}'
158 - 'apex-deploy-virtual'
159 - 'apex-upload-artifact'
160 - 'apex-workspace-cleanup'
163 name: 'apex-deploy-virtual-{stream}'
165 # Job template for virtual deployment
167 # Required Variables:
168 # stream: branch with - in place of / (eg. stable)
169 # branch: branch (eg. stable)
176 credentials-id: '{ssh-credentials}'
184 gs-pathname: '{gs-pathname}'
187 - 'apex-deploy-virtual'
188 - 'apex-workspace-cleanup'
191 name: 'apex-deploy-baremetal-{stream}'
193 # Job template for baremetal deployment
195 # Required Variables:
196 # stream: branch with - in place of / (eg. stable)
197 # branch: branch (eg. stable)
204 credentials-id: '{ssh-credentials}'
212 gs-pathname: '{gs-pathname}'
215 - 'apex-workspace-cleanup'
218 name: 'apex-daily-{stream}'
220 # Job template for daily build
222 # Required Variables:
223 # stream: branch with - in place of / (eg. stable)
224 # branch: branch (eg. stable)
231 credentials-id: '{ssh-credentials}'
239 gs-pathname: '{gs-pathname}'
243 use-build-blocker: true
252 - project: 'apex-build-{stream}'
256 - project: 'apex-deploy-virtual-{stream}'
260 - project: 'apex-deploy-baremetal-{stream}'
262 - project: 'functest-apex-opnfv-jump-1-daily-{stream}'
265 build-step-failure-threshold: 'never'
266 failure-threshold: 'never'
267 unstable-threshold: 'FAILURE'
269 ########################
271 ########################
278 description: "RPM Artifact name that will be appended to GS_URL to deploy a specific artifact"
280 name: BUILD_DIRECTORY
281 default: $WORKSPACE/build_output
282 description: "Directory where the build artifact will be located upon the completion of the build."
284 name: CACHE_DIRECTORY
285 default: $HOME/opnfv/cache/{gs-pathname}
286 description: "Directory where the cache to be used during the build is located."
289 default: https://gerrit.opnfv.org/gerrit/$PROJECT
290 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
293 default: artifacts.opnfv.org/$PROJECT/{gs-pathname}
294 description: "URL to Google Storage."
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 "---------------------------------------------------------------------------------------"
311 # create the cache directory if it doesn't exist
312 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
313 # set OPNFV_ARTIFACT_VERSION
314 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
317 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
318 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
319 # list the contents of BUILD_OUTPUT directory
320 ls -al $BUILD_DIRECTORY
321 # save information regarding artifact into file
323 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
324 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
325 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
326 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
327 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
328 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
329 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
330 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
331 echo "OPNFV_BUILD_URL=$BUILD_URL"
332 ) > $WORKSPACE/opnfv.properties
334 echo "--------------------------------------------------------"
337 name: 'apex-workspace-cleanup'
345 # delete everything that is in $WORKSPACE
346 /bin/rm -rf $WORKSPACE
349 name: 'apex-upload-artifact'
357 # log info to console
358 echo "Uploading the Apex artifact. This could take some time..."
359 echo "--------------------------------------------------------"
362 # source the opnfv.properties to get ARTIFACT_VERSION
363 source $WORKSPACE/opnfv.properties
365 # upload artifact and additional files to google storage
366 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
367 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL) gs://$GS_URL/$(basename $OPNFV_RPM_URL) > gsutil.iso.log 2>&1
368 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL) gs://$GS_URL/$(basename $OPNFV_SRPM_URL) > gsutil.iso.log 2>&1
369 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
370 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
373 echo "--------------------------------------------------------"
375 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
376 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
379 name: 'apex-deploy-virtual'
387 # log info to console
388 echo "Starting the Apex virtual deployment."
389 echo "--------------------------------------------------------"
392 if [[ ! "$ARTIFACT_NAME" == "latest" ]]; then
393 # if artifact name is passed the pull a
394 # specific artifact from artifacts.opnfv.org
395 RPM_INSTALL_PATH=$GS_URL/$ARTIFACT_NAME
397 if [[ -f opnfv.properties ]]; then
398 # if opnfv.properties exists then use the
399 # local build. Source the file so we get local OPNFV vars
400 source opnfv.properties
401 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
403 # no opnfv.properties means use the latest from artifacts.opnfv.org
404 # get the latest.properties to get the link to the latest artifact
405 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
406 [[ -f opnfv.properties ]] || exit 1
407 # source the file so we get OPNFV vars
408 source opnfv.properties
409 RPM_INSTALL_PATH=$OPNFV_RPM_URL
413 source opnfv.properties
414 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
416 # update / install the new rpm
417 if rpm -q opnfv-apex > /dev/null; then
418 if sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
419 sudo yum downgrade -y $RPM_INSTALL_PATH;
422 sudo yum install -y $RPM_INSTALL_PATH;
425 # cleanup virtual machines before we start
427 # initiate virtual deployment
428 sudo opnfv-deploy -v -d /usr/share/doc/opnfv/deploy_settings.yaml.example
431 echo "--------------------------------------------------------"
434 #######################
436 ########################