1 # this is the job configuration for bgs
9 - 'genesis-foreman-verify'
10 - 'genesis-foreman-merge'
11 - 'genesis-foreman-daily-{stream}'
12 - 'genesis-foreman-deploy'
14 # stream: branch with - in place of / (eg. stable-helium)
15 # branch: branch (eg. stable/helium)
22 ########################
24 ########################
27 name: 'genesis-foreman-verify'
29 project-type: freestyle
36 artifactDaysToKeep: -1
42 default: $WORKSPACE/build_output
45 default: https://gerrit.opnfv.org/gerrit/genesis
53 credentials-id: '{ssh-credentials}'
54 refspec: '$GERRIT_REFSPEC'
55 choosing-strategy: 'gerrit'
58 - ssh-agent-credentials:
59 user: '{ssh-credentials}'
64 - patchset-created-event:
65 exclude-drafts: 'false'
66 exclude-trivial-rebase: 'false'
67 exclude-no-code-change: 'false'
68 - draft-published-event
69 - comment-added-contains-event:
70 comment-contains-value: 'recheck'
71 - comment-added-contains-event:
72 comment-contains-value: 'reverify'
74 - project-compare-type: 'ANT'
75 project-pattern: 'genesis'
77 - branch-compare-type: 'ANT'
78 branch-pattern: '**/master'
90 name: 'genesis-foreman-merge'
92 # builder-merge job to run JJB update
94 # This job's purpose is to update all the JJB
96 project-type: freestyle
103 artifactDaysToKeep: -1
108 name: BUILD_DIRECTORY
109 default: $WORKSPACE/build_output
112 default: https://gerrit.opnfv.org/gerrit/genesis
119 - gerrit-trigger-scm:
120 credentials-id: '{ssh-credentials}'
122 choosing-strategy: 'default'
125 - ssh-agent-credentials:
126 user: '{ssh-credentials}'
131 - change-merged-event
132 - comment-added-contains-event:
133 comment-contains-value: 'remerge'
135 - project-compare-type: 'ANT'
136 project-pattern: 'genesis'
138 - branch-compare-type: 'ANT'
139 branch-pattern: '**/master'
144 pattern: 'foreman/**'
150 name: 'genesis-foreman-daily-{stream}'
152 project-type: freestyle
158 name: BUILD_DIRECTORY
159 default: $WORKSPACE/build_output
160 description: "Directory where the build artifact will be located upon the completion of the build."
163 default: 'artifacts.opnfv.org/genesis/foreman'
164 description: "URL to Google Storage."
168 description: "Installer to use."
171 default: https://gerrit.opnfv.org/gerrit/genesis
174 default: origin/master
175 description: "Branch to build, deploy and test."
178 default: refs/heads/master
179 description: "Refspec to retrieve."
187 refspec: $GERRIT_REFSPEC
190 - pollscm: '@midnight'
195 artifactDaysToKeep: -1
196 artifactNumToKeep: -1
199 - 'foreman-daily-master'
203 name: 'genesis-foreman-deploy'
205 project-type: freestyle
212 artifactDaysToKeep: -1
213 artifactNumToKeep: -1
219 default: https://gerrit.opnfv.org/gerrit/genesis
220 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
223 default: origin/master
224 description: "Branch to build, deploy and test."
227 default: refs/heads/master
228 description: "Refspec to retrieve."
231 default: 'artifacts.opnfv.org/genesis/fuel'
232 description: "URL to Google Storage."
234 name: BUILD_DIRECTORY
235 default: $WORKSPACE/build_output
236 description: "Directory where the build artifact will be located upon the completion of the build."
244 refspec: $GERRIT_REFSPEC
249 ########################
251 ########################
262 # get the dependencies - temporary fix for RC0
263 [[ -d $WORKSPACE/foreman/build ]] || mkdir -p $WORKSPACE/foreman/build
264 cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/foreman/build/
266 # below lines perhaps need to be enabled in order to fetch images from internet
267 # as we are having disk space issues on ericsson-build slave
268 #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
269 #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
270 #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
273 cd $WORKSPACE/foreman/ci
274 ./build.sh $BUILD_DIRECTORY
276 # list the build artifacts
277 ls -al $BUILD_DIRECTORY
279 # remove the BUILD_DIRECTORY to reclaim some space
280 /bin/rm -rf $BUILD_DIRECTORY
292 # get the dependencies - temporary fix for RC0
293 [[ -d $WORKSPACE/foreman/build ]] || mkdir -p $WORKSPACE/foreman/build
294 cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/foreman/build/
296 # below lines perhaps need to be enabled in order to fetch images from internet
297 # as we are having disk space issues on ericsson-build slave
298 #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
299 #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
300 #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
303 cd $WORKSPACE/foreman/ci
304 ./build.sh $BUILD_DIRECTORY
306 # list the build artifacts
307 ls -al $BUILD_DIRECTORY
309 # remove the BUILD_DIRECTORY to reclaim some space
310 /bin/rm -rf $BUILD_DIRECTORY
313 name: foreman-daily-master
322 # get the dependencies - temporary fix for RC0
323 [[ -d $WORKSPACE/foreman/build ]] || mkdir -p $WORKSPACE/foreman/build
324 cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/foreman/build/
326 # below lines perhaps need to be enabled in order to fetch images from internet
327 # as we are having disk space issues on ericsson-build slave
328 #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
329 #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
330 #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
333 cd $WORKSPACE/foreman/ci
334 ./build.sh -v $BUILD_ID $BUILD_DIRECTORY
343 # list the build artifacts
344 ls -al $BUILD_DIRECTORY
348 # save information regarding artifact into file
350 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
351 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
352 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$BUILD_ID.iso"
353 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum opnfv-$ARTIFACT_VERSION.iso | cut -d' ' -f1)"
354 echo "OPNFV_BUILD_URL=$BUILD_URL"
355 echo "OPNFV_BUILD=OK"
356 ) > opnfv-$BUILD_ID.properties
358 # copy artifact property file as latest.properties
359 # so we can directly get info regarding latest artifact
360 /bin/cp -f opnfv-$BUILD_ID.properties latest.properties
362 # upload artifact and additional files to google storage
363 gsutil cp OPNFV-CentOS-7-x86_64-$BUILD_ID.iso gs://$GS_URL/opnfv-$BUILD_ID.iso
364 gsutil cp opnfv-$BUILD_ID.properties gs://$GS_URL/opnfv-$BUILD_ID.properties
365 gsutil cp latest.properties gs://$GS_URL/latest.properties
374 # get the latest.properties file in order to get info regarding latest artifact
375 gsutil cp gs://$GS_URL/latest.properties latest.properties
377 # check if we got the file
378 [[ -f latest.properties ]] || exit 1
380 # source the file so we get OPNFV vars
381 source latest.properties
384 gsutil cp gs://$OPNFV_ARTIFACT_URL $WORKSPACE/opnfv.iso
387 ls -al $WORKSPACE/opnfv.iso
389 # remove the BUILD_DIRECTORY and downlaoded artifact to reclaim some space
390 /bin/rm -rf $BUILD_DIRECTORY
391 /bin/rm -rf $WORKSPACE/opnfv.iso
406 sudo $WORKSPACE/foreman/ci/clean.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml
408 # and then initiate deployment
409 sudo $WORKSPACE/foreman/ci/deploy.sh -base_config $WORKSPACE/foreman/ci/inventory/lf_pod2_ksgen_settings.yml