From 2a7cf68ddab886da91a2752c06076222449a4f58 Mon Sep 17 00:00:00 2001 From: Fatih Degirmenci Date: Tue, 12 May 2015 17:08:48 +0200 Subject: Try using project-wide parameters in jjb JIRA: OCTO-47 Change-Id: I101af22cc1af44f32840fd00a06fa186ab757d0b Signed-off-by: Fatih Degirmenci --- jjb/genesis/genesis-foreman.yml | 99 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 95 insertions(+), 4 deletions(-) diff --git a/jjb/genesis/genesis-foreman.yml b/jjb/genesis/genesis-foreman.yml index 59b2d39ea..e8a668a71 100644 --- a/jjb/genesis/genesis-foreman.yml +++ b/jjb/genesis/genesis-foreman.yml @@ -3,6 +3,8 @@ name: genesis-foreman + project: 'genesis' + installer: - foreman @@ -10,6 +12,7 @@ - 'genesis-{installer}-verify' - 'genesis-{installer}-merge' - 'genesis-{installer}-daily-{stream}' + - 'genesis-{installer}-build' - 'genesis-{installer}-deploy' # stream: branch with - in place of / (eg. stable-helium) @@ -18,7 +21,6 @@ - master: branch: 'master' - project: 'genesis' ######################## # job templates @@ -45,6 +47,9 @@ - string: name: BUILD_DIRECTORY default: $WORKSPACE/build_output + - string: + name: CACHE_DIRECTORY + default: '$HOME/opnfv/cache/genesis-{installer}' - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/genesis @@ -116,6 +121,9 @@ - string: name: BUILD_DIRECTORY default: $WORKSPACE/build_output + - string: + name: CACHE_DIRECTORY + default: '$HOME/opnfv/cache/genesis-{installer}' - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/genesis @@ -171,6 +179,9 @@ name: BUILD_DIRECTORY default: $WORKSPACE/build_output description: "Directory where the build artifact will be located upon the completion of the build." + - string: + name: CACHE_DIRECTORY + default: '$HOME/opnfv/cache/genesis-{installer}' - string: name: GS_URL default: 'artifacts.opnfv.org/genesis/{installer}' @@ -208,6 +219,41 @@ - 'daily-master' +- job-template: + name: 'genesis-{installer}-build' + + project-type: freestyle + + node: ericsson-build + + logrotate: + daysToKeep: 30 + numToKeep: 10 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + + parameters: + - genesis-parameters + - string: + name: EXTRA_PARAM + default: 'extra_value' + description: "Installer to use." + - string: + name: INSTALLER + default: 'overriden_value' + description: "Installer to use." + + scm: + - git: + skip-tag: true + url: $GIT_BASE + branches: + - $GERRIT_BRANCH + refspec: $GERRIT_REFSPEC + + builders: + - 'build' + - job-template: name: 'genesis-{installer}-deploy' @@ -240,7 +286,7 @@ description: "Refspec to retrieve." - string: name: GS_URL - default: 'artifacts.opnfv.org/genesis/fuel' + default: 'artifacts.opnfv.org/genesis/{installer}' description: "URL to Google Storage." - string: name: BUILD_DIRECTORY @@ -258,6 +304,40 @@ builders: - 'deploy' +######################## +# parameter macros +######################## +- parameter: + name: genesis-parameters + parameters: + - string: + name: INSTALLER + default: '{installer}' + description: "Installer to use." + - string: + name: BUILD_DIRECTORY + default: $WORKSPACE/build_output + description: "Directory where the build artifact will be located upon the completion of the build." + - string: + name: CACHE_DIRECTORY + default: '$HOME/opnfv/cache/genesis-{installer}' + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/genesis + description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW." + - string: + name: GERRIT_BRANCH + default: origin/master + description: "Branch to build, deploy and test." + - string: + name: GERRIT_REFSPEC + default: refs/heads/master + description: "Refspec to retrieve." + - string: + name: GS_URL + default: 'artifacts.opnfv.org/genesis/{installer}' + description: "URL to Google Storage." + ######################## # builder macros ######################## @@ -403,7 +483,7 @@ /bin/rm -rf $WORKSPACE/opnfv.iso - builder: - name: 'deploy' + name: 'build' builders: - shell: | #!/bin/bash @@ -412,7 +492,18 @@ set -o pipefail set -x - cd $WORKSPACE + echo "Hello World" + env + +- builder: + name: 'deploy' + builders: + - shell: | + #!/bin/bash + set -o errexit + set -o nounset + set -o pipefail + set -x # cleanup first sudo $WORKSPACE/$INSTALLER/ci/clean.sh -base_config $WORKSPACE/$INSTALLER/ci/inventory/lf_pod2_ksgen_settings.yml -- cgit 1.2.3-korg