1 ########################
2 # Job configuration for genesis/foreman
3 ########################
13 - 'genesis-foreman-verify-{stream}'
14 - 'genesis-foreman-merge'
15 - 'genesis-foreman-daily-{stream}'
16 - 'genesis-foreman-build-{stream}'
17 - 'genesis-foreman-deploy-{stream}'
19 # stream: branch with - in place of / (eg. stable-arno)
20 # branch: branch (eg. stable/arno)
28 ########################
30 ########################
33 name: 'genesis-foreman-verify-{stream}'
35 project-type: freestyle
49 artifactDaysToKeep: -1
58 installer: '{installer}'
59 gs-pathname: '{gs-pathname}'
62 credentials-id: '{ssh-credentials}'
63 refspec: '$GERRIT_REFSPEC'
64 choosing-strategy: 'gerrit'
67 - ssh-agent-credentials:
68 user: '{ssh-credentials}'
73 - patchset-created-event:
74 exclude-drafts: 'false'
75 exclude-trivial-rebase: 'false'
76 exclude-no-code-change: 'false'
77 - draft-published-event
78 - comment-added-contains-event:
79 comment-contains-value: 'recheck'
80 - comment-added-contains-event:
81 comment-contains-value: 'reverify'
83 - project-compare-type: 'ANT'
84 project-pattern: 'genesis'
86 - branch-compare-type: 'ANT'
87 branch-pattern: '**/{branch}'
92 pattern: '{installer}/**'
96 - 'foreman-workspace-cleanup'
99 name: 'genesis-foreman-merge'
101 project-type: freestyle
115 artifactDaysToKeep: -1
124 installer: '{installer}'
127 - gerrit-trigger-scm:
128 credentials-id: '{ssh-credentials}'
130 choosing-strategy: 'default'
133 - ssh-agent-credentials:
134 user: '{ssh-credentials}'
139 - change-merged-event
140 - comment-added-contains-event:
141 comment-contains-value: 'remerge'
143 - project-compare-type: 'ANT'
144 project-pattern: 'genesis'
146 - branch-compare-type: 'ANT'
147 branch-pattern: '**/master'
152 pattern: '{installer}/**'
156 - 'fuel-workspace-cleanup'
159 name: 'genesis-foreman-daily-{stream}'
161 project-type: freestyle
174 installer: '{installer}'
175 gs-pathname: '{gs-pathname}'
178 credentials-id: '{ssh-credentials}'
185 artifactDaysToKeep: -1
186 artifactNumToKeep: -1
190 - project: 'genesis-foreman-build-{stream}'
194 - project: 'genesis-foreman-deploy-{stream}'
198 - project: 'functest-opnfv-jump-2'
201 - project: 'yardstick-opnfv-jump-2'
205 name: 'genesis-foreman-build-{stream}'
207 project-type: freestyle
214 artifactDaysToKeep: -1
215 artifactNumToKeep: -1
221 installer: '{installer}'
222 gs-pathname: '{gs-pathname}'
225 credentials-id: '{ssh-credentials}'
231 - 'foreman-upload-artifact'
232 - 'fuel-workspace-cleanup'
235 name: 'genesis-foreman-deploy-{stream}'
237 project-type: freestyle
246 artifactDaysToKeep: -1
247 artifactNumToKeep: -1
253 installer: '{installer}'
254 gs-pathname: '{gs-pathname}'
257 default: ssh://gerrit.opnfv.org:29418/$PROJECT
258 description: "Used for overriding the GIT URL coming from parameters macro."
262 credentials-id: '{ssh-credentials}'
267 - 'foreman-lab-reconfig'
270 ########################
272 ########################
274 name: foreman-parameter
278 default: '{installer}'
279 description: "Installer to use."
281 name: BUILD_DIRECTORY
282 default: $WORKSPACE/build_output
283 description: "Directory where the build artifact will be located upon the completion of the build."
285 name: CACHE_DIRECTORY
286 default: $HOME/opnfv/cache/genesis-$INSTALLER{gs-pathname}
287 description: "Directory where the cache to be used during the build is located."
290 default: https://gerrit.opnfv.org/gerrit/$PROJECT
291 description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
294 default: artifacts.opnfv.org/$PROJECT/$INSTALLER{gs-pathname}
295 description: "URL to Google Storage."
297 ########################
299 ########################
301 name: 'foreman-lab-reconfig'
309 # check to see if ucs login info file exists
310 if [ -e /home/jenkins-ci/.ssh/ucs_creds ];then
311 source /home/jenkins-ci/.ssh/ucs_creds
313 echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting"
318 echo "Cloning releng repo..."
319 if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then
320 echo "Unable to clone releng repo...Exiting"
324 # log info to console
325 echo "Starting the lab reconfiguration for $INSTALLER..."
326 echo "--------------------------------------------------------"
330 sudo $WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh
333 source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate
334 sudo python $WORKSPACE/releng/utils/lab-reconfiguration/reconfigUcsNet.py $ucs_host -u $ucs_user -p $ucs_password -f $WORKSPACE/releng/utils/lab-reconfiguration/foreman.yaml
337 echo "--------------------------------------------------------"
341 name: 'foreman-build'
349 # log info to console
350 echo "Starting the build of $INSTALLER. This could take some time..."
351 echo "--------------------------------------------------------"
354 # create the cache directory if it doesn't exist
355 [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
357 # set OPNFV_ARTIFACT_VERSION
358 export OPNFV_ARTIFACT_VERSION=$(date -u +"%Y-%m-%d_%H-%M-%S")
361 cd $WORKSPACE/$INSTALLER/ci
362 ./build.sh -v $OPNFV_ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
364 # list the contents of BUILD_OUTPUT directory
365 ls -al $BUILD_DIRECTORY
367 # save information regarding artifact into file
369 echo "OPNFV_ARTIFACT_VERSION=$OPNFV_ARTIFACT_VERSION"
370 echo "OPNFV_GIT_URL=$(git config --get remote.origin.url)"
371 echo "OPNFV_GIT_SHA1=$(git rev-parse HEAD)"
372 echo "OPNFV_ARTIFACT_URL=$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
373 echo "OPNFV_ARTIFACT_MD5SUM=$(md5sum $BUILD_DIRECTORY/OPNFV-CentOS-7-x86_64-$OPNFV_ARTIFACT_VERSION.iso | cut -d' ' -f1)"
374 echo "OPNFV_BUILD_URL=$BUILD_URL"
375 ) > $WORKSPACE/opnfv.properties
378 echo "--------------------------------------------------------"
382 name: 'foreman-deploy'
390 # log info to console
391 echo "Starting the deployment using $INSTALLER. This could take some time..."
392 echo "--------------------------------------------------------"
396 sudo $WORKSPACE/$INSTALLER/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
398 # and then initiate deployment
399 sudo $WORKSPACE/$INSTALLER/ci/deploy.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml
402 echo "--------------------------------------------------------"
406 name: 'foreman-upload-artifact'
414 # log info to console
415 echo "Uploading the $INSTALLER artifact. This could take some time..."
416 echo "--------------------------------------------------------"
419 # source the opnfv.properties to get ARTIFACT_VERSION
420 source $WORKSPACE/opnfv.properties
422 # upload artifact and additional files to google storage
423 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
424 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.properties > gsutil.properties.log 2>&1
425 gsutil cp $WORKSPACE/opnfv.properties gs://$GS_URL/latest.properties > gsutil.latest.log 2>&1
428 echo "--------------------------------------------------------"
430 echo "Artifact is available as http://$GS_URL/opnfv-$OPNFV_ARTIFACT_VERSION.iso"
433 name: 'foreman-workspace-cleanup'
441 # delete everything that is in $WORKSPACE
442 /bin/rm -rf $WORKSPACE
444 ########################
446 ########################
448 name: 'foreman-master'
450 - pollscm: '0 21 * * *'
453 name: 'foreman-stable-arno'
455 - pollscm: '0 3 * * *'