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
87 gs-pathname: '{gs-pathname}'
95 default: ssh://gerrit.opnfv.org:29418/$PROJECT
96 description: "Used for overriding the GIT URL coming from parameters macro."
100 credentials-id: '{ssh-credentials}'
102 choosing-strategy: 'default'
107 - change-merged-event
108 - comment-added-contains-event:
109 comment-contains-value: 'remerge'
111 - project-compare-type: 'ANT'
112 project-pattern: 'apex'
114 - branch-compare-type: 'ANT'
115 branch-pattern: '**/master'
116 forbidden-file-paths:
122 - 'apex-deploy-virtual'
123 - 'apex-workspace-cleanup'
126 name: 'apex-daily-{stream}'
128 # Job template for daily builders
130 # Required Variables:
131 # stream: branch with - in place of / (eg. stable)
132 # branch: branch (eg. stable)
141 gs-pathname: '{gs-pathname}'
147 default: ssh://gerrit.opnfv.org:29418/$PROJECT
148 description: "Used for overriding the GIT URL coming from parameters macro."
152 credentials-id: '{ssh-credentials}'
161 - 'apex-deploy-virtual'
162 - 'apex-upload-artifact'
163 - 'apex-workspace-cleanup'
165 - project: 'functest-apex-{stream}'
168 build-step-failure-threshold: 'never'
169 failure-threshold: 'never'
170 unstable-threshold: 'FAILURE'
172 ########################
174 ########################
179 name: BUILD_DIRECTORY
180 default: $WORKSPACE/build_output
181 description: "Directory where the build artifact will be located upon the completion of the build."
183 name: CACHE_DIRECTORY
184 default: $HOME/opnfv/cache/{gs-pathname}
185 description: "Directory where the cache to be used during the build is located."
188 default: https://gerrit.opnfv.org/gerrit/$PROJECT
189 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
192 default: artifacts.opnfv.org/$PROJECT/{gs-pathname}
193 description: "URL to Google Storage."
197 description: "Build Flags"
199 ########################
201 ########################
210 # log info to console
211 echo "Starting the build of Apex using OpenStack Master packages. This will take some time..."
212 echo "---------------------------------------------------------------------------------------"
213 echo "Build flags for this build are ${FLAGS}"
214 echo "---------------------------------------------------------------------------------------"
216 # create the cache directory if it doesn't exist
217 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
218 # set OPNFV_ARTIFACT_VERSION
219 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
222 ./build.sh $FLAGS -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
223 RPM_VERSION=$(grep Version $BUILD_DIRECTORY/../build/opnfv-apex.spec | awk '{ print $2 }')-$(echo $OPNFV_ARTIFACT_VERSION | tr -d '_-')
224 # list the contents of BUILD_OUTPUT directory
225 ls -al $BUILD_DIRECTORY
226 # save information regarding artifact into file
228 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
229 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
230 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
231 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
232 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
233 echo "OPNFV_SRPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.src.rpm"
234 echo "OPNFV_RPM_URL=$GS_URL/opnfv-apex-$RPM_VERSION.noarch.rpm"
235 echo "OPNFV_RPM_MD5SUM=$(md5sum $BUILD_DIRECTORY/opnfv-apex-$RPM_VERSION.noarch.rpm | cut -d' ' -f1)"
236 echo "OPNFV_BUILD_URL=$BUILD_URL"
237 ) > $WORKSPACE/opnfv.properties
239 echo "--------------------------------------------------------"
242 name: 'apex-workspace-cleanup'
250 # delete everything that is in $WORKSPACE
251 /bin/rm -rf $WORKSPACE
254 name: 'apex-upload-artifact'
262 # log info to console
263 echo "Uploading the Apex artifact. This could take some time..."
264 echo "--------------------------------------------------------"
267 # source the opnfv.properties to get ARTIFACT_VERSION
268 source $WORKSPACE/opnfv.properties
270 # upload artifact and additional files to google storage
271 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
272 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_RPM_URL) gs://$GS_URL/$(basename $OPNFV_RPM_URL) > gsutil.iso.log 2>&1
273 gsutil cp $BUILD_DIRECTORY/$(basename $OPNFV_SRPM_URL) gs://$GS_URL/$(basename $OPNFV_SRPM_URL) > gsutil.iso.log 2>&1
274 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
275 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
278 echo "--------------------------------------------------------"
280 echo "ISO Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
281 echo "RPM Artifact is available as http://$GS_URL/$(basename $OPNFV_RPM_URL)"
284 name: 'apex-deploy-virtual'
292 # log info to console
293 echo "Starting the Apex virtual deployment."
294 echo "--------------------------------------------------------"
297 # source the file so we get OPNFV vars
298 source opnfv.properties
299 RPM_INSTALL_PATH=build_output/$(basename $OPNFV_RPM_URL)
301 # update / install the new rpm
302 if rpm -q opnfv-apex > /dev/null; then
303 if sudo yum update -y $RPM_INSTALL_PATH | grep "does not update installed package"; then
304 sudo yum downgrade -y $RPM_INSTALL_PATH;
307 sudo yum install -y $RPM_INSTALL_PATH;
310 # cleanup virtual machines before we start
312 # initiate virtual deployment
316 echo "--------------------------------------------------------"
319 #######################
321 ########################