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'
52 - ssh-agent-credentials:
53 user: '{ssh-credentials}'
58 - patchset-created-event:
59 exclude-drafts: 'false'
60 exclude-trivial-rebase: 'false'
61 exclude-no-code-change: 'false'
62 - draft-published-event
63 - comment-added-contains-event:
64 comment-contains-value: 'recheck'
65 - comment-added-contains-event:
66 comment-contains-value: 'reverify'
68 - project-compare-type: 'ANT'
69 project-pattern: 'apex'
71 - branch-compare-type: 'ANT'
72 branch-pattern: '**/master'
79 - 'apex-deploy-virtual'
80 - 'apex-workspace-cleanup'
83 name: 'apex-merge-{stream}'
85 # builder-merge job to run JJB update
87 # This job's purpose is to update all the JJB
91 project-type: freestyle
96 artifactDaysToKeep: -1
101 gs-pathname: '{gs-pathname}'
109 default: ssh://gerrit.opnfv.org:29418/$PROJECT
110 description: "Used for overriding the GIT URL coming from parameters macro."
113 - gerrit-trigger-scm:
114 credentials-id: '{ssh-credentials}'
116 choosing-strategy: 'default'
119 - ssh-agent-credentials:
120 user: '{ssh-credentials}'
125 - change-merged-event
126 - comment-added-contains-event:
127 comment-contains-value: 'remerge'
129 - project-compare-type: 'ANT'
130 project-pattern: 'apex'
132 - branch-compare-type: 'ANT'
133 branch-pattern: '**/master'
134 forbidden-file-paths:
140 - 'apex-deploy-virtual'
141 - 'apex-workspace-cleanup'
144 name: 'apex-daily-{stream}'
146 # Job template for daily builders
148 # Required Variables:
149 # stream: branch with - in place of / (eg. stable)
150 # branch: branch (eg. stable)
155 project-type: freestyle
158 daysToKeep: '{build-days-to-keep}'
159 numToKeep: '{build-num-to-keep}'
160 artifactDaysToKeep: '{build-artifact-days-to-keep}'
161 artifactNumToKeep: '{build-artifact-num-to-keep}'
167 gs-pathname: '{gs-pathname}'
173 default: ssh://gerrit.opnfv.org:29418/$PROJECT
174 description: "Used for overriding the GIT URL coming from parameters macro."
178 credentials-id: '{ssh-credentials}'
183 - ssh-agent-credentials:
184 user: '{ssh-credentials}'
191 - 'apex-upload-artifact'
192 - 'apex-workspace-cleanup'
193 - 'apex-deploy-virtual'
194 - 'apex-workspace-cleanup'
196 ########################
198 ########################
203 name: BUILD_DIRECTORY
204 default: $WORKSPACE/build_output
205 description: "Directory where the build artifact will be located upon the completion of the build."
207 name: CACHE_DIRECTORY
208 default: $HOME/opnfv/cache/{gs-pathname}
209 description: "Directory where the cache to be used during the build is located."
212 default: https://gerrit.opnfv.org/gerrit/$PROJECT
213 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
216 default: artifacts.opnfv.org/$PROJECT/{gs-pathname}
217 description: "URL to Google Storage."
221 description: "Build Flags"
223 ########################
225 ########################
234 # log info to console
235 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
236 echo "---------------------------------------------------------------------------------------"
237 echo "Build flags for this build are ${FLAGS}"
238 echo "---------------------------------------------------------------------------------------"
240 # create the cache directory if it doesn't exist
241 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
242 # set OPNFV_ARTIFACT_VERSION
243 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
246 ./build.sh $FLAGS -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
247 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
248 # list the contents of BUILD_OUTPUT directory
249 ls -al $BUILD_DIRECTORY
250 # save information regarding artifact into file
252 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
253 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
254 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
255 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
256 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
257 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
258 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
259 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
260 echo "OPNFV_BUILD_URL=$BUILD_URL"
261 ) > $WORKSPACE/opnfv.properties
263 echo "--------------------------------------------------------"
266 name: 'apex-workspace-cleanup'
274 # delete everything that is in $WORKSPACE
275 /bin/rm -rf $WORKSPACE
278 name: 'apex-upload-artifact'
286 # log info to console
287 echo "Uploading the Apex artifact. This could take some time..."
288 echo "--------------------------------------------------------"
291 # source the opnfv.properties to get ARTIFACT_VERSION
292 source $WORKSPACE/opnfv.properties
294 # upload artifact and additional files to google storage
295 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
296 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL) gs://$GS_URL/$(basename $OPNFV_RPM_URL) > gsutil.iso.log 2>&1
297 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL) gs://$GS_URL/$(basename $OPNFV_SRPM_URL) > gsutil.iso.log 2>&1
298 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
299 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
302 echo "--------------------------------------------------------"
304 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
305 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
308 name: 'apex-deploy-virtual'
316 # log info to console
317 echo "Starting the Apex virtual deployment."
318 echo "--------------------------------------------------------"
321 # check if we got the file
322 if [[ -f opnfv.properties ]]; then
323 # source the file so we get OPNFV vars
324 source opnfv.properties
325 RPM_INSTALL_PATH=noarch/$(basepath RPM_URL)
327 # get the latest.properties file in order to get info regarding latest artifact
328 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
329 [[ -f opnfv.properties ]] || exit 1
331 # source the file so we get OPNFV vars
332 source opnfv.properties
333 RPM_INSTALL_PATH=$RPM_URL
336 # update / install the new rpm
337 if rpm -q opnfv-apex; then
338 sudo yum update -y $RPM_INSTALL_PATH;
340 sudo yum install -y $RPM_INSTALL_PATH;
343 # cleanup virtual machines before we start
345 # initiate virtual deployment
349 echo "--------------------------------------------------------"
352 #######################
354 ########################