diff options
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/armband/armband-ci-jobs.yml | 8 | ||||
-rw-r--r-- | jjb/ci_gate_security/opnfv-ci-gate-security.yml | 2 | ||||
-rw-r--r-- | jjb/daisy4nfv/daisy-daily-jobs.yml | 18 | ||||
-rwxr-xr-x | jjb/daisy4nfv/daisy-deploy.sh | 2 | ||||
-rwxr-xr-x | jjb/daisy4nfv/daisy4nfv-download-artifact.sh | 10 | ||||
-rw-r--r-- | jjb/doctor/doctor.yml | 151 | ||||
-rwxr-xr-x | jjb/global/installer-report.sh | 25 | ||||
-rw-r--r-- | jjb/global/releng-macros.yml | 28 | ||||
-rw-r--r-- | jjb/pharos/pharos.yml | 35 | ||||
-rw-r--r-- | jjb/releng/compass4nfv-docker.yml | 6 | ||||
-rw-r--r-- | jjb/releng/functest-docker.yml | 14 | ||||
-rw-r--r-- | jjb/releng/opnfv-docker-arm.yml | 6 | ||||
-rw-r--r-- | jjb/releng/opnfv-docker.sh | 3 | ||||
-rw-r--r-- | jjb/releng/opnfv-docker.yml | 23 | ||||
-rw-r--r-- | jjb/releng/releng-ci-jobs.yml | 6 | ||||
-rw-r--r-- | jjb/snaps/snaps-verify-jobs.yml | 2 | ||||
-rwxr-xr-x | jjb/xci/xci-cleanup.sh | 24 | ||||
-rw-r--r-- | jjb/xci/xci-merge-jobs.yml | 257 | ||||
-rwxr-xr-x | jjb/xci/xci-promote.sh | 30 | ||||
-rwxr-xr-x | jjb/xci/xci-run-functest.sh | 30 | ||||
-rwxr-xr-x | jjb/xci/xci-start-deployment.sh | 30 | ||||
-rwxr-xr-x | jjb/xci/xci-start-new-vm.sh | 63 | ||||
-rw-r--r-- | jjb/xci/xci-verify-jobs.yml | 85 |
23 files changed, 679 insertions, 179 deletions
diff --git a/jjb/armband/armband-ci-jobs.yml b/jjb/armband/armband-ci-jobs.yml index b2fa62f87..da3992ea8 100644 --- a/jjb/armband/armband-ci-jobs.yml +++ b/jjb/armband/armband-ci-jobs.yml @@ -250,7 +250,7 @@ - trigger: name: 'fuel-os-nosdn-nofeature-ha-armband-baremetal-master-trigger' triggers: - - timed: '0 16 * * 2,4,6' + - timed: '0 1 * * 2,4,6' - trigger: name: 'fuel-os-nosdn-nofeature-noha-armband-baremetal-master-trigger' triggers: @@ -258,14 +258,14 @@ - trigger: name: 'fuel-os-odl-nofeature-ha-armband-baremetal-master-trigger' triggers: - - timed: '0 16 * * 1,3,5,7' + - timed: '0 1 * * 1,3,5,7' # --------------------------------------------------------------------- # Enea Armband CI Baremetal Triggers running against euphrates branch # --------------------------------------------------------------------- - trigger: name: 'fuel-os-nosdn-nofeature-ha-armband-baremetal-euphrates-trigger' triggers: - - timed: '0 1 * * 2,4,6' + - timed: '' - trigger: name: 'fuel-os-nosdn-nofeature-noha-armband-baremetal-euphrates-trigger' triggers: @@ -273,7 +273,7 @@ - trigger: name: 'fuel-os-odl-nofeature-ha-armband-baremetal-euphrates-trigger' triggers: - - timed: '0 1 * * 1,3,5,7' + - timed: '' # -------------------------------------------------------------- # Enea Armband CI Virtual Triggers running against master branch # -------------------------------------------------------------- diff --git a/jjb/ci_gate_security/opnfv-ci-gate-security.yml b/jjb/ci_gate_security/opnfv-ci-gate-security.yml index ef0da7f3a..d54aebea4 100644 --- a/jjb/ci_gate_security/opnfv-ci-gate-security.yml +++ b/jjb/ci_gate_security/opnfv-ci-gate-security.yml @@ -163,7 +163,7 @@ comment-contains-value: 'reverify' projects: - project-compare-type: 'REG_EXP' - project-pattern: 'apex|armband|bamboo|barometer|bottlenecks|calipso|compass4nfv|conductor|cooper|cperf|daisy|doctor|dovetail|dpacc|enfv|escalator|fds|fuel|functest|octopus|pharos|releng|sandbox|yardstick|infra|ipv6|kvmfornfv|lsoapi|models|moon|multisite|netready' + project-pattern: 'apex|armband|bamboo|barometer|bottlenecks|calipso|compass4nfv|conductor|copper|cperf|daisy|doctor|dovetail|dpacc|enfv|escalator|fds|fuel|functest|octopus|pharos|releng|sandbox|yardstick|infra|ipv6|kvmfornfv|lsoapi|models|moon|multisite|netready' branches: - branch-compare-type: 'ANT' branch-pattern: '**/{branch}' diff --git a/jjb/daisy4nfv/daisy-daily-jobs.yml b/jjb/daisy4nfv/daisy-daily-jobs.yml index 3aa9505e7..6f4643ac8 100644 --- a/jjb/daisy4nfv/daisy-daily-jobs.yml +++ b/jjb/daisy4nfv/daisy-daily-jobs.yml @@ -129,15 +129,21 @@ - trigger-builds: - project: 'daisy-deploy-{pod}-daily-{stream}' current-parameters: false - predefined-parameters: + predefined-parameters: | DEPLOY_SCENARIO={scenario} + INSTALLER_VERSION={stream} + UPSTREAM_JOB_NAME=$JOB_NAME + UPSTREAM_BUILD_ID=$BUILD_ID same-node: true block: true - trigger-builds: - project: 'functest-daisy-{pod}-daily-{stream}' current-parameters: false - predefined-parameters: + predefined-parameters: | DEPLOY_SCENARIO={scenario} + INSTALLER_VERSION={stream} + UPSTREAM_JOB_NAME=$JOB_NAME + UPSTREAM_BUILD_ID=$BUILD_ID same-node: true block: true block-thresholds: @@ -157,8 +163,11 @@ - trigger-builds: - project: 'yardstick-daisy-{pod}-daily-{stream}' current-parameters: false - predefined-parameters: + predefined-parameters: | DEPLOY_SCENARIO={scenario} + INSTALLER_VERSION={stream} + UPSTREAM_JOB_NAME=$JOB_NAME + UPSTREAM_BUILD_ID=$BUILD_ID block: true same-node: true block-thresholds: @@ -214,10 +223,13 @@ builders: - description-setter: description: "POD: $NODE_NAME" + - 'track-begin-timestamp' - shell: !include-raw-escape: ./daisy4nfv-download-artifact.sh - shell: !include-raw-escape: ./daisy-deploy.sh + publishers: + - 'report-provision-result' ######################## # trigger macros diff --git a/jjb/daisy4nfv/daisy-deploy.sh b/jjb/daisy4nfv/daisy-deploy.sh index 1723fd109..f729c380e 100755 --- a/jjb/daisy4nfv/daisy-deploy.sh +++ b/jjb/daisy4nfv/daisy-deploy.sh @@ -30,7 +30,7 @@ fi LABS_DIR=/var/tmp/opnfv-${CONFIG_REPO_NAME} echo "Cloning ${CONFIG_REPO_NAME} repo $BRANCH to $LABS_DIR" -rm -rf $LABS_DIR +sudo rm -rf $LABS_DIR git clone ssh://jenkins-zte@gerrit.opnfv.org:29418/${CONFIG_REPO_NAME} \ --quiet --branch $BRANCH $LABS_DIR diff --git a/jjb/daisy4nfv/daisy4nfv-download-artifact.sh b/jjb/daisy4nfv/daisy4nfv-download-artifact.sh index a64c80e5c..ae5ca3813 100755 --- a/jjb/daisy4nfv/daisy4nfv-download-artifact.sh +++ b/jjb/daisy4nfv/daisy4nfv-download-artifact.sh @@ -68,7 +68,15 @@ else DOWNLOAD_CMD="curl -L -s -o $WORKSPACE/opnfv.bin" fi -$DOWNLOAD_CMD http://$OPNFV_ARTIFACT_URL > gsutil.bin.log 2>&1 +maxretries=3 +cnt=0 +rc=1 +while [ $cnt -lt $maxretries ] && [ $rc -ne 0 ] +do + cnt=$[cnt + 1] + $DOWNLOAD_CMD http://$OPNFV_ARTIFACT_URL > gsutil.bin.log 2>&1 + rc=$? +done # list the file ls -al $WORKSPACE/opnfv.bin diff --git a/jjb/doctor/doctor.yml b/jjb/doctor/doctor.yml index 561240158..64194d136 100644 --- a/jjb/doctor/doctor.yml +++ b/jjb/doctor/doctor.yml @@ -66,11 +66,27 @@ - git-scm-gerrit triggers: - - 'doctor-verify': - project: '{project}' - branch: '{branch}' - files: 'doctor_tests/**' - is-skip-vote: false + - gerrit: + server-name: 'gerrit.opnfv.org' + trigger-on: + - patchset-created-event: + exclude-drafts: 'false' + exclude-trivial-rebase: 'false' + exclude-no-code-change: 'false' + - draft-published-event + - comment-added-contains-event: + comment-contains-value: 'recheck' + - comment-added-contains-event: + comment-contains-value: 'reverify' + projects: + - project-compare-type: 'ANT' + project-pattern: '{project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + file-paths: + - compare-type: ANT + pattern: 'doctor_tests/**' builders: - shell: | @@ -120,60 +136,6 @@ project-type: 'multijob' - parameters: - - project-parameter: - project: '{project}' - branch: '{branch}' - - 'opnfv-build-ubuntu-defaults' - - string: - name: OS_CREDS - default: /home/jenkins/openstack.creds - description: 'OpenStack credentials' - - string: - name: DOCKER_TAG - default: '{docker-tag}' - description: 'Tag to pull docker image' - - string: - name: CLEAN_DOCKER_IMAGES - default: 'false' - description: 'Remove downloaded docker images (opnfv/functest:*)' - - string: - name: DEPLOY_SCENARIO - default: 'os-nosdn-nofeature-ha' - description: 'Scenario to deploy and test' - # functest-suite-parameter - - string: - name: FUNCTEST_MODE - default: 'testcase' - - string: - name: FUNCTEST_SUITE_NAME - default: 'doctor-notification' - - string: - name: TESTCASE_OPTIONS - # yamllint disable rule:line-length - default: '-e INSPECTOR_TYPE={inspector} -v $WORKSPACE:/home/opnfv/repos/doctor' - # yamllint enable rule:line-length - description: 'Addtional parameters specific to test case(s)' - # functest-parameter - - string: - name: GS_PATHNAME - default: '{gs-pathname}' - # yamllint disable rule:line-length - description: "Version directory where the opnfv documents will be stored in gs repository" - # yamllint enable rule:line-length - - string: - name: FUNCTEST_REPO_DIR - default: "/home/opnfv/repos/functest" - description: "Directory where the Functest repository is cloned" - - string: - name: PUSH_RESULTS_TO_DB - default: "true" - description: "Push the results of all the tests to the resultDB" - - string: - name: CI_DEBUG - default: 'true' - description: "Show debug output information" - scm: - git-scm-gerrit @@ -182,7 +144,6 @@ project: '{project}' branch: '{branch}' files: 'doctor_tests/**' - is-skip-vote: true builders: - shell: | @@ -250,12 +211,74 @@ branch: '{branch}' - '{installer}-defaults' - '{slave-label}-defaults' + - 'doctor-parameter' + - 'doctor-functest-parameter' scm: - git-scm-gerrit builders: - 'doctor-verify-installer-inspector-builders-macro' publishers: - 'doctor-verify-publishers-macro' + + +# ------------------------------- +# parameter macros +# ------------------------------- +- parameter: + name: 'doctor-parameter' + parameters: + - string: + name: OS_CREDS + default: /home/jenkins/openstack.creds + description: 'OpenStack credentials' + - string: + name: DOCKER_TAG + default: '{docker-tag}' + description: 'Tag to pull docker image' + - string: + name: CLEAN_DOCKER_IMAGES + default: 'false' + description: 'Remove downloaded docker images (opnfv/functest:*)' + - string: + name: DEPLOY_SCENARIO + default: 'os-nosdn-nofeature-ha' + description: 'Scenario to deploy and test' + +- parameter: + name: 'doctor-functest-parameter' + parameters: + # functest-suite-parameter + - string: + name: FUNCTEST_MODE + default: 'testcase' + - string: + name: FUNCTEST_SUITE_NAME + default: 'doctor-notification' + - string: + name: TESTCASE_OPTIONS + # yamllint disable rule:line-length + default: '-e INSPECTOR_TYPE={inspector} -v $WORKSPACE:/home/opnfv/repos/doctor' + # yamllint enable rule:line-length + description: 'Addtional parameters specific to test case(s)' + # functest-parameter + - string: + name: GS_PATHNAME + default: '{gs-pathname}' + # yamllint disable rule:line-length + description: "Version directory where the opnfv documents will be stored in gs repository" + # yamllint enable rule:line-length + - string: + name: FUNCTEST_REPO_DIR + default: "/home/opnfv/repos/functest" + description: "Directory where the Functest repository is cloned" + - string: + name: PUSH_RESULTS_TO_DB + default: "true" + description: "Push the results of all the tests to the resultDB" + - string: + name: CI_DEBUG + default: 'true' + description: "Show debug output information" # ------------------------------- # builder macros # ------------------------------- @@ -338,7 +361,7 @@ - compare-type: ANT pattern: '{files}' skip-vote: - successful: '{is-skip-vote}' - failed: '{is-skip-vote}' - unstable: '{is-skip-vote}' - notbuilt: '{is-skip-vote}' + successful: true + failed: true + unstable: true + notbuilt: true diff --git a/jjb/global/installer-report.sh b/jjb/global/installer-report.sh new file mode 100755 index 000000000..e2fcfd6f6 --- /dev/null +++ b/jjb/global/installer-report.sh @@ -0,0 +1,25 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2017 ZTE Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +source $WORKSPACE/installer_track.sh +echo """ + INSTALLER: $INSTALLER + INSTALLER_VERSION: $INSTALLER_VERSION + JOB_NAME: $JOB_NAME + BUILD_ID: $BUILD_ID + SENARIO: $DEPLOY_SCENARIO + UPSTREAM_JOB_NAME: $UPSTREAM_JOB_NAME: + UPSTREAM_BUILD_ID: $UPSTREAM_BUILD_ID + PROVISION_RESULT: $PROVISION_RESULT + TIMESTAMP_START: $TIMESTAMP_START + TIMESTAMP_END: `date '+%Y-%m-%d %H:%M:%S.%3N'` + POD_NAME: $NODE_NAME +""" + +# TODO call TestAPI to report installer provisoin result when API is ready diff --git a/jjb/global/releng-macros.yml b/jjb/global/releng-macros.yml index aeeb24610..330584e25 100644 --- a/jjb/global/releng-macros.yml +++ b/jjb/global/releng-macros.yml @@ -151,7 +151,7 @@ - gerrit: server-name: 'gerrit.opnfv.org' trigger-on: - - ref-updated + - ref-updated-event projects: - project-compare-type: 'ANT' project-pattern: '{project}' @@ -431,6 +431,12 @@ - shell: | find $WORKSPACE -type f -name '*.log' | xargs rm -f +- builder: + name: track-begin-timestamp + builders: + - shell: | + echo "export TIMESTAMP_START="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh + - publisher: name: archive-artifacts publishers: @@ -971,3 +977,23 @@ <<: *email_ptl_defaults recipients: > ross.b.brattain@intel.com + +- publisher: + name: 'report-provision-result' + publishers: + - postbuildscript: + script-only-if-succeeded: true + builders: + - shell: | + echo "export PROVISION_RESULT=SUCCEED" >> $WORKSPACE/installer_track.sh + echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh + - shell: + !include-raw-escape: installer-report.sh + - postbuildscript: + script-only-if-failed: true + builders: + - shell: | + echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh + echo "export INSTALLER={installer}" >> $WORKSPACE/installer_track.sh + - shell: + !include-raw-escape: installer-report.sh diff --git a/jjb/pharos/pharos.yml b/jjb/pharos/pharos.yml index d0db6a488..e1628250d 100644 --- a/jjb/pharos/pharos.yml +++ b/jjb/pharos/pharos.yml @@ -11,6 +11,7 @@ jobs: - '{project}-verify-basic' - 'backup-pharos-dashboard' + - 'deploy-pharos-dashboard' - job-template: name: 'backup-pharos-dashboard' @@ -38,3 +39,37 @@ sudo mv $TMP_DIR/pharos-dashboard-db-$(date +%Y%m%d).tar.gz $BACKUP_DIR sudo chown $USER:$USER $BACKUP_DIR/pharos-dashboard-db-$(date +%Y%m%d).tar.gz echo "...complete" + +- job-template: + name: 'deploy-pharos-dashboard' + + disabled: '{obj:disabled}' + + parameters: + - project-parameter: + project: 'pharos-tools' + branch: 'master' + - 'pharos-dashboard-defaults' + + scm: + - git-scm-gerrit + + triggers: + - gerrit: + server-name: 'gerrit.opnfv.org' + trigger-on: + - ref-updated-event + - comment-added-contains-event: + comment-contains-value: '^redeploy$' + projects: + - project-compare-type: 'ANT' + project-pattern: 'pharos-tools' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/master' + + builders: + - shell: | + cd $WORKSPACE/dashboard + sudo docker-compose build + sudo docker-compose up -d diff --git a/jjb/releng/compass4nfv-docker.yml b/jjb/releng/compass4nfv-docker.yml index db2e4273b..7f142241c 100644 --- a/jjb/releng/compass4nfv-docker.yml +++ b/jjb/releng/compass4nfv-docker.yml @@ -36,7 +36,7 @@ predefined-parameters: | PUSH_IMAGE=$PUSH_IMAGE COMMIT_ID=$COMMIT_ID - RELEASE_VERSION=$RELEASE_VERSION + GERRIT_REFNAME=$GERRIT_REFNAME DOCKERFILE=$DOCKERFILE kill-phase-on: FAILURE abort-all-jobs: false @@ -146,9 +146,9 @@ default: "" description: "commit id to make a snapshot docker image" - string: - name: RELEASE_VERSION + name: GERRIT_REFNAME default: "" - description: "Docker tag to be built, e.g. 5.0.0, opnfv-5.0.0, 5.0.RC1" + description: "Docker tag to be built, e.g. refs/tags/5.0.0, refs/tags/opnfv-5.0.0, refs/tags/5.0.RC1" - string: name: DOCKERFILE default: "Dockerfile" diff --git a/jjb/releng/functest-docker.yml b/jjb/releng/functest-docker.yml index 147bcda98..584dc302c 100644 --- a/jjb/releng/functest-docker.yml +++ b/jjb/releng/functest-docker.yml @@ -41,7 +41,7 @@ predefined-parameters: | PUSH_IMAGE=$PUSH_IMAGE COMMIT_ID=$COMMIT_ID - RELEASE_VERSION=$RELEASE_VERSION + GERRIT_REFNAME=$GERRIT_REFNAME DOCKERFILE=$DOCKERFILE kill-phase-on: FAILURE abort-all-jobs: false @@ -51,7 +51,7 @@ git-revision: true node-parameters: false predefined-parameters: - RELEASE_VERSION=$RELEASE_VERSION + GERRIT_REFNAME=$GERRIT_REFNAME kill-phase-on: FAILURE abort-all-jobs: false @@ -89,6 +89,8 @@ triggers: - pollscm: cron: "*/30 * * * *" + - gerrit-trigger-tag-created: + project: '{project}' builders: - multijob: @@ -200,10 +202,6 @@ default: "{project}" description: "Project name used to enable job conditions" - string: - name: RELEASE_VERSION - default: "" - description: "Docker tag to be built, e.g. 5.0.0, opnfv-5.0.0, 5.0.RC1" - - string: name: GIT_BASE default: https://gerrit.opnfv.org/gerrit/$PROJECT description: 'Git URL to use on this Jenkins Slave' @@ -249,9 +247,9 @@ default: "" description: "commit id to make a snapshot docker image" - string: - name: RELEASE_VERSION + name: GERRIT_REFNAME default: "" - description: "Docker tag to be built, e.g. 5.0.0, opnfv-5.0.0, 5.0.RC1" + description: "Docker tag to be built, e.g. refs/tags/5.0.0, refs/tags/opnfv-5.0.0, refs/tags/5.0.RC1" - string: name: DOCKERFILE default: "Dockerfile" diff --git a/jjb/releng/opnfv-docker-arm.yml b/jjb/releng/opnfv-docker-arm.yml index 75e41c1a7..fbf565844 100644 --- a/jjb/releng/opnfv-docker-arm.yml +++ b/jjb/releng/opnfv-docker-arm.yml @@ -154,9 +154,9 @@ default: "{docker_repo_name}" description: "Dockerhub repo to be pushed to." - string: - name: RELEASE_VERSION + name: GERRIT_REFNAME default: "" - description: "Release version, e.g. 1.0, 2.0, 3.0" + description: "Docker tag to be built, e.g. refs/tags/5.0.0, refs/tags/opnfv-5.0.0, refs/tags/5.0.RC1" - string: name: DOCKER_DIR default: "{dockerdir}" @@ -185,6 +185,8 @@ triggers: - pollscm: cron: "*/30 * * * *" + - gerrit-trigger-tag-created: + project: '{project}' publishers: - email: diff --git a/jjb/releng/opnfv-docker.sh b/jjb/releng/opnfv-docker.sh index 7f646f1d9..69a9f89c7 100644 --- a/jjb/releng/opnfv-docker.sh +++ b/jjb/releng/opnfv-docker.sh @@ -77,6 +77,9 @@ echo "Current branch: $BRANCH" BUILD_BRANCH=$BRANCH +GERRIT_REFNAME=${GERRIT_REFNAME:-''} +RELEASE_VERSION=${GERRIT_REFNAME/refs\/tags//} + if [[ "$BRANCH" == "master" ]]; then DOCKER_TAG="latest" elif [[ -n "${RELEASE_VERSION-}" ]]; then diff --git a/jjb/releng/opnfv-docker.yml b/jjb/releng/opnfv-docker.yml index 7ee158ce3..317efc807 100644 --- a/jjb/releng/opnfv-docker.yml +++ b/jjb/releng/opnfv-docker.yml @@ -39,34 +39,29 @@ project: 'releng-anteater' <<: *master <<: *other-receivers - - 'barometer': + - 'barometer-collectd': project: 'barometer' - dockerdir: '.' - dockerfile: 'docker/Dockerfile' + dockerdir: 'docker/barometer-collectd' <<: *master <<: *other-receivers - 'barometer-grafana': project: 'barometer' - dockerdir: '.' - dockerfile: 'docker/barometer-grafana/Dockerfile' + dockerdir: 'docker/barometer-grafana' <<: *master <<: *other-receivers - 'barometer-influxdb': project: 'barometer' - dockerdir: '.' - dockerfile: 'docker/barometer-influxdb/Dockerfile' + dockerdir: 'docker/barometer-influxdb' <<: *master <<: *other-receivers - 'barometer-kafka': project: 'barometer' - dockerdir: '.' - dockerfile: 'docker/barometer-kafka/Dockerfile' + dockerdir: 'docker/barometer-kafka' <<: *master <<: *other-receivers - 'barometer-ves': project: 'barometer' - dockerdir: '.' - dockerfile: 'docker/barometer-ves/Dockerfile' + dockerdir: 'docker/barometer-ves' <<: *master <<: *other-receivers - 'bottlenecks': @@ -236,9 +231,9 @@ default: "" description: "commit id to make a snapshot docker image" - string: - name: RELEASE_VERSION + name: GERRIT_REFNAME default: "" - description: "Docker tag to be built, e.g. 5.0.0, opnfv-5.0.0, 5.0.RC1" + description: "Docker tag to be built, e.g. refs/tags/5.0.0, refs/tags/opnfv-5.0.0, refs/tags/5.0.RC1" - string: name: DOCKERFILE default: "{dockerfile}" @@ -263,6 +258,8 @@ triggers: - pollscm: cron: "*/30 * * * *" + - gerrit-trigger-tag-created: + project: '{project}' publishers: - email: diff --git a/jjb/releng/releng-ci-jobs.yml b/jjb/releng/releng-ci-jobs.yml index c4b7c8db3..ef99f5abb 100644 --- a/jjb/releng/releng-ci-jobs.yml +++ b/jjb/releng/releng-ci-jobs.yml @@ -90,6 +90,12 @@ project: '{project}' branch: 'master' + properties: + - throttle: + max-per-node: 1 + max-total: 1 + option: 'project' + scm: - git-scm diff --git a/jjb/snaps/snaps-verify-jobs.yml b/jjb/snaps/snaps-verify-jobs.yml index bc3f39315..a6c86c966 100644 --- a/jjb/snaps/snaps-verify-jobs.yml +++ b/jjb/snaps/snaps-verify-jobs.yml @@ -15,7 +15,7 @@ - master: branch: '{stream}' gs-pathname: '' - disabled: false + disabled: true - job-template: name: 'snaps-verify-{stream}' diff --git a/jjb/xci/xci-cleanup.sh b/jjb/xci/xci-cleanup.sh new file mode 100755 index 000000000..45b4ec273 --- /dev/null +++ b/jjb/xci/xci-cleanup.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 SUSE and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +#---------------------------------------------------------------------- +# This script is used by CI and executed by Jenkins jobs. +# You are not supposed to use this script manually if you don't know +# what you are doing. +#---------------------------------------------------------------------- + +# skip the deployment if the patch doesn't impact the deployment +if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then + echo "Skipping the deployment!" + exit 0 +fi + +sudo virsh destroy ${DISTRO}_xci_vm +sudo virsh undefine ${DISTRO}_xci_vm diff --git a/jjb/xci/xci-merge-jobs.yml b/jjb/xci/xci-merge-jobs.yml new file mode 100644 index 000000000..351fe22bb --- /dev/null +++ b/jjb/xci/xci-merge-jobs.yml @@ -0,0 +1,257 @@ +--- +- project: + name: 'opnfv-xci-merge' + + # ------------------------------- + # branches + # ------------------------------- + stream: + - master: + branch: '{stream}' + # ------------------------------- + # distros + # ------------------------------- + distro: + - ubuntu: + disabled: false + - centos: + disabled: false + - opensuse: + disabled: false + # ------------------------------- + # type + # ------------------------------- + type: + - virtual + # ------------------------------- + # patch verification phases + # ------------------------------- + phase: + - 'deploy' + - 'healthcheck' + - 'promote' + # ------------------------------- + # scenarios + # ------------------------------- + scenario: + - 'os-odl-sfc': + project: sfc + # ------------------------------- + # jobs + # ------------------------------- + jobs: + - 'xci-{scenario}-{type}-{distro}-merge-{stream}' + - 'xci-{phase}-{type}-{distro}-merge-{stream}' +# ------------------------------- +# job templates +# ------------------------------- +- job-template: + name: 'xci-{scenario}-{type}-{distro}-merge-{stream}' + + project-type: multijob + + disabled: '{obj:disabled}' + + concurrent: false + + properties: + - logrotate-default + - build-blocker: + use-build-blocker: true + blocking-jobs: + - 'xci-verify-{distro}-.*' + - 'bifrost-verify-{distro}-.*' + - 'bifrost-periodic-{distro}-.*' + - 'xci-osa-verify-{distro}-.*' + - 'xci-osa-periodic-{distro}-.*' + - 'xci-(os|k8s).*?-virtual-{distro}-.*' + block-level: 'NODE' + + wrappers: + - ssh-agent-wrapper + - build-timeout: + timeout: 240 + - fix-workspace-permissions + + scm: + - git: + credentials-id: '$SSH_CREDENTIAL_ID' + url: 'https://gerrit.opnfv.org/gerrit/releng-xci' + branches: + - 'origin/master' + timeout: 15 + + triggers: + - gerrit: + server-name: 'gerrit.opnfv.org' + trigger-on: + - change-merged-event + - comment-added-contains-event: + comment-contains-value: 'remerge' + projects: + - project-compare-type: 'ANT' + project-pattern: '{obj:project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**/{branch}' + disable-strict-forbidden-file-verification: 'true' + file-paths: + - compare-type: ANT + pattern: 'scenarios/**' + readable-message: true + custom-url: '* $JOB_NAME $BUILD_URL' + + parameters: + - project-parameter: + project: '{obj:project}' + branch: '{branch}' + - label: + name: SLAVE_LABEL + default: 'xci-virtual' + - string: + name: DEPLOY_SCENARIO + default: '{scenario}' + - string: + name: CLEAN_DIB_IMAGES + default: 'true' + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: 'Git URL to use on this Jenkins Slave' + + builders: + - description-setter: + description: "Built on $NODE_NAME" + - multijob: + name: deploy + condition: SUCCESSFUL + projects: + - name: 'xci-deploy-{type}-{distro}-merge-{stream}' + current-parameters: true + predefined-parameters: | + PROJECT=$PROJECT + DISTRO={distro} + DEPLOY_SCENARIO={scenario} + CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + node-parameters: true + kill-phase-on: FAILURE + abort-all-job: true + - multijob: + name: healthcheck + condition: SUCCESSFUL + projects: + - name: 'xci-healthcheck-{type}-{distro}-merge-{stream}' + current-parameters: true + predefined-parameters: | + PROJECT=$PROJECT + DISTRO={distro} + DEPLOY_SCENARIO={scenario} + CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES + FUNCTEST_MODE=tier + FUNCTEST_TIER=healthcheck + GERRIT_BRANCH=$GERRIT_BRANCH + GERRIT_REFSPEC=$GERRIT_REFSPEC + GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER + GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE + node-parameters: true + kill-phase-on: NEVER + abort-all-job: true + +- job-template: + name: 'xci-{phase}-{type}-{distro}-merge-{stream}' + + disabled: false + + concurrent: true + + properties: + - logrotate-default + - build-blocker: + use-build-blocker: true + blocking-jobs: + - '.*-bifrost-verify-.*' + - '.*-bifrost-periodic-.*' + - 'osa-verify-.*' + - 'osa-periodic-.*' + block-level: 'NODE' + + parameters: + - string: + name: PROJECT + default: 'releng-xci' + - string: + name: DISTRO + default: 'ubuntu' + - string: + name: DEPLOY_SCENARIO + default: 'os-nosdn-nofeature-noha' + - string: + name: FUNCTEST_MODE + default: 'tier' + - string: + name: FUNCTEST_SUITE_NAME + default: 'healthcheck' + - string: + name: XCI_FLAVOR + default: 'mini' + - string: + name: CLEAN_DIB_IMAGES + default: 'true' + - string: + name: OPNFV_RELENG_DEV_PATH + default: $WORKSPACE/ + - string: + name: INSTALLER_TYPE + default: 'osa' + - string: + name: GIT_BASE + default: https://gerrit.opnfv.org/gerrit/$PROJECT + description: 'Git URL to use on this Jenkins Slave' + + wrappers: + - ssh-agent-wrapper + - build-timeout: + timeout: 240 + - fix-workspace-permissions + + scm: + - git: + credentials-id: '$SSH_CREDENTIAL_ID' + url: 'https://gerrit.opnfv.org/gerrit/releng-xci' + branches: + - 'origin/master' + timeout: 15 + + builders: + - description-setter: + description: "Built on $NODE_NAME" + - 'xci-merge-{phase}-macro' + +# ------------------------------- +# builder macros +# ------------------------------- +- builder: + name: 'xci-merge-deploy-macro' + builders: + - shell: + !include-raw: ./xci-start-new-vm.sh + - shell: + !include-raw: ./xci-start-deployment.sh + +- builder: + name: 'xci-merge-healthcheck-macro' + builders: + - shell: + !include-raw: ./xci-run-functest.sh + - shell: + !include-raw: ./xci-cleanup.sh + +- builder: + name: 'xci-merge-promote-macro' + builders: + - shell: + !include-raw: ./xci-promote.sh diff --git a/jjb/xci/xci-promote.sh b/jjb/xci/xci-promote.sh new file mode 100755 index 000000000..98ad7ff4a --- /dev/null +++ b/jjb/xci/xci-promote.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 Ericsson and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +#---------------------------------------------------------------------- +# This script is used by CI and executed by Jenkins jobs. +# You are not supposed to use this script manually if you don't know +# what you are doing. +#---------------------------------------------------------------------- + +# skip the healthcheck if the patch doesn't impact the deployment +if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then + echo "Skipping the healthcheck!" + exit 0 +fi + +# skip the deployment if the scenario is not supported on this distro +OPNFV_SCENARIO_REQUIREMENTS=$WORKSPACE/xci/opnfv-scenario-requirements.yml +if ! sed -n "/^- scenario: $DEPLOY_SCENARIO$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENTS | grep -q $DISTRO; then + echo "# SKIPPED: Scenario $DEPLOY_SCENARIO is NOT supported on $DISTRO" + exit 0 +fi + +echo "Hello World!" diff --git a/jjb/xci/xci-run-functest.sh b/jjb/xci/xci-run-functest.sh new file mode 100755 index 000000000..4fbc6c40d --- /dev/null +++ b/jjb/xci/xci-run-functest.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 SUSE and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +#---------------------------------------------------------------------- +# This script is used by CI and executed by Jenkins jobs. +# You are not supposed to use this script manually if you don't know +# what you are doing. +#---------------------------------------------------------------------- + +# skip the healthcheck if the patch doesn't impact the deployment +if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then + echo "Skipping the healthcheck!" + exit 0 +fi + +# skip the deployment if the scenario is not supported on this distro +OPNFV_SCENARIO_REQUIREMENTS=$WORKSPACE/xci/opnfv-scenario-requirements.yml +if ! sed -n "/^- scenario: $DEPLOY_SCENARIO$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENTS | grep -q $DISTRO; then + echo "# SKIPPED: Scenario $DEPLOY_SCENARIO is NOT supported on $DISTRO" + exit 0 +fi + +echo "Hello World!" diff --git a/jjb/xci/xci-start-deployment.sh b/jjb/xci/xci-start-deployment.sh new file mode 100755 index 000000000..e86f5b3a1 --- /dev/null +++ b/jjb/xci/xci-start-deployment.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 SUSE and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +#---------------------------------------------------------------------- +# This script is used by CI and executed by Jenkins jobs. +# You are not supposed to use this script manually if you don't know +# what you are doing. +#---------------------------------------------------------------------- + +# skip the deployment if the patch doesn't impact the deployment +if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then + echo "Skipping the deployment!" + exit 0 +fi + +# skip the deployment if the scenario is not supported on this distro +OPNFV_SCENARIO_REQUIREMENTS=$WORKSPACE/xci/opnfv-scenario-requirements.yml +if ! sed -n "/^- scenario: $DEPLOY_SCENARIO$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENTS | grep -q $DISTRO; then + echo "# SKIPPED: Scenario $DEPLOY_SCENARIO is NOT supported on $DISTRO" + exit 0 +fi + +ssh -F $HOME/.ssh/xci-vm-config ${DISTRO}_xci_vm "cd releng-xci && ./xci_test.sh" diff --git a/jjb/xci/xci-start-new-vm.sh b/jjb/xci/xci-start-new-vm.sh new file mode 100755 index 000000000..b72c33920 --- /dev/null +++ b/jjb/xci/xci-start-new-vm.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 SUSE and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +#---------------------------------------------------------------------- +# This script is used by CI and executed by Jenkins jobs. +# You are not supposed to use this script manually if you don't know +# what you are doing. +#---------------------------------------------------------------------- + +# skip the deployment if the patch doesn't impact the deployment +if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then + echo "Skipping the deployment!" + exit 0 +fi + +# skip the deployment if the scenario is not supported on this distro +OPNFV_SCENARIO_REQUIREMENTS=$WORKSPACE/xci/opnfv-scenario-requirements.yml +if ! sed -n "/^- scenario: $DEPLOY_SCENARIO$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENTS | grep -q $DISTRO; then + echo "# SKIPPED: Scenario $DEPLOY_SCENARIO is NOT supported on $DISTRO" + exit 0 +fi + +cd $WORKSPACE + +# The start-new-vm.sh script will copy the entire releng-xci directory +# so lets prepare the test script now so it can be copied by the script. +# Please do not move it elsewhere or you would have to move it to the VM +# yourself. +cat > xci_test.sh<<EOF +#!/bin/bash +export DISTRO=$DISTRO +export DEPLOY_SCENARIO=$DEPLOY_SCENARIO +export FUNCTEST_MODE=$FUNCTEST_MODE +export FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME +export XCI_FLAVOR=$XCI_FLAVOR +export CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES +export OPNFV_RELENG_DEV_PATH=/home/devuser/releng-xci/ +export INSTALLER_TYPE=$INSTALLER_TYPE +export GIT_BASE=$GIT_BASE +export JENKINS_HOME=$JENKINS_HOME + +if [[ ! -z ${WORKSPACE+x} && $GERRIT_PROJECT != "releng-xci" ]]; then + git clone https://gerrit.opnfv.org/gerrit/$GERRIT_PROJECT xci/scenarios/$DEPLOY_SCENARIO && cd xci/scenarios/$DEPLOY_SCENARIO + git fetch https://gerrit.opnfv.org/gerrit/$GERRIT_PROJECT $GERRIT_REFSPEC && git checkout FETCH_HEAD + cd - +fi + +cd xci +./xci-deploy.sh +EOF +chmod a+x xci_test.sh + +export XCI_BUILD_CLEAN_VM_OS=false +export XCI_UPDATE_CLEAN_VM_OS=true + +./xci/scripts/vm/start-new-vm.sh $DISTRO diff --git a/jjb/xci/xci-verify-jobs.yml b/jjb/xci/xci-verify-jobs.yml index fffd5c2b4..af2432dd0 100644 --- a/jjb/xci/xci-verify-jobs.yml +++ b/jjb/xci/xci-verify-jobs.yml @@ -244,85 +244,16 @@ - builder: name: 'xci-verify-deploy-macro' builders: - - shell: | - #!/bin/bash - - # skip the deployment if the patch doesn't impact the deployment - if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then - echo "Skipping the deployment!" - exit 0 - fi - - cd $WORKSPACE - - # The start-new-vm.sh script will copy the entire releng-xci directory - # so lets prepare the test script now so it can be copied by the script. - # Please do not move it elsewhere or you would have to move it to the VM - # yourself. - cat > xci_test.sh<<EOF - #!/bin/bash - export DISTRO=$DISTRO - export DEPLOY_SCENARIO=$DEPLOY_SCENARIO - export FUNCTEST_MODE=$FUNCTEST_MODE - export FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME - export XCI_FLAVOR=$XCI_FLAVOR - export CLEAN_DIB_IMAGES=$CLEAN_DIB_IMAGES - export OPNFV_RELENG_DEV_PATH=/home/devuser/releng-xci/ - export INSTALLER_TYPE=$INSTALLER_TYPE - export GIT_BASE=$GIT_BASE - export JENKINS_HOME=$JENKINS_HOME - - cd xci - ./xci-deploy.sh - EOF - chmod a+x xci_test.sh - - export XCI_BUILD_CLEAN_VM_OS=false - export XCI_UPDATE_CLEAN_VM_OS=true - - ./xci/scripts/vm/start-new-vm.sh $DISTRO - - shell: | - #!/bin/bash - - # skip the deployment if the patch doesn't impact the deployment - if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then - echo "Skipping the deployment!" - exit 0 - fi - - ssh -F $HOME/.ssh/xci-vm-config ${DISTRO}_xci_vm "cd releng-xci && ./xci_test.sh" + - shell: + !include-raw: ./xci-start-new-vm.sh + - shell: + !include-raw: ./xci-start-deployment.sh - builder: name: 'xci-verify-healthcheck-macro' builders: - - shell: | - #!/bin/bash - - # skip the healthcheck if the patch doesn't impact the deployment - if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then - echo "Skipping the healthcheck!" - exit 0 - fi - - echo "Hello World!" - - shell: | - #!/bin/bash - - # skip the deployment if the patch doesn't impact the deployment - if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then - echo "Skipping the deployment!" - exit 0 - fi - - sudo virsh destroy ${DISTRO}_xci_vm - sudo virsh undefine ${DISTRO}_xci_vm - -# this will be enabled once the xci is prepared -# - builder: -# name: 'xci-verify-healthcheck-macro' -# builders: -# - shell: -# !include-raw: ../../utils/fetch_os_creds.sh -# - shell: -# !include-raw: ../functest/functest-alpine.sh + - shell: + !include-raw: ./xci-run-functest.sh + - shell: + !include-raw: ./xci-cleanup.sh |