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-deploy-virtual'
193 - 'apex-workspace-cleanup'
195 - project: 'functest-apex-{stream}'
198 build-step-failure-threshold: 'never'
199 failure-threshold: 'never'
200 unstable-threshold: 'FAILURE'
202 ########################
204 ########################
209 name: BUILD_DIRECTORY
210 default: $WORKSPACE/build_output
211 description: "Directory where the build artifact will be located upon the completion of the build."
213 name: CACHE_DIRECTORY
214 default: $HOME/opnfv/cache/{gs-pathname}
215 description: "Directory where the cache to be used during the build is located."
218 default: https://gerrit.opnfv.org/gerrit/$PROJECT
219 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
222 default: artifacts.opnfv.org/$PROJECT/{gs-pathname}
223 description: "URL to Google Storage."
227 description: "Build Flags"
229 ########################
231 ########################
240 # log info to console
241 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
242 echo "---------------------------------------------------------------------------------------"
243 echo "Build flags for this build are ${FLAGS}"
244 echo "---------------------------------------------------------------------------------------"
246 # create the cache directory if it doesn't exist
247 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
248 # set OPNFV_ARTIFACT_VERSION
249 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
252 ./build.sh $FLAGS -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
253 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
254 # list the contents of BUILD_OUTPUT directory
255 ls -al $BUILD_DIRECTORY
256 # save information regarding artifact into file
258 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
259 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
260 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
261 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
262 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
263 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
264 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
265 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
266 echo "OPNFV_BUILD_URL=$BUILD_URL"
267 ) > $WORKSPACE/opnfv.properties
269 echo "--------------------------------------------------------"
272 name: 'apex-workspace-cleanup'
280 # delete everything that is in $WORKSPACE
281 /bin/rm -rf $WORKSPACE
284 name: 'apex-upload-artifact'
292 # log info to console
293 echo "Uploading the Apex artifact. This could take some time..."
294 echo "--------------------------------------------------------"
297 # source the opnfv.properties to get ARTIFACT_VERSION
298 source $WORKSPACE/opnfv.properties
300 # upload artifact and additional files to google storage
301 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
302 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL) gs://$GS_URL/$(basename $OPNFV_RPM_URL) > gsutil.iso.log 2>&1
303 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL) gs://$GS_URL/$(basename $OPNFV_SRPM_URL) > gsutil.iso.log 2>&1
304 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
305 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
308 echo "--------------------------------------------------------"
310 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
311 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
314 name: 'apex-deploy-virtual'
322 # log info to console
323 echo "Starting the Apex virtual deployment."
324 echo "--------------------------------------------------------"
327 # check if we got the file
328 if [[ -f opnfv.properties ]]; then
329 # source the file so we get OPNFV vars
330 source opnfv.properties
331 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
333 # get the latest.properties file in order to get info regarding latest artifact
334 curl -s -o $WORKSPACE/opnfv.properties http://$GS_URL/latest.properties
335 [[ -f opnfv.properties ]] || exit 1
337 # source the file so we get OPNFV vars
338 source opnfv.properties
339 RPM_INSTALL_PATH=$RPM_URL
342 # update / install the new rpm
343 if rpm -q opnfv-apex > /dev/null; then
344 if sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
345 sudo yum downgrade -y $RPM_INSTALL_PATH;
348 sudo yum install -y $RPM_INSTALL_PATH;
351 # cleanup virtual machines before we start
353 # initiate virtual deployment
357 echo "--------------------------------------------------------"
360 #######################
362 ########################