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-workspace-cleanup'
82 name: 'apex-merge-{stream}'
84 # builder-merge job to run JJB update
86 # This job's purpose is to update all the JJB
90 project-type: freestyle
95 artifactDaysToKeep: -1
100 gs-pathname: '{gs-pathname}'
108 default: ssh://gerrit.opnfv.org:29418/$PROJECT
109 description: "Used for overriding the GIT URL coming from parameters macro."
112 - gerrit-trigger-scm:
113 credentials-id: '{ssh-credentials}'
115 choosing-strategy: 'default'
118 - ssh-agent-credentials:
119 user: '{ssh-credentials}'
124 - change-merged-event
125 - comment-added-contains-event:
126 comment-contains-value: 'remerge'
128 - project-compare-type: 'ANT'
129 project-pattern: 'apex'
131 - branch-compare-type: 'ANT'
132 branch-pattern: '**/master'
133 forbidden-file-paths:
139 - 'apex-workspace-cleanup'
142 name: 'apex-daily-{stream}'
144 # Job template for daily builders
146 # Required Variables:
147 # stream: branch with - in place of / (eg. stable)
148 # branch: branch (eg. stable)
153 project-type: freestyle
156 daysToKeep: '{build-days-to-keep}'
157 numToKeep: '{build-num-to-keep}'
158 artifactDaysToKeep: '{build-artifact-days-to-keep}'
159 artifactNumToKeep: '{build-artifact-num-to-keep}'
165 gs-pathname: '{gs-pathname}'
171 default: ssh://gerrit.opnfv.org:29418/$PROJECT
172 description: "Used for overriding the GIT URL coming from parameters macro."
176 credentials-id: '{ssh-credentials}'
181 - ssh-agent-credentials:
182 user: '{ssh-credentials}'
189 - 'apex-upload-artifact'
190 - 'apex-workspace-cleanup'
192 ########################
194 ########################
199 name: BUILD_DIRECTORY
200 default: $WORKSPACE/build_output
201 description: "Directory where the build artifact will be located upon the completion of the build."
203 name: CACHE_DIRECTORY
204 default: $HOME/opnfv/cache/{gs-pathname}
205 description: "Directory where the cache to be used during the build is located."
208 default: https://gerrit.opnfv.org/gerrit/$PROJECT
209 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
212 default: artifacts.opnfv.org/$PROJECT/{gs-pathname}
213 description: "URL to Google Storage."
217 description: "Build Flags"
219 ########################
221 ########################
230 # log info to console
231 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
232 echo "---------------------------------------------------------------------------------------"
233 echo "Build flags for this build are ${FLAGS}"
234 echo "---------------------------------------------------------------------------------------"
236 # create the cache directory if it doesn't exist
237 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
238 # set OPNFV_ARTIFACT_VERSION
239 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
242 ./build.sh $FLAGS -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
243 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
244 # list the contents of BUILD_OUTPUT directory
245 ls -al $BUILD_DIRECTORY
246 # save information regarding artifact into file
248 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
249 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
250 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
251 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
252 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
253 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
254 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.rpm"
255 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.rpm | cut -d' ' -f1)"
256 echo "OPNFV_BUILD_URL=$BUILD_URL"
257 ) > $WORKSPACE/opnfv.properties
259 echo "--------------------------------------------------------"
262 name: 'apex-workspace-cleanup'
270 # delete everything that is in $WORKSPACE
271 /bin/rm -rf $WORKSPACE
274 name: 'apex-upload-artifact'
282 # log info to console
283 echo "Uploading the Apex artifact. This could take some time..."
284 echo "--------------------------------------------------------"
287 # source the opnfv.properties to get ARTIFACT_VERSION
288 source $WORKSPACE/opnfv.properties
290 # upload artifact and additional files to google storage
291 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
292 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL) gs://$GS_URL/$(basename $OPNFV_RPM_URL) > gsutil.iso.log 2>&1
293 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL) gs://$GS_URL/$(basename $OPNFV_SRPM_URL) > gsutil.iso.log 2>&1
294 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
295 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
298 echo "--------------------------------------------------------"
300 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
301 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
304 #######################
306 ########################