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}'
27 artifactDaysToKeep: -1
32 gs-pathname: '{gs-pathname}'
40 default: ssh://gerrit.opnfv.org:29418/$PROJECT
41 description: "Used for overriding the GIT URL coming from parameters macro."
45 credentials-id: '{ssh-credentials}'
46 refspec: '$GERRIT_REFSPEC'
47 choosing-strategy: 'gerrit'
52 - patchset-created-event:
53 exclude-drafts: 'false'
54 exclude-trivial-rebase: 'false'
55 exclude-no-code-change: 'false'
56 - draft-published-event
57 - comment-added-contains-event:
58 comment-contains-value: 'recheck'
59 - comment-added-contains-event:
60 comment-contains-value: 'reverify'
62 - project-compare-type: 'ANT'
63 project-pattern: 'apex'
65 - branch-compare-type: 'ANT'
66 branch-pattern: '**/master'
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
88 artifactDaysToKeep: -1
93 gs-pathname: '{gs-pathname}'
101 default: ssh://gerrit.opnfv.org:29418/$PROJECT
102 description: "Used for overriding the GIT URL coming from parameters macro."
105 - gerrit-trigger-scm:
106 credentials-id: '{ssh-credentials}'
108 choosing-strategy: 'default'
113 - change-merged-event
114 - comment-added-contains-event:
115 comment-contains-value: 'remerge'
117 - project-compare-type: 'ANT'
118 project-pattern: 'apex'
120 - branch-compare-type: 'ANT'
121 branch-pattern: '**/master'
122 forbidden-file-paths:
128 - 'apex-deploy-virtual'
129 - 'apex-workspace-cleanup'
132 name: 'apex-daily-{stream}'
134 # Job template for daily builders
136 # Required Variables:
137 # stream: branch with - in place of / (eg. stable)
138 # branch: branch (eg. stable)
144 daysToKeep: '{build-days-to-keep}'
145 numToKeep: '{build-num-to-keep}'
146 artifactDaysToKeep: '{build-artifact-days-to-keep}'
147 artifactNumToKeep: '{build-artifact-num-to-keep}'
153 gs-pathname: '{gs-pathname}'
159 default: ssh://gerrit.opnfv.org:29418/$PROJECT
160 description: "Used for overriding the GIT URL coming from parameters macro."
164 credentials-id: '{ssh-credentials}'
173 - 'apex-deploy-virtual'
174 - 'apex-upload-artifact'
175 - 'apex-workspace-cleanup'
177 - project: 'functest-apex-{stream}'
180 build-step-failure-threshold: 'never'
181 failure-threshold: 'never'
182 unstable-threshold: 'FAILURE'
184 ########################
186 ########################
191 name: BUILD_DIRECTORY
192 default: $WORKSPACE/build_output
193 description: "Directory where the build artifact will be located upon the completion of the build."
195 name: CACHE_DIRECTORY
196 default: $HOME/opnfv/cache/{gs-pathname}
197 description: "Directory where the cache to be used during the build is located."
200 default: https://gerrit.opnfv.org/gerrit/$PROJECT
201 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
204 default: artifacts.opnfv.org/$PROJECT/{gs-pathname}
205 description: "URL to Google Storage."
209 description: "Build Flags"
211 ########################
213 ########################
222 # log info to console
223 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
224 echo "---------------------------------------------------------------------------------------"
225 echo "Build flags for this build are ${FLAGS}"
226 echo "---------------------------------------------------------------------------------------"
228 # create the cache directory if it doesn't exist
229 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
230 # set OPNFV_ARTIFACT_VERSION
231 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
234 ./build.sh $FLAGS -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
235 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
236 # list the contents of BUILD_OUTPUT directory
237 ls -al $BUILD_DIRECTORY
238 # save information regarding artifact into file
240 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
241 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
242 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
243 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
244 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
245 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
246 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
247 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
248 echo "OPNFV_BUILD_URL=$BUILD_URL"
249 ) > $WORKSPACE/opnfv.properties
251 echo "--------------------------------------------------------"
254 name: 'apex-workspace-cleanup'
262 # delete everything that is in $WORKSPACE
263 /bin/rm -rf $WORKSPACE
266 name: 'apex-upload-artifact'
274 # log info to console
275 echo "Uploading the Apex artifact. This could take some time..."
276 echo "--------------------------------------------------------"
279 # source the opnfv.properties to get ARTIFACT_VERSION
280 source $WORKSPACE/opnfv.properties
282 # upload artifact and additional files to google storage
283 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
284 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL) gs://$GS_URL/$(basename $OPNFV_RPM_URL) > gsutil.iso.log 2>&1
285 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL) gs://$GS_URL/$(basename $OPNFV_SRPM_URL) > gsutil.iso.log 2>&1
286 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
287 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
290 echo "--------------------------------------------------------"
292 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
293 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
296 name: 'apex-deploy-virtual'
304 # log info to console
305 echo "Starting the Apex virtual deployment."
306 echo "--------------------------------------------------------"
309 # source the file so we get OPNFV vars
310 source opnfv.properties
311 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
313 # update / install the new rpm
314 if rpm -q opnfv-apex > /dev/null; then
315 if sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
316 sudo yum downgrade -y $RPM_INSTALL_PATH;
319 sudo yum install -y $RPM_INSTALL_PATH;
322 # cleanup virtual machines before we start
324 # initiate virtual deployment
328 echo "--------------------------------------------------------"
331 #######################
333 ########################