4 - 'apex-verify-{stream}'
5 - 'apex-merge-{stream}'
6 - 'apex-daily-{stream}'
8 # stream: branch with - in place of / (eg. stable-arno)
9 # branch: branch (eg. stable/arno)
20 name: 'apex-verify-{stream}'
24 project-type: freestyle
29 artifactDaysToKeep: -1
34 gs-pathname: '{gs-pathname}'
42 default: ssh://gerrit.opnfv.org:29418/$PROJECT
43 description: "Used for overriding the GIT URL coming from parameters macro."
47 credentials-id: '{ssh-credentials}'
48 refspec: '$GERRIT_REFSPEC'
49 choosing-strategy: 'gerrit'
54 - patchset-created-event:
55 exclude-drafts: 'false'
56 exclude-trivial-rebase: 'false'
57 exclude-no-code-change: 'false'
58 - draft-published-event
59 - comment-added-contains-event:
60 comment-contains-value: 'recheck'
61 - comment-added-contains-event:
62 comment-contains-value: 'reverify'
64 - project-compare-type: 'ANT'
65 project-pattern: 'apex'
67 - branch-compare-type: 'ANT'
68 branch-pattern: '**/master'
75 - 'apex-deploy-virtual'
76 - 'apex-workspace-cleanup'
79 name: 'apex-merge-{stream}'
81 # builder-merge job to run JJB update
83 # This job's purpose is to update all the JJB
87 project-type: freestyle
92 artifactDaysToKeep: -1
97 gs-pathname: '{gs-pathname}'
105 default: ssh://gerrit.opnfv.org:29418/$PROJECT
106 description: "Used for overriding the GIT URL coming from parameters macro."
109 - gerrit-trigger-scm:
110 credentials-id: '{ssh-credentials}'
112 choosing-strategy: 'default'
117 - change-merged-event
118 - comment-added-contains-event:
119 comment-contains-value: 'remerge'
121 - project-compare-type: 'ANT'
122 project-pattern: 'apex'
124 - branch-compare-type: 'ANT'
125 branch-pattern: '**/master'
126 forbidden-file-paths:
132 - 'apex-deploy-virtual'
133 - 'apex-workspace-cleanup'
136 name: 'apex-daily-{stream}'
138 # Job template for daily builders
140 # Required Variables:
141 # stream: branch with - in place of / (eg. stable)
142 # branch: branch (eg. stable)
147 project-type: freestyle
150 daysToKeep: '{build-days-to-keep}'
151 numToKeep: '{build-num-to-keep}'
152 artifactDaysToKeep: '{build-artifact-days-to-keep}'
153 artifactNumToKeep: '{build-artifact-num-to-keep}'
159 gs-pathname: '{gs-pathname}'
165 default: ssh://gerrit.opnfv.org:29418/$PROJECT
166 description: "Used for overriding the GIT URL coming from parameters macro."
170 credentials-id: '{ssh-credentials}'
179 - 'apex-upload-artifact'
180 - 'apex-deploy-virtual'
181 - 'apex-workspace-cleanup'
183 - project: 'functest-apex-{stream}'
186 build-step-failure-threshold: 'never'
187 failure-threshold: 'never'
188 unstable-threshold: 'FAILURE'
190 ########################
192 ########################
197 name: BUILD_DIRECTORY
198 default: $WORKSPACE/build_output
199 description: "Directory where the build artifact will be located upon the completion of the build."
201 name: CACHE_DIRECTORY
202 default: $HOME/opnfv/cache/{gs-pathname}
203 description: "Directory where the cache to be used during the build is located."
206 default: https://gerrit.opnfv.org/gerrit/$PROJECT
207 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
210 default: artifacts.opnfv.org/$PROJECT/{gs-pathname}
211 description: "URL to Google Storage."
215 description: "Build Flags"
217 ########################
219 ########################
228 # log info to console
229 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
230 echo "---------------------------------------------------------------------------------------"
231 echo "Build flags for this build are ${FLAGS}"
232 echo "---------------------------------------------------------------------------------------"
234 # create the cache directory if it doesn't exist
235 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
236 # set OPNFV_ARTIFACT_VERSION
237 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
240 ./build.sh $FLAGS -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
241 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
242 # list the contents of BUILD_OUTPUT directory
243 ls -al $BUILD_DIRECTORY
244 # save information regarding artifact into file
246 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
247 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
248 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
249 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
250 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
251 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
252 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
253 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
254 echo "OPNFV_BUILD_URL=$BUILD_URL"
255 ) > $WORKSPACE/opnfv.properties
257 echo "--------------------------------------------------------"
260 name: 'apex-workspace-cleanup'
268 # delete everything that is in $WORKSPACE
269 /bin/rm -rf $WORKSPACE
272 name: 'apex-upload-artifact'
280 # log info to console
281 echo "Uploading the Apex artifact. This could take some time..."
282 echo "--------------------------------------------------------"
285 # source the opnfv.properties to get ARTIFACT_VERSION
286 source $WORKSPACE/opnfv.properties
288 # upload artifact and additional files to google storage
289 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
290 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL) gs://$GS_URL/$(basename $OPNFV_RPM_URL) > gsutil.iso.log 2>&1
291 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL) gs://$GS_URL/$(basename $OPNFV_SRPM_URL) > gsutil.iso.log 2>&1
292 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
293 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
296 echo "--------------------------------------------------------"
298 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
299 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
302 name: 'apex-deploy-virtual'
310 # log info to console
311 echo "Starting the Apex virtual deployment."
312 echo "--------------------------------------------------------"
315 # check if we got the file
316 if [[ -f opnfv.properties ]]; then
317 # source the file so we get OPNFV vars
318 source opnfv.properties
319 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
321 # get the latest.properties file in order to get info regarding latest artifact
322 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
323 [[ -f opnfv.properties ]] || exit 1
325 # source the file so we get OPNFV vars
326 source opnfv.properties
327 RPM_INSTALL_PATH=$RPM_URL
330 # update / install the new rpm
331 if rpm -q opnfv-apex > /dev/null; then
332 if sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
333 sudo yum downgrade -y $RPM_INSTALL_PATH;
336 sudo yum install -y $RPM_INSTALL_PATH;
339 # cleanup virtual machines before we start
341 # initiate virtual deployment
345 echo "--------------------------------------------------------"
348 #######################
350 ########################