diff options
-rwxr-xr-x | jjb/fuel/fuel-build.sh | 29 | ||||
-rw-r--r-- | jjb/fuel/fuel-ci-jobs.yml | 225 | ||||
-rw-r--r-- | jjb/fuel/fuel-project-jobs.yml (renamed from jjb/fuel/fuel.yml) | 220 | ||||
-rw-r--r-- | jjb/fuel/opnfv-fuel.yml | 124 | ||||
-rw-r--r-- | jjb/opnfv/slave-params.yml | 48 |
5 files changed, 296 insertions, 350 deletions
diff --git a/jjb/fuel/fuel-build.sh b/jjb/fuel/fuel-build.sh index 00617ce54..77b045521 100755 --- a/jjb/fuel/fuel-build.sh +++ b/jjb/fuel/fuel-build.sh @@ -3,13 +3,40 @@ set -o errexit set -o nounset set -o pipefail +cd $WORKSPACE + +# check to see if we already have an artifact on artifacts.opnfv.org +# for this commit +echo "Checking to see if we already built and stored Fuel ISO for this commit" + +LATEST_ISO_PROPERTIES=$WORKSPACE/latest.iso.properties +curl -s -o $LATEST_ISO_PROPERTIES http://$GS_URL/latest.properties 2>/dev/null + +# get metadata of latest ISO +LATEST_ISO_SHA1=$(grep OPNFV_GIT_SHA1 $LATEST_ISO_PROPERTIES | cut -d'=' -f2) +LATEST_ISO_URL=$(grep OPNFV_ARTIFACT_URL $LATEST_ISO_PROPERTIES | cut -d'=' -f2) + +# get current SHA1 +CURRENT_SHA1=$(git rev-parse HEAD) + +if [[ "$CURRENT_SHA1" == "$LATEST_ISO_SHA1" ]]; then + echo "An ISO has already been built for this commit" + echo " $LATEST_ISO_URL" + echo "Nothing new to build. Exiting." + exit 0 +else + echo "This commit has not been built yet. Proceeding with the build." + /bin/rm -f $LATEST_ISO_PROPERTIES + echo +fi + # log info to console echo "Starting the build of $INSTALLER. This could take some time..." echo "--------------------------------------------------------" echo # create the cache directory if it doesn't exist -[[ -d $CACHE_DIRECTORY ]] || mkdir -p $CACHE_DIRECTORY +mkdir -p $CACHE_DIRECTORY # set OPNFV_ARTIFACT_VERSION if [[ "$JOB_NAME" =~ "merge" ]]; then diff --git a/jjb/fuel/fuel-ci-jobs.yml b/jjb/fuel/fuel-ci-jobs.yml new file mode 100644 index 000000000..81dc62403 --- /dev/null +++ b/jjb/fuel/fuel-ci-jobs.yml @@ -0,0 +1,225 @@ +- project: + + name: 'fuel' + + project: 'fuel' + + installer: 'fuel' + +#-------------------------------- +# BRANCH ANCHORS +#-------------------------------- + master: &master + stream: master + branch: '{stream}' + gs-pathname: '' + brahmaputra: &brahmaputra + stream: brahmaputra + branch: 'stable/{stream}' + gs-pathname: '/{stream}' +#-------------------------------- +# POD, INSTALLER, AND BRANCH MAPPING +#-------------------------------- +# Current Mapping +#-------------------------------- +# everything runs against master branch +#-------------------------------- + pod: + - opnfv-jump-2: + <<: *master + - ericsson-pod1: + <<: *master +# - ericsson-pod2: +# <<: *master +#-------------------------------- +# Milestone E Mapping +# !!!DO NOT ENABLE!!! +#-------------------------------- +# brahmaputra +#-------------------------------- +# - opnfv-jump-2: +# <<: *brahmaputra +# TESTING the CI stuff!!!!!!! + - ericsson-pod2: + <<: *brahmaputra + +# please check the triggers before enabling any of the controllers!!! + sdn-controller: + - 'nosdn': + disabled: false + - 'odl': + disabled: true + - 'onos': + disabled: true + - 'opencontrail': + disabled: true + + jobs: + - 'fuel-{sdn-controller}-{pod}-daily-{stream}' + - 'fuel-build-{pod}-daily-{stream}' + - 'fuel-deploy-{pod}-daily-{stream}' + +######################## +# job templates +######################## +- job-template: + name: 'fuel-{sdn-controller}-{pod}-daily-{stream}' + + project-type: multijob + + disabled: '{obj:disabled}' + + concurrent: false + + wrappers: + - build-name: + name: '$BUILD_NUMBER - SDN: $SDN_CONTROLLER Feature: $OPNFV_FEATURE' + + triggers: + - 'fuel-{pod}-trigger' + + parameters: + - project-parameter: + project: '{project}' + - '{pod}-defaults' + - '{installer}-defaults' + - string: + name: SDN_CONTROLLER + default: '{sdn-controller}' + - string: + name: OPNFV_FEATURE + default: 'none' + - fuel-ci-parameter: + gs-pathname: '{gs-pathname}' + + scm: + - git-scm: + credentials-id: '{ssh-credentials}' + refspec: '' + branch: '{branch}' + + builders: + - multijob: + name: build + condition: SUCCESSFUL + projects: + - name: 'fuel-build-{pod}-daily-{stream}' + current-parameters: true + git-revision: true + kill-phase-on: FAILURE + - multijob: + name: deploy + condition: SUCCESSFUL + projects: + - name: 'fuel-deploy-{pod}-daily-{stream}' + current-parameters: true + git-revision: true + kill-phase-on: FAILURE + - multijob: + name: functest + condition: COMPLETED + projects: + - name: 'functest-fuel-{pod}-daily-{stream}' + current-parameters: true + kill-phase-on: NEVER + - multijob: + name: yardstick + condition: COMPLETED + projects: + - name: 'yardstick-fuel-{pod}-daily-{stream}' + current-parameters: true + kill-phase-on: NEVER + +- job-template: + name: 'fuel-build-{pod}-daily-{stream}' + + parameters: + - project-parameter: + project: '{project}' + - 'ericsson-ca-build-1-defaults' + - fuel-ci-parameter: + gs-pathname: '{gs-pathname}' + + scm: + - git-scm: + credentials-id: '{ssh-credentials}' + refspec: '' + branch: '{branch}' + + wrappers: + - timeout: + timeout: 360 + fail: true + + builders: + - shell: + !include-raw ./fuel-build.sh + - shell: + !include-raw ./fuel-upload-artifact.sh + - shell: + !include-raw ./fuel-workspace-cleanup.sh + + publishers: + - email: + recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com + +- job-template: + name: 'fuel-deploy-{pod}-daily-{stream}' + + parameters: + - project-parameter: + project: '{project}' + - '{pod}-defaults' + - fuel-ci-parameter: + gs-pathname: '{gs-pathname}' + + scm: + - git-scm: + credentials-id: '{ssh-credentials}' + refspec: '' + branch: '{branch}' + + builders: + - shell: + !include-raw ./fuel-download-artifact.sh + - shell: + !include-raw ./fuel-deploy.sh + + publishers: + - email: + recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com +######################## +# parameter macros +######################## +- parameter: + name: fuel-ci-parameter + parameters: + - 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/$INSTALLER + description: "Directory where the cache to be used during the build is located." + - string: + name: GS_URL + default: artifacts.opnfv.org/$PROJECT{gs-pathname} + description: "URL to Google Storage." +######################## +# trigger macros +######################## +# trigger for opnfv-jump-2 is set to run 1 hour ahead of others +# to prevent doing unnecessary builds +- trigger: + name: 'fuel-opnfv-jump-2-trigger' + triggers: + - timed: '0 2 * * *' +- trigger: + name: 'fuel-ericsson-pod1-trigger' + triggers: + - timed: '0 3 * * *' +- trigger: + name: 'fuel-ericsson-pod2-trigger' + triggers: + - timed: '0 3 * * *' diff --git a/jjb/fuel/fuel.yml b/jjb/fuel/fuel-project-jobs.yml index f8eabb0b6..3ad28c198 100644 --- a/jjb/fuel/fuel.yml +++ b/jjb/fuel/fuel-project-jobs.yml @@ -2,36 +2,32 @@ # Job configuration for fuel ######################## - project: - - name: fuel + name: fuel-project-jobs project: 'fuel' installer: 'fuel' +# only master branch is enabled at the moment to keep no of jobs sane + stream: + - master: + branch: '{stream}' + gs-pathname: '' +# - brahmaputra: +# branch: 'stable/{stream}' +# gs-pathname: '/{stream}' + jobs: - 'fuel-verify-build-{stream}' - 'fuel-merge-build-{stream}' - 'fuel-merge-deploy-virtual-{stream}' - - 'fuel-daily-{stream}' - - 'fuel-build-{stream}' - - 'fuel-deploy-{stream}' - - 'fuel-lab-reconfig-{stream}' - - stream: - - master: - branch: 'master' - gs-pathname: '' ######################## # job templates ######################## - - job-template: name: 'fuel-verify-build-{stream}' - node: ericsson-build - concurrent: true properties: @@ -44,8 +40,8 @@ project: '{project}' - gerrit-parameter: branch: '{branch}' - - fuel-parameter: - installer: '{installer}' + - 'ericsson-ca-build-1-defaults' + - fuel-project-parameter: gs-pathname: '{gs-pathname}' scm: @@ -90,8 +86,6 @@ - job-template: name: 'fuel-merge-build-{stream}' - node: ericsson-build - concurrent: true properties: @@ -104,9 +98,9 @@ project: '{project}' - gerrit-parameter: branch: '{branch}' - - fuel-parameter: - installer: '{installer}' - gs-pathname: '' + - 'ericsson-ca-build-1-defaults' + - fuel-project-parameter: + gs-pathname: '{gs-pathname}' scm: - gerrit-trigger-scm: credentials-id: '{ssh-credentials}' @@ -144,8 +138,6 @@ - job-template: name: 'fuel-merge-deploy-virtual-{stream}' - node: fuel-deploy-virtual - concurrent: true properties: @@ -159,9 +151,9 @@ project: '{project}' - gerrit-parameter: branch: '{branch}' - - fuel-parameter: - installer: '{installer}' - gs-pathname: '' + - 'fuel-deploy-virtual-defaults' + - fuel-project-parameter: + gs-pathname: '{gs-pathname}' scm: - gerrit-trigger-scm: credentials-id: '{ssh-credentials}' @@ -198,175 +190,13 @@ - email: recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com -- job-template: - name: 'fuel-daily-{stream}' - - node: ericsson-build - - disabled: false - - triggers: - - 'fuel-{strem}-trigger' - - parameters: - - project-parameter: - project: '{project}' - - fuel-parameter: - installer: '{installer}' - gs-pathname: '{gs-pathname}' - - scm: - - git-scm: - credentials-id: '{ssh-credentials}' - refspec: '' - branch: '{branch}' - - builders: - - trigger-builds: - - project: 'fuel-build-{stream}' - git-revision: true - block: true - - trigger-builds: - - project: 'fuel-deploy-{stream}' - git-revision: true - block: true - - trigger-builds: - - project: 'functest-fuel-opnfv-jump-2-daily-{stream}' - block: true - block-thresholds: - build-step-failure-threshold: 'never' - failure-threshold: 'never' - unstable-threshold: 'FAILURE' - - trigger-builds: - - project: 'yardstick-fuel-opnfv-jump-2-daily-{stream}' - block: true - block-thresholds: - build-step-failure-threshold: 'never' - failure-threshold: 'never' - unstable-threshold: 'FAILURE' - - trigger-builds: - - project: 'bottlenecks-daily-fuel-lf-{stream}' - block: true - block-thresholds: - build-step-failure-threshold: 'never' - failure-threshold: 'never' - unstable-threshold: 'FAILURE' - - triggers: - - 'fuel-{stream}-daily-trigger' - -- job-template: - name: 'fuel-build-{stream}' - - node: ericsson-build - - parameters: - - project-parameter: - project: '{project}' - - fuel-parameter: - installer: '{installer}' - gs-pathname: '{gs-pathname}' - - scm: - - git-scm: - credentials-id: '{ssh-credentials}' - refspec: '' - branch: '{branch}' - - wrappers: - - timeout: - timeout: 360 - fail: true - - builders: - - shell: - !include-raw ./fuel-build.sh - - shell: - !include-raw ./fuel-upload-artifact.sh - - shell: - !include-raw ./fuel-workspace-cleanup.sh - - publishers: - - email: - recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com - -- job-template: - name: 'fuel-deploy-{stream}' - - disabled: false - - node: opnfv-jump-2 - - parameters: - - project-parameter: - project: '{project}' - - fuel-parameter: - installer: '{installer}' - gs-pathname: '{gs-pathname}' - - string: - name: GIT_BASE - default: ssh://gerrit.opnfv.org:29418/$PROJECT - description: "POD2 has some issues with cloning using https so that's why GIT_BASE is overriden here again." - - scm: - - git-scm: - credentials-id: '{ssh-credentials}' - refspec: '' - branch: '{branch}' - - builders: - - shell: - !include-raw ./fuel-download-artifact.sh - - shell: - !include-raw ./fuel-deploy.sh - - publishers: - - email: - recipients: jonas.bjurel@ericsson.com stefan.k.berg@ericsson.com - -- job-template: - name: 'fuel-lab-reconfig-{stream}' - - disabled: true - - parameters: - - project-parameter: - project: '{project}' - - fuel-parameter: - installer: '{installer}' - gs-pathname: '{gs-pathname}' - - string: - name: GIT_BASE - default: ssh://gerrit.opnfv.org:29418/$PROJECT - description: "Used for overriding the GIT URL coming from parameters macro." - - scm: - - git-scm: - credentials-id: '{ssh-credentials}' - refspec: '' - branch: '{branch}' - - properties: - - build-blocker: - use-build-blocker: true - blocking-jobs: - - "apex-daily.*" - - builders: - - shell: - !include-raw ./fuel-lab-reconfig.sh - ######################## # parameter macros ######################## - parameter: - name: fuel-parameter + name: fuel-project-parameter 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." @@ -375,18 +205,6 @@ default: $HOME/opnfv/cache/$INSTALLER description: "Directory where the cache to be used during the build is located." - string: - name: GIT_BASE - default: https://gerrit.opnfv.org/gerrit/$PROJECT - 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: GS_URL default: artifacts.opnfv.org/$PROJECT{gs-pathname} description: "URL to Google Storage." - -######################## -# trigger macros -######################## -- trigger: - name: 'fuel-master-daily-trigger' - triggers: - - timed: '0 3 * * *' diff --git a/jjb/fuel/opnfv-fuel.yml b/jjb/fuel/opnfv-fuel.yml deleted file mode 100644 index 393f919d0..000000000 --- a/jjb/fuel/opnfv-fuel.yml +++ /dev/null @@ -1,124 +0,0 @@ -######################## -# Job configuration for fuel -######################## -- project: - - name: 'opnfv-fuel' - - installer: 'fuel' - - controller: - - 'odl' - - 'onos' - - 'opencontrail' - - pod: - - 'opnfv-jump-2' - - 'ericsson-pod1' - - loop: - - 'daily' - - # ignore these as these will not exist in real job - dummy-phase: - - build - - deploy - - functest - - yardstick - - stream: - - master: - branch: 'master' - gs-pathname: '' - - jobs: - - 'tmp_fuel-{controller}-{pod}-{loop}-{stream}' - - 'tmp_fuel-{dummy-phase}-{pod}-{loop}-{stream}' - -######################## -# job templates -######################## -- job-template: - name: 'tmp_fuel-{controller}-{pod}-{loop}-{stream}' - - project-type: multijob - - parameters: - - project-parameter: - project: '{installer}' - - 'ericsson-ca-build-1-defaults' - - '{installer}-defaults' - - string: - name: CONTROLLER - default: '{controller}' - - string: - name: FEATURE - default: 'none' - - scm: - - git-scm: - credentials-id: '{ssh-credentials}' - refspec: '' - branch: '{branch}' - - builders: - - multijob: - name: build - condition: SUCCESSFUL - projects: - - name: 'tmp_fuel-build-{loop}-{stream}' - kill-phase-on: FAILURE - current-parameters: true - - multijob: - name: deploy - condition: SUCCESSFUL - projects: - - name: 'tmp_fuel-deploy-{pod}-{loop}-{stream}' - kill-phase-on: FAILURE - current-parameters: true - - multijob: - name: functest - projects: - - name: 'tmp_fuel-test-{pod}-{loop}-{stream}' - current-parameters: true - - multijob: - name: yardstick - projects: - - name: 'tmp_fuel-test-{pod}-{loop}-{stream}' - current-parameters: true - - -- job-template: - name: 'tmp_fuel-{dummy-phase}-{pod}-{loop}-{stream}' - - disabled: false - - concurrent: false - - wrappers: - - build-name: - name: '$BUILD_NUMBER: {installer} $CONTROLLER' - - parameters: - - project-parameter: - project: '{installer}' - - '{pod}-defaults' - - '{installer}-defaults' - - string: - name: CONTROLLER - default: 'none' - - string: - name: FEATURE - default: 'none' - - scm: - - git-scm: - credentials-id: '{ssh-credentials}' - refspec: '' - branch: '{branch}' - - builders: - - shell: | - #!/bin/bash - echo "Hello World from OPNFV $INSTALLER_TYPE" - echo "Running $INSTALLER_TYPE with controller $CONTROLLER" diff --git a/jjb/opnfv/slave-params.yml b/jjb/opnfv/slave-params.yml index e36a0b684..aaefd337d 100644 --- a/jjb/opnfv/slave-params.yml +++ b/jjb/opnfv/slave-params.yml @@ -15,7 +15,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the jumphost' + description: 'Git URL to use on this Jenkins Slave' - string: name: SSH_KEY default: /root/.ssh/id_rsa @@ -38,7 +38,7 @@ - string: name: GIT_BASE default: ssh://gerrit.opnfv.org:29418/$PROJECT - description: 'Git URL to use on the jumphost' + description: 'Git URL to use on this Jenkins Slave' - parameter: name: 'ericsson-pod1-defaults' @@ -57,7 +57,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the jumphost' + description: 'Git URL to use on this Jenkins Slave' - parameter: name: 'ericsson-pod2-defaults' @@ -76,7 +76,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the jumphost' + description: 'Git URL to use on this Jenkins Slave' - parameter: name: 'intelpod2-jumphost-defaults' @@ -95,7 +95,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the jumphost' + description: 'Git URL to use on this Jenkins Slave' - string: name: SSH_KEY default: /root/.ssh/id_rsa @@ -114,7 +114,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the jumphost' + description: 'Git URL to use on this Jenkins Slave' - parameter: name: 'intel-pod5-defaults' @@ -133,7 +133,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the jumphost' + description: 'Git URL to use on this Jenkins Slave' - parameter: name: 'intel-pod6-defaults' @@ -152,7 +152,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the jumphost' + description: 'Git URL to use on this Jenkins Slave' - parameter: name: 'intel-pod8-defaults' @@ -171,7 +171,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the jumphost' + description: 'Git URL to use on this Jenkins Slave' - parameter: name: 'huawei-us-deploy-bare-1-defaults' @@ -190,7 +190,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the jumphost' + description: 'Git URL to use on this Jenkins Slave' - parameter: name: 'opnfv-build-defaults' @@ -207,7 +207,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the slave' + description: 'Git URL to use on this Jenkins Slave' - parameter: name: 'intel-us-build-1-defaults' @@ -222,7 +222,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the slave' + description: 'Git URL to use on this Jenkins Slave' - parameter: name: 'intel-us-build-2-defaults' @@ -237,7 +237,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the slave' + description: 'Git URL to use on this Jenkins Slave' - parameter: name: 'ericsson-ca-build-1-defaults' @@ -252,7 +252,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the slave' + description: 'Git URL to use on this Jenkins Slave' - parameter: name: 'zte-build-1' @@ -267,7 +267,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the slave' + description: 'Git URL to use on this Jenkins Slave' - parameter: name: 'orange-pod2-defaults' @@ -286,7 +286,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the jumphost' + description: 'Git URL to use on this Jenkins Slave' - string: name: LAB_CONFIG default: "/home/opnfv/repos/functest" @@ -310,26 +310,26 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the jumphost' + description: 'Git URL to use on this Jenkins Slave' - parameter: - name: 'intel-us-deploy-virtual-1-defaults' + name: 'fuel-deploy-virtual-defaults' parameters: - node: name: SLAVE_NAME description: 'Slave name on Jenkins' allowed-slaves: - intel-us-deploy-virtual-1 +# ericsson slave has been excluded until the issues are identified and solved +# - ericsson-ca-deploy-virtual-1 default-slaves: - intel-us-deploy-virtual-1 - - string: - name: INSTALLER_VERSION - default: latest - description: 'Version of the installer to deploy' +# ericsson slave has been excluded until the issues are identified and solved +# - ericsson-ca-deploy-virtual-1 - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the jumphost' + description: 'Git URL to use on this Jenkins Slave' - parameter: name: 'intel-us-deploy-virtual-2-defaults' @@ -348,7 +348,7 @@ - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT - description: 'Git URL to use on the jumphost' + description: 'Git URL to use on this Jenkins Slave' - string: name: SSH_KEY default: /root/.ssh/id_rsa |