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
217 name: BUILD_DIRECTORY
218 default: $WORKSPACE/build_output
221 default: https://github.com/trozet/bgs_vagrant.git
222 description: "This is a temporary location to clone the needed scripts. Will be replaced with OPNFV Git URL."
225 default: origin/master
226 description: "Branch to build, deploy and test."
229 default: refs/heads/master
230 description: "Refspec to retrieve."
238 refspec: $GERRIT_REFSPEC
241 - ssh-agent-credentials:
242 user: '{ssh-credentials}'
247 ########################
249 ########################
260 # get the dependencies - temporary fix for RC0
261 [[ -d $WORKSPACE/foreman/build ]] || mkdir -p $WORKSPACE/foreman/build
262 cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/foreman/build/
264 # below lines perhaps need to be enabled in order to fetch images from internet
265 # as we are having disk space issues on ericsson-build slave
266 #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
267 #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
268 #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
271 cd $WORKSPACE/foreman/ci
272 ./build.sh $BUILD_DIRECTORY
274 # list the build artifacts
275 ls -al $BUILD_DIRECTORY
277 # remove the BUILD_DIRECTORY to reclaim some space
278 /bin/rm -rf $BUILD_DIRECTORY
290 # get the dependencies - temporary fix for RC0
291 [[ -d $WORKSPACE/foreman/build ]] || mkdir -p $WORKSPACE/foreman/build
292 cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/foreman/build/
294 # below lines perhaps need to be enabled in order to fetch images from internet
295 # as we are having disk space issues on ericsson-build slave
296 #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
297 #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
298 #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
301 cd $WORKSPACE/foreman/ci
302 ./build.sh $BUILD_DIRECTORY
304 # list the build artifacts
305 ls -al $BUILD_DIRECTORY
307 # remove the BUILD_DIRECTORY to reclaim some space
308 /bin/rm -rf $BUILD_DIRECTORY
311 name: foreman-daily-master
320 # get the dependencies - temporary fix for RC0
321 [[ -d $WORKSPACE/foreman/build ]] || mkdir -p $WORKSPACE/foreman/build
322 cp /home/jenkins/Downloads/opnfv_iso/* $WORKSPACE/foreman/build/
324 # below lines perhaps need to be enabled in order to fetch images from internet
325 # as we are having disk space issues on ericsson-build slave
326 #wget http://ftp.riken.jp/Linux/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Minimal.iso
327 #wget http://download.virtualbox.org/virtualbox/rpm/fedora/20/x86_64/VirtualBox-4.3-4.3.26_98988_fedora18-1.x86_64.rpm
328 #wget http://repos.duss-janser.ch/vagrant/vagrant_1.7.2_x86_64.rpm
331 cd $WORKSPACE/foreman/ci
332 ./build.sh -v $BUILD_ID $BUILD_DIRECTORY
341 # list the build artifacts
342 ls -al $BUILD_DIRECTORY
346 # save information regarding artifact into file
348 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
349 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
350 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$BUILD_ID.iso"
351 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum opnfv-$ARTIFACT_VERSION.iso | cut -d' ' -f1)"
352 echo "OPNFV_BUILD_URL=$BUILD_URL"
353 echo "OPNFV_BUILD=OK"
354 ) > opnfv-$BUILD_ID.properties
356 # copy artifact property file as latest.properties
357 # so we can directly get info regarding latest artifact
358 /bin/cp -f opnfv-$BUILD_ID.properties latest.properties
360 # upload artifact and additional files to google storage
361 gsutil cp OPNFV-CentOS-7-x86_64-$BUILD_ID.iso gs://$GS_URL/opnfv-$BUILD_ID.iso
362 gsutil cp opnfv-$BUILD_ID.properties gs://$GS_URL/opnfv-$BUILD_ID.properties
363 gsutil cp latest.properties gs://$GS_URL/latest.properties
372 # get the latest.properties file in order to get info regarding latest artifact
373 gsutil cp gs://$GS_URL/latest.properties latest.properties
375 # check if we got the file
376 [[ -f latest.properties ]] || exit 1
378 # source the file so we get OPNFV vars
379 source latest.properties
382 gsutil cp gs://$OPNFV_ARTIFACT_URL $WORKSPACE/opnfv.iso
385 ls -al $WORKSPACE/opnfv.iso
387 # remove the BUILD_DIRECTORY and downlaoded artifact to reclaim some space
388 /bin/rm -rf $BUILD_DIRECTORY
389 /bin/rm -rf $WORKSPACE/opnfv.iso