name: genesis-foreman
+ project: 'genesis'
+
installer:
- foreman
- '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)
- master:
branch: 'master'
- project: 'genesis'
########################
# job templates
- 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
- 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
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}'
- '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:
+ installer: '{installer}'
+
+ scm:
+ - git:
+ skip-tag: true
+ url: $GIT_BASE
+ branches:
+ - $GERRIT_BRANCH
+ refspec: $GERRIT_REFSPEC
+
+ builders:
+ - 'build'
+ - 'upload-artifact'
+
- job-template:
name: 'genesis-{installer}-deploy'
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
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
########################
/bin/rm -rf $WORKSPACE/opnfv.iso
- builder:
- name: 'deploy'
+ name: 'build'
+ builders:
+ - shell: |
+ #!/bin/bash
+ set -o errexit
+ set -o nounset
+ set -o pipefail
+ set -x
+
+ # create the cache directory if it doesn't exist
+ [[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY
+
+ # set ARTIFACT_VERSION
+ export ARTIFACT_VERSION=$(date +"%Y-%m-%d_%H-%M-%S")
+
+ # start the build
+ cd $WORKSPACE/$INSTALLER/ci
+ ./build.sh -v $ARTIFACT_VERSION -c file://$CACHE_DIRECTORY $BUILD_DIRECTORY
+
+- builder:
+ name: 'upload-artifact'
builders:
- shell: |
#!/bin/bash
set -o pipefail
set -x
- cd $WORKSPACE
+ # list the build output
+ ls -al $BUILD_DIRECTORY
+
+- 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