same-node: true
block: true
- trigger-builds:
- - project: 'functest-{installer}-{pod}-daily-{stream}'
+ - project: 'functest-{installer}-{pod}-arm-daily-{stream}'
current-parameters: false
predefined-parameters:
DEPLOY_SCENARIO={scenario}
- project:
name: yardstick-arm64
- project: '{name}'
+ project: 'yardstick'
# -------------------------------
# BRANCH ANCHORS
- '{installer}-defaults'
- '{slave-label}-defaults':
installer: '{installer}'
- - string:
- name: DEPLOY_SCENARIO
- default: '{scenario}'
- - string:
- name: INSTALLER_VERSION
- default: ''
- - string:
- name: UPSTREAM_JOB_NAME
- default: ''
- - string:
- name: UPSTREAM_BUILD_ID
- default: ''
+ - 'testapi-parameter'
- 'daisy-project-parameter':
gs-pathname: '{gs-pathname}'
- build-blocker:
use-build-blocker: true
blocking-jobs:
- - 'daisy.*-deploy-({pod})?-daily-.*'
- 'daisy-kolla-build-.*'
+ - '{installer}-daily-(build|deploy|test)-(euphrates|master)'
+ - '{installer}-.*-(baremetal|virtual|zte-pod9)-daily-(euphrates|master)'
+ - '(functest|yardstick)-{installer}-(baremetal|virtual|zte-pod9)-daily-(euphrates|master)'
block-level: 'NODE'
parameters:
- '{installer}-defaults'
- '{slave-label}-defaults':
installer: '{installer}'
- - string:
- name: DEPLOY_SCENARIO
- default: 'os-nosdn-nofeature-ha'
+ - 'testapi-parameter'
- 'daisy-project-parameter':
gs-pathname: '{gs-pathname}'
- string:
enabled: true
max-total: 6
option: 'project'
+ - build-blocker:
+ use-build-blocker: true
+ blocking-jobs:
+ - '{installer}-daily-(build|deploy|test)-(euphrates|master)'
+ - '{installer}-.*-(baremetal|virtual|zte-pod9)-daily-(euphrates|master)'
+ - '(functest|yardstick)-{installer}-(baremetal|virtual|zte-pod9)-daily-(euphrates|master)'
+ block-level: 'NODE'
scm:
- git-scm
installer:
- 'apex'
- 'fuel'
- # - 'joid'
+ - 'daisy'
arch:
- 'x86_64'
- 'sample'
- 'congress'
- task:
- - verify:
- auto-trigger-name: 'doctor-verify'
-
exclude:
- installer: 'apex'
arch: 'aarch64'
+ - installer: 'daisy'
+ arch: 'aarch64'
jobs:
- 'doctor-verify-{stream}'
- 'doctor-verify-unit-test-{stream}'
- - 'doctor-{task}-{inspector}-{stream}'
- - 'doctor-{task}-{installer}-{inspector}-{arch}-{stream}'
+ - 'doctor-verify-{inspector}-{stream}'
+ - 'doctor-verify-{installer}-{inspector}-{arch}-{stream}'
- job-template:
name: 'doctor-verify-{stream}'
file-paths:
- compare-type: ANT
pattern: 'doctor_tests/**'
+
builders:
- shell: |
#!/bin/bash
- 'doctor-verify-unit-test-publishers-macro'
- job-template:
- name: 'doctor-{task}-{inspector}-{stream}'
+ name: 'doctor-verify-{inspector}-{stream}'
disabled: '{obj:disabled}'
project-type: 'multijob'
scm:
- git-scm-gerrit
triggers:
- - '{auto-trigger-name}':
+ - 'doctor-verify':
project: '{project}'
branch: '{branch}'
files: 'doctor_tests/**'
+
builders:
- shell: |
#!/bin/bash
name: 'doctor-verify-apex-inspector'
execution-type: PARALLEL
projects:
- - name: 'doctor-{task}-apex-{inspector}-x86_64-{stream}'
+ - name: 'doctor-verify-apex-{inspector}-x86_64-{stream}'
predefined-parameters: |
PROJECT=$PROJECT
GERRIT_BRANCH=$GERRIT_BRANCH
name: 'doctor-verify-fuel-inspector'
execution-type: PARALLEL
projects:
- - name: 'doctor-{task}-fuel-{inspector}-x86_64-{stream}'
+ - name: 'doctor-verify-fuel-{inspector}-x86_64-{stream}'
predefined-parameters: |
PROJECT=$PROJECT
GERRIT_BRANCH=$GERRIT_BRANCH
name: 'doctor-verify-fuel-inspector'
execution-type: PARALLEL
projects:
- - name: 'doctor-{task}-fuel-{inspector}-aarch64-{stream}'
+ - name: 'doctor-verify-fuel-{inspector}-aarch64-{stream}'
+ predefined-parameters: |
+ GERRIT_BRANCH=$GERRIT_BRANCH
+ GERRIT_REFSPEC=$GERRIT_REFSPEC
+ GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
+ GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
+ kill-phase-on: FAILURE
+ current-parameters: true
+ git-revision: true
+ - multijob:
+ name: 'doctor-verify-daisy-inspector'
+ execution-type: PARALLEL
+ projects:
+ - name: 'doctor-verify-daisy-{inspector}-x86_64-{stream}'
predefined-parameters: |
PROJECT=$PROJECT
GERRIT_BRANCH=$GERRIT_BRANCH
git-revision: true
- job-template:
- name: 'doctor-{task}-{installer}-{inspector}-{arch}-{stream}'
+ name: 'doctor-verify-{installer}-{inspector}-{arch}-{stream}'
disabled: '{obj:disabled}'
node: 'doctor-{installer}-{arch}'
wrappers:
run_tiers ${tiers}
else
if [ ${DEPLOY_TYPE} == 'baremetal' ]; then
- tiers=(healthcheck smoke patrole features vnf parser)
+ tiers=(healthcheck smoke features vnf parser)
else
- tiers=(healthcheck smoke patrole features)
+ tiers=(healthcheck smoke features)
fi
run_tiers ${tiers}
fi
stream: master
branch: '{stream}'
gs-pathname: ''
- disabled: false
euphrates: &euphrates
stream: euphrates
branch: 'stable/{stream}'
gs-pathname: '/{stream}'
- disabled: false
# -------------------------------
# POD, INSTALLER, AND BRANCH MAPPING
# -------------------------------
# <<: *master
# -------------------------------
- functest-tier:
- - 'healthcheck':
- job-timeout: 20
- - 'smoke':
- job-timeout: 180
- - 'components':
- job-timeout: 240
- - 'patrole':
- job-timeout: 20
- - 'vnf':
- job-timeout: 240
- - 'parser':
- job-timeout: 20
-
- features-suite:
- - 'doctor-notification'
- - 'promise'
- - 'bgpvpn'
- - 'functest-odl-sfc'
- - 'domino-multinode'
- - 'fds'
- - 'barometercollectd'
-
- exclude:
- - features-suite: 'promise'
- stream: 'master'
- - features-suite: 'domino-multinode'
- stream: 'master'
- - features-suite: 'fds'
- stream: 'euphrates'
-
- build-job-settings: &build-job-settings
- current-parameter: false
- git-revision: true
- node-parameters: false
- kill-phase-on: FAILURE
- abort-all-jobs: false
- predefined-parameters: |
- FUNCTEST_MODE=$FUNCTEST_MODE
- FUNCTEST_TIER=$FUNCTEST_TIER
-
- features-job-settings: &features-job-settings
- current-parameter: false
- git-revision: true
- node-parameters: false
- kill-phase-on: FAILURE
- abort-all-jobs: false
- predefined-parameters: |
- FUNCTEST_MODE=$FUNCTEST_MODE
- FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
+ testsuite:
+ - 'suite':
+ job-timeout: 60
+ - 'daily':
+ job-timeout: 360
+ - 'arm-daily':
+ job-timeout: 360
jobs:
- - 'functest-{installer}-{pod}-suite-{stream}'
- - 'functest-{installer}-{pod}-daily-{stream}'
- - 'functest-{installer}-{pod}-daily-{functest-tier}-{stream}'
- - 'functest-{installer}-{pod}-daily-features-{features-suite}-{stream}'
+ - 'functest-{installer}-{pod}-{testsuite}-{stream}'
+
################################
# job template
################################
- job-template:
-
- name: 'functest-{installer}-{pod}-daily-{stream}'
-
- project-type: multijob
-
- disabled: '{obj:disabled}'
-
- parameters:
- - project-parameter:
- project: '{project}'
- branch: '{branch}'
- - '{installer}-defaults'
- - '{slave-label}-defaults'
- - functest-parameter:
- gs-pathname: '{gs-pathname}'
-
- builders:
- - multijob:
- name: 'Run functest tests'
- execution-type: SEQUENTIALLY
- projects:
- - name: 'functest-{installer}-{pod}-daily-healthcheck-{stream}'
- <<: *build-job-settings
- - name: 'functest-{installer}-{pod}-daily-smoke-{stream}'
- <<: *build-job-settings
- - name: 'functest-{installer}-{pod}-daily-patrole-{stream}'
- <<: *build-job-settings
- - name: 'functest-{installer}-{pod}-daily-vnf-{stream}'
- <<: *build-job-settings
- - name: 'functest-{installer}-{pod}-daily-features-doctor-notification-{stream}'
- <<: *features-job-settings
- - name: 'functest-{installer}-{pod}-daily-features-bgpvpn-{stream}'
- <<: *features-job-settings
- - name: 'functest-{installer}-{pod}-daily-features-functest-odl-sfc-{stream}'
- <<: *features-job-settings
- - name: 'functest-{installer}-{pod}-daily-features-barometercollectd-{stream}'
- <<: *features-job-settings
- - name: 'functest-{installer}-{pod}-daily-features-fds-{stream}'
- <<: *features-job-settings
- - name: 'functest-{installer}-{pod}-daily-features-promise-{stream}'
- <<: *features-job-settings
- - name: 'functest-{installer}-{pod}-daily-features-domino-multinode-{stream}'
- <<: *features-job-settings
- - name: 'functest-{installer}-{pod}-daily-parser-{stream}'
- <<: *build-job-settings
-
-- job-template: &functest-installer-tier-job
-
- name: 'functest-{installer}-{pod}-daily-{functest-tier}-{stream}'
+ name: 'functest-{installer}-{pod}-{testsuite}-{stream}'
concurrent: true
branch: '{branch}'
- '{installer}-defaults'
- '{slave-label}-defaults'
- - string:
- name: FUNCTEST_MODE
- default: 'tier'
- - string:
- name: FUNCTEST_TIER
- default: '{functest-tier}'
- - string:
- name: DEPLOY_SCENARIO
- default: 'os-nosdn-nofeature-noha'
- - string:
- name: CLEAN_DOCKER_IMAGES
- default: 'false'
- description: 'Remove downloaded docker images (opnfv/functest*:*)'
- - functest-parameter:
- gs-pathname: '{gs-pathname}'
-
- scm:
- - git-scm
-
- builders:
- - description-setter:
- description: "Built on $NODE_NAME"
- - 'functest-daily-builder'
-
- publishers:
- - 'functest-recipients'
- - 'fuel-recipients'
-
-- job-template:
-
- name: 'functest-{installer}-{pod}-suite-{stream}'
- <<: *functest-installer-tier-job
-
- wrappers:
- - build-name:
- name: '$BUILD_NUMBER Suite: $FUNCTEST_MODE Scenario: $DEPLOY_SCENARIO'
- - timeout:
- timeout: '60'
- abort: true
- parameters:
- - project-parameter:
- project: '{project}'
- branch: '{branch}'
- - '{installer}-defaults'
- - '{slave-label}-defaults'
- - 'functest-suite-parameter'
- - string:
- name: DEPLOY_SCENARIO
- default: 'os-nosdn-nofeature-noha'
- - string:
- name: CLEAN_DOCKER_IMAGES
- default: 'false'
- description: 'Remove downloaded docker images (opnfv/functest*:*)'
- - functest-parameter:
- gs-pathname: '{gs-pathname}'
-
- builders:
- - description-setter:
- description: "Built on $NODE_NAME"
- - 'functest-suite-builder'
-
-- job-template:
-
- name: 'functest-{installer}-{pod}-daily-features-{features-suite}-{stream}'
- concurrent: true
- properties:
- - logrotate-default
- - throttle:
- enabled: true
- max-per-node: 1
- option: 'project'
- wrappers:
- - build-name:
- name: '$BUILD_NUMBER Suite: $FUNCTEST_MODE Scenario: $DEPLOY_SCENARIO'
-
- parameters:
- - project-parameter:
- project: '{project}'
- branch: '{branch}'
- - '{installer}-defaults'
- - '{slave-label}-defaults'
- - string:
- name: FUNCTEST_MODE
- default: 'testcase'
- - string:
- name: FUNCTEST_SUITE_NAME
- default: '{features-suite}'
+ - 'functest-{testsuite}-parameter'
- string:
name: DEPLOY_SCENARIO
- default: 'os-nosdn-nofeature-noha'
+ default: 'os-odl_l2-nofeature-ha'
- string:
name: CLEAN_DOCKER_IMAGES
default: 'false'
builders:
- description-setter:
description: "Built on $NODE_NAME"
- - 'functest-daily-builder'
-
- publishers:
- - 'functest-features-recipients'
- - 'functest-recipients'
- - 'fuel-recipients'
+ - 'functest-{testsuite}-builder'
########################
default: 'daily'
description: "Daily suite name to run"
+- parameter:
+ name: functest-arm-daily-parameter
+ parameters:
+ - string:
+ name: FUNCTEST_MODE
+ default: 'arm-daily'
+ description: "Daily suite name (Aarch64) to run"
+
- parameter:
name: functest-suite-parameter
parameters:
- 'odl_netvirt'
- 'snaps_smoke'
- 'refstack_defcore'
- - 'patrole'
- 'promise'
- 'doctor'
- 'bgpvpn'
choices:
- 'healthcheck'
- 'smoke'
- - 'patrole'
- 'features'
- 'components'
- 'vnf'
- - 'parser'
default: 'healthcheck'
- string:
name: TESTCASE_OPTIONS
- 'functest-store-results'
- 'functest-exit'
+- builder:
+ name: functest-arm-daily-builder
+ builders:
+ - 'functest-cleanup'
+ - 'functest-arm-daily'
+ - 'functest-store-results'
+ - 'functest-exit'
+
- builder:
name: functest-suite-builder
builders:
- ../../utils/fetch_k8_conf.sh
- ./functest-k8.sh
+# yamllint enable rule:indentation
+- builder:
+ name: functest-arm-daily
+ builders:
+ # yamllint disable rule:indentation
+ - shell:
+ !include-raw:
+ - ./functest-env-presetup.sh
+ - ../../utils/fetch_os_creds.sh
+ - ./functest-alpine.sh
+
# yamllint enable rule:indentation
- builder:
name: functest-store-results
builders:
- shell:
!include-raw: ./functest-exit.sh
-
-
-- publisher:
- name: 'functest-features-recipients'
- publishers:
- - email:
- recipients:
-
-- publisher:
- name: 'functest-recipients'
- publishers:
- - email:
- recipients: >
- jalausuch@suse.com morgan.richomme@orange.com
- cedric.ollivier@orange.com feng.xiaowei@zte.com.cn
- juha.kosonen@nokia.com wangwulin@huawei.com
- delia.popescu@enea.com cristina.pauna@enea.com
- valentin.boucher@kontron.com
- - email-jenkins-admins-on-failure
-
-- publisher:
- name: 'fuel-recipients'
- publishers:
- - email:
- recipients: >
- peter.barabas@ericsson.com mpolenchuck@mirantis.com
- alexandru.avadanii@enea.com guillermo.herrero@enea.com
- 'features'
- 'components'
- 'parser'
- - 'patrole'
- 'smoke'
- 'vnf'
- 'restapi'
disabled: '{obj:disabled}'
parameters:
- - job-parameters:
+ - functest-job-parameters:
project: '{project}'
branch: '{branch}'
slave_label: 'opnfv-build-ubuntu'
<<: *build-job-settings
- name: 'functest-parser-docker-build-arm64-{stream}'
<<: *build-job-settings
- - name: 'functest-patrole-docker-build-amd64-{stream}'
- <<: *build-job-settings
- - name: 'functest-patrole-docker-build-arm64-{stream}'
- <<: *build-job-settings
- name: 'functest-smoke-docker-build-amd64-{stream}'
<<: *build-job-settings
- name: 'functest-smoke-docker-build-arm64-{stream}'
<<: *manifest-job-settings
- name: 'functest-parser-docker-manifest-{stream}'
<<: *manifest-job-settings
- - name: 'functest-patrole-docker-manifest-{stream}'
- <<: *manifest-job-settings
- name: 'functest-smoke-docker-manifest-{stream}'
<<: *manifest-job-settings
- name: 'functest-vnf-docker-manifest-{stream}'
name: 'functest-{image}-docker-build-{arch_tag}-{stream}'
disabled: '{obj:disabled}'
parameters:
- - job-parameters:
+ - functest-job-parameters:
project: '{project}'
branch: '{branch}'
slave_label: '{slave_label}'
# parameter macro
- parameter:
- name: job-parameters
+ name: functest-job-parameters
parameters:
- project-parameter:
project: '{project}'
jalausuch@suse.com morgan.richomme@orange.com
cedric.ollivier@orange.com feng.xiaowei@zte.com.cn
juha.kosonen@nokia.com wangwulin@huawei.com
+ valentin.boucher@kontron.com
--- /dev/null
+---
+##############################################
+# job configuration for docker build and push
+##############################################
+- project:
+
+ name: xtesting-docker
+
+ project: functest-xtesting
+
+ stream:
+ - master:
+ branch: '{stream}'
+ disabled: false
+
+ arch_tag:
+ - 'amd64':
+ slave_label: 'opnfv-build-ubuntu'
+ - 'arm64':
+ slave_label: 'opnfv-build-ubuntu-arm'
+
+ # settings for jobs run in multijob phases
+ build-job-settings: &build-job-settings
+ current-parameters: false
+ git-revision: true
+ node-parameters: false
+ predefined-parameters: |
+ PUSH_IMAGE=$PUSH_IMAGE
+ COMMIT_ID=$COMMIT_ID
+ GERRIT_REFNAME=$GERRIT_REFNAME
+ DOCKERFILE=$DOCKERFILE
+ kill-phase-on: FAILURE
+ abort-all-jobs: false
+
+ manifest-job-settings: &manifest-job-settings
+ current-parameters: false
+ git-revision: true
+ node-parameters: false
+ predefined-parameters:
+ GERRIT_REFNAME=$GERRIT_REFNAME
+ kill-phase-on: FAILURE
+ abort-all-jobs: false
+
+ # yamllint enable rule:key-duplicates
+ jobs:
+ - "xtesting-docker-{stream}"
+ - "xtesting-docker-build-{arch_tag}-{stream}"
+ - "xtesting-docker-manifest-{stream}"
+
+########################
+# job templates
+########################
+- job-template:
+ name: 'xtesting-docker-{stream}'
+
+ project-type: multijob
+
+ disabled: '{obj:disabled}'
+
+ parameters:
+ - xtesting-job-parameters:
+ project: '{project}'
+ branch: '{branch}'
+ slave_label: 'opnfv-build-ubuntu'
+ arch_tag: 'amd64'
+
+ properties:
+ - throttle:
+ max-per-node: 1
+ option: 'project'
+
+ scm:
+ - git-scm
+
+ triggers:
+ - pollscm:
+ cron: "*/30 * * * *"
+ - gerrit-trigger-tag-created:
+ project: '{project}'
+
+ builders:
+ - multijob:
+ name: 'build xtesting images'
+ execution-type: PARALLEL
+ projects:
+ - name: 'xtesting-docker-build-amd64-{stream}'
+ <<: *build-job-settings
+ - name: 'xtesting-docker-build-arm64-{stream}'
+ <<: *build-job-settings
+ - multijob:
+ name: 'publish xtesting manifests'
+ execution-type: PARALLEL
+ projects:
+ - name: 'xtesting-docker-manifest-{stream}'
+ <<: *manifest-job-settings
+
+ publishers:
+ - 'xtesting-amd64-recipients'
+ - 'xtesting-arm64-recipients'
+
+- job-template:
+ name: 'xtesting-docker-build-{arch_tag}-{stream}'
+ disabled: '{obj:disabled}'
+ parameters:
+ - xtesting-job-parameters:
+ project: '{project}'
+ branch: '{branch}'
+ slave_label: '{slave_label}'
+ arch_tag: '{arch_tag}'
+ scm:
+ - git-scm
+ builders:
+ - shell: |
+ #!/bin/bash -ex
+ sudo arch={arch_tag} bash ./build.sh
+ exit $?
+
+- job-template:
+ name: 'xtesting-docker-manifest-{stream}'
+
+ parameters:
+ - project-parameter:
+ project: '{project}'
+ branch: '{branch}'
+ - label:
+ name: SLAVE_LABEL
+ default: 'opnfv-build-ubuntu'
+ description: 'Slave label on Jenkins'
+ - string:
+ name: PROJECT
+ default: "{project}"
+ description: "Project name used to enable job conditions"
+ - string:
+ name: GIT_BASE
+ default: https://gerrit.opnfv.org/gerrit/$PROJECT
+ description: 'Git URL to use on this Jenkins Slave'
+ - string:
+ name: REPO
+ default: "opnfv"
+ description: "Repository name for functest images"
+
+
+ disabled: '{obj:disabled}'
+
+ builders:
+ - shell: |
+ #!/bin/bash -ex
+ case "{stream}" in
+ "master")
+ tag="latest" ;;
+ *)
+ tag="{stream}" ;;
+ esac
+ sudo manifest-tool push from-args \
+ --platforms linux/amd64,linux/arm64 \
+ --template $REPO/xtesting:ARCH-$tag \
+ --target $REPO/xtesting:$tag
+ exit $?
+
+- parameter:
+ name: xtesting-job-parameters
+ parameters:
+ - project-parameter:
+ project: '{project}'
+ branch: '{branch}'
+ - label:
+ name: SLAVE_LABEL
+ default: '{slave_label}'
+ description: 'Slave label on Jenkins'
+ - string:
+ name: GIT_BASE
+ default: https://gerrit.opnfv.org/gerrit/$PROJECT
+ description: 'Git URL to use on this Jenkins Slave'
+ - string:
+ name: PUSH_IMAGE
+ default: "true"
+ description: "To enable/disable pushing the image to Dockerhub."
+ - string:
+ name: COMMIT_ID
+ default: ""
+ description: "commit id to make a snapshot docker image"
+ - string:
+ name: GERRIT_REFNAME
+ default: ""
+ 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"
+ description: "Dockerfile to use for creating the image."
+ - string:
+ name: ARCH_TAG
+ default: "{arch_tag}"
+ description: "If set, this value will be added to the docker image tag as a prefix"
+ - string:
+ name: PROJECT
+ default: "{project}"
+ description: "Project name used to enable job conditions"
+ - string:
+ name: REPO
+ default: "opnfv"
+ description: "Repository name for functest images"
+
+# publisher macros
+- publisher:
+ name: 'xtesting-arm64-recipients'
+ publishers:
+ - email:
+ recipients: >
+ cristina.pauna@enea.com
+ alexandru.avadanii@enea.com
+ delia.popescu@enea.com
+
+- publisher:
+ name: 'xtesting-amd64-recipients'
+ publishers:
+ - email:
+ recipients: >
+ jalausuch@suse.com morgan.richomme@orange.com
+ cedric.ollivier@orange.com feng.xiaowei@zte.com.cn
+ juha.kosonen@nokia.com wangwulin@huawei.com
+ valentin.boucher@kontron.com
name: GERRIT_REFSPEC
default: 'refs/heads/{branch}'
description: "Default refspec needed for manually triggering."
+
+- parameter:
+ name: testapi-parameter
+ parameters:
- string:
name: TESTAPI_URL
default: 'http://testresults.opnfv.org/test/api/v1'
description: "Default TestAPI URL, currently using v1"
+ - string:
+ name: DEPLOY_SCENARIO
+ default: 'os-nosdn-nofeature-ha'
+ description: "OPNFV deployment scenario"
+ - string:
+ name: INSTALLER_VERSION
+ default: 'master'
+ description: "Installer release version"
+ - string:
+ name: UPSTREAM_JOB_NAME
+ default: ''
+ description: "Parent job name in Jenkins"
+ - string:
+ name: UPSTREAM_BUILD_ID
+ default: ''
+ description: "Parent job build_id in Jenkins"
- property:
name: logrotate-default
- shell: |
echo "export PROVISION_RESULT=PASS" >> $WORKSPACE/installer_track.sh
echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
- echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
+ echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
- shell:
!include-raw: installer-report.sh
- postbuildscript:
- shell: |
echo "export PROVISION_RESULT=FAIL" >> $WORKSPACE/installer_track.sh
echo "export INSTALLER=$INSTALLER_TYPE" >> $WORKSPACE/installer_track.sh
- echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' > $WORKSPACE/installer_track.sh
+ echo "export TIMESTAMP_END="\'`date '+%Y-%m-%d %H:%M:%S.%3N'`\' >> $WORKSPACE/installer_track.sh
- shell:
!include-raw: installer-report.sh
- 'doctor-fuel-x86_64'
- 'doctor-fuel-aarch64'
- 'doctor-joid-x86_64'
+ - 'doctor-daisy-x86_64'
- 'not-specified'
default-slaves:
- 'not-specified'
dockerfile: 'docker/Dockerfile.local'
<<: *master
<<: *other-receivers
+ - 'qtip-nettest':
+ project: 'qtip'
+ dockerdir: 'contrib/nettest'
+ <<: *master
+ <<: *other-receivers
- 'storperf-master':
project: 'storperf'
dockerdir: 'docker/storperf-master'
project: 'yardstick'
<<: *euphrates
<<: *other-receivers
- - 'xtesting':
- project: 'functest-xtesting'
- <<: *master
- <<: *other-receivers
# projects with jobs for danube
- 'dovetail':
project: 'dovetail'
recipients: fatih.degirmenci@ericsson.com yroblamo@redhat.com mchandras@suse.de jack.morgan@intel.com julienjut@gmail.com
# yamllint enable rule:line-length
- email-jenkins-admins-on-failure
+ - postbuildscript:
+ script-only-if-succeeded: false
+ script-only-if-failed: false
+ builders:
+ - shell:
+ !include-raw: ./xci-cleanup.sh
+
# -------------------------------
# trigger macros
# -------------------------------
# what you are doing.
#----------------------------------------------------------------------
+# Need to cover macros with and without parameters
+VM_NAME=$DISTRO
+VM_NAME+=_xci_vm
+
# 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 || true
-sudo virsh undefine ${DISTRO}_xci_vm || true
+sudo virsh destroy $VM_NAME || true
+sudo virsh undefine $VM_NAME || true
recipients: fatih.degirmenci@ericsson.com yroblamo@redhat.com mchandras@suse.de jack.morgan@intel.com julienjut@gmail.com
# yamllint enable rule:line-length
- email-jenkins-admins-on-failure
+ - postbuildscript:
+ script-only-if-succeeded: false
+ script-only-if-failed: false
+ builders:
+ - shell:
+ !include-raw: ./xci-cleanup.sh
- job-template:
name: 'xci-{phase}-{pod}-{distro}-daily-{stream}'
kill-phase-on: NEVER
abort-all-job: true
+ publishers:
+ - postbuildscript:
+ script-only-if-succeeded: false
+ script-only-if-failed: false
+ builders:
+ - shell:
+ !include-raw: ./xci-cleanup.sh
+
- job-template:
name: 'xci-{phase}-{type}-{distro}-merge-{stream}'
builders:
- shell:
!include-raw: ./xci-run-functest.sh
- - shell:
- !include-raw: ./xci-cleanup.sh
- builder:
name: 'xci-merge-promote-macro'
# what you are doing.
#----------------------------------------------------------------------
+# ensure GERRIT_TOPIC is set
+GERRIT_TOPIC="${GERRIT_TOPIC:-''}"
+
# skip the healthcheck if the patch doesn't impact the deployment
if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then
echo "Skipping the healthcheck!"
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+set -o errexit
+set -o nounset
+set -o pipefail
#----------------------------------------------------------------------
# This script is used by CI and executed by Jenkins jobs.
# what you are doing.
#----------------------------------------------------------------------
+# ensure GERRIT_TOPIC is set
+GERRIT_TOPIC="${GERRIT_TOPIC:-''}"
+
# 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 healthcheck if the scenario is Kubernetes scenario
+if [[ "$DEPLOY_SCENARIO" =~ k8 ]]; then
+ echo "Skipping the healthcheck!"
+ exit 0
+fi
+
# if the scenario is external, we need to wipe WORKSPACE to place releng-xci there since
# the project where the scenario is coming from is cloned and the patch checked out to the
# xci/scenarios/$DEPLOY_SCENARIO to be synched on clean VM
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
set -o errexit
-set -o nounset
set -o pipefail
#----------------------------------------------------------------------
# what you are doing.
#----------------------------------------------------------------------
-WORK_DIRECTORY=/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO
-/bin/rm -rf $WORK_DIRECTORY && mkdir -p $WORK_DIRECTORY
+# This function allows developers to specify the impacted scenario by adding
+# the info about installer and scenario into the commit message or using
+# the topic branch names. This results in either skipping the real verification
+# totally or skipping the determining the installer and scenario programmatically.
+# It is important to note that this feature is only available to generic scenarios
+# and only single installer/scenario pair is allowed.
+# The input in commit message should be placed at the end of the commit message body,
+# before the signed-off and change-id lines.
+#
+# Pattern to be searched in Commit Message
+# deploy-scenario:<scenario-name>
+# installer-type:<installer-type>
+# Examples:
+# deploy-scenario:os-odl-nofeature
+# installer-type:osa
+#
+# deploy-scenario:k8-nosdn-nofeature
+# installer-type:kubespray
+#
+# Patterns to be searched in topic branch name
+# skip-verify
+# skip-deployment
+# force-verify
+function override_generic_scenario() {
+ echo "Processing $GERRIT_PROJECT patchset $GERRIT_REFSPEC"
-# ensure GERRIT_TOPIC is set
-GERRIT_TOPIC="${GERRIT_TOPIC:-''}"
+ # process topic branch names
+ if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then
+ # skip the real verification
+ echo "Skipping verify!"
+ echo "INSTALLER_TYPE=osa" > $WORK_DIRECTORY/scenario.properties
+ echo "DEPLOY_SCENARIO=os-nosdn-nofeature" >> $WORK_DIRECTORY/scenario.properties
+ exit 0
+ elif [[ "$GERRIT_TOPIC" =~ 'force-verify' ]]; then
+ # Run the deployment with default installer and scenario when multiple things change
+ # and we want to force that.
+ echo "Recording the installer 'osa' and scenario 'os-nosdn-nofeature' for downstream jobs"
+ echo "Forcing CI verification of default scenario and installer!"
+ echo "INSTALLER_TYPE=osa" > $WORK_DIRECTORY/scenario.properties
+ echo "DEPLOY_SCENARIO=os-nosdn-nofeature" >> $WORK_DIRECTORY/scenario.properties
+ exit 0
+ fi
-# skip the healthcheck if the patch doesn't impact the deployment
-if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then
- echo "Skipping verify!"
- echo "DEPLOY_SCENARIO=os-nosdn-nofeature" > $WORK_DIRECTORY/scenario.properties
- exit 0
-fi
+ # process commit message
+ if [[ "$GERRIT_CHANGE_COMMIT_MESSAGE" =~ "installer-type:" && "$GERRIT_CHANGE_COMMIT_MESSAGE" =~ "deploy-scenario:" ]]; then
+ INSTALLER_TYPE=$(echo $GERRIT_CHANGE_COMMIT_MESSAGE | awk '/installer-type:/' RS=" " | cut -d":" -f2)
+ DEPLOY_SCENARIO=$(echo $GERRIT_CHANGE_COMMIT_MESSAGE | awk '/deploy-scenario:/' RS=" " | cut -d":" -f2)
+
+ if [[ -z "$INSTALLER_TYPE" || -z "$DEPLOY_SCENARIO" ]]; then
+ echo "Installer type or deploy scenario is not specified. Falling back to programmatically determining them."
+ else
+ echo "Recording the installer '$INSTALLER_TYPE' and scenario '$DEPLOY_SCENARIO' for downstream jobs"
+ echo "INSTALLER_TYPE=$INSTALLER_TYPE" > $WORK_DIRECTORY/scenario.properties
+ echo "DEPLOY_SCENARIO=$DEPLOY_SCENARIO" >> $WORK_DIRECTORY/scenario.properties
+ exit 0
+ fi
+ else
+ echo "Installer type or deploy scenario is not specified. Falling back to programmatically determining them."
+ fi
+}
-# if the scenario is external, we need to wipe WORKSPACE to place releng-xci there since
-# the project where the scenario is coming from is cloned and the patch checked out to the
-# xci/scenarios/$DEPLOY_SCENARIO to be synched on clean VM
-# apart from that, we need releng-xci stuff in WORKSPACE for things to function correctly on Jenkins.
-# if the change is coming to releng-xci, we don't need to do anything since the patch is checked
-# out to the WORKSPACE anyways
-if [[ $GERRIT_PROJECT != "releng-xci" ]]; then
+# This function determines the impacted generic scenario by processing the
+# change and using diff to see what changed. If changed files belong to a scenario
+# its name gets recorded for deploying and testing the right scenario.
+#
+# Pattern to be searched in Changeset
+# releng-xci/scenarios/<scenario>/<impacted files>: <scenario>
+# releng-xci/xci/installer/osa/<impacted files>: os-nosdn-nofeature
+# releng-xci/xci/installer/kubespray/<impacted files>: k8-nosdn-nofeature
+# the rest: os-nosdn-nofeature
+function determine_generic_scenario() {
+ echo "Processing $GERRIT_PROJECT patchset $GERRIT_REFSPEC"
+
+ # get the changeset
+ cd $WORKSPACE
+ CHANGESET=$(git diff HEAD^..HEAD --name-only)
+ for CHANGED_FILE in $CHANGESET; do
+ case $CHANGED_FILE in
+ *k8-nosdn*|*kubespray*)
+ [[ ${DEPLOY_SCENARIO[@]} =~ "k8-nosdn-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='k8-nosdn-nofeature'
+ ;;
+ *os-odl*)
+ [[ ${DEPLOY_SCENARIO[@]} =~ "os-odl-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-odl-nofeature'
+ ;;
+ *os-nosdn*|*osa*)
+ [[ ${DEPLOY_SCENARIO[@]} =~ "os-nosdn-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-nosdn-nofeature'
+ ;;
+ *)
+ [[ ${DEPLOY_SCENARIO[@]} =~ "os-nosdn-nofeature" ]] || DEPLOY_SCENARIO[${#DEPLOY_SCENARIO[@]}]='os-nosdn-nofeature'
+ ;;
+ esac
+ done
+}
+
+# This function determines the impacted external scenario by processing the Gerrit
+# change and using diff to see what changed. If changed files belong to a scenario
+# its name gets recorded for deploying and testing the right scenario.
+#
+# Pattern
+# <project-repo>/scenarios/<scenario>/<impacted files>: <scenario>
+function determine_external_scenario() {
+ echo "Processing $GERRIT_PROJECT patchset $GERRIT_REFSPEC"
+
+ # remove the clone that is done via jenkins and place releng-xci there so the
+ # things continue functioning properly
cd $HOME && /bin/rm -rf $WORKSPACE
- git clone https://gerrit.opnfv.org/gerrit/releng-xci $WORKSPACE && cd $WORKSPACE
+ git clone -q https://gerrit.opnfv.org/gerrit/releng-xci $WORKSPACE && cd $WORKSPACE
+
+ # fix the permissions so ssh doesn't complain due to having world-readable keyfiles
chmod -R go-rwx $WORKSPACE/xci/scripts/vm
-fi
-# if change is coming to releng-xci, continue as usual until that part is fixed as well
-if [[ $GERRIT_PROJECT == "releng-xci" ]]; then
- # save the scenario name into java properties file to be injected to downstream jobs via envInject
- echo "Recording scenario name for downstream jobs"
- echo "DEPLOY_SCENARIO=os-nosdn-nofeature" > $WORK_DIRECTORY/scenario.properties
- exit 0
-fi
+ # clone the project repo and fetch the patchset to process for further processing
+ git clone -q https://gerrit.opnfv.org/gerrit/$GERRIT_PROJECT $WORK_DIRECTORY/$GERRIT_PROJECT
+ cd $WORK_DIRECTORY/$GERRIT_PROJECT
+ git fetch -q https://gerrit.opnfv.org/gerrit/$GERRIT_PROJECT $GERRIT_REFSPEC && git checkout -q FETCH_HEAD
-# projects develop different scenarios and jobs need to know which scenario got the
-# change under test so the jobs can deploy and test the right scenario.
-# we need to fetch the change and look at the changeset to find out the scenario instead
-# of hardcoding scenario per project.
+ # process the diff to find out what scenario(s) are impacted - there should only be 1
+ DEPLOY_SCENARIO+=$(git diff HEAD^..HEAD --name-only | grep scenarios | awk -F '[/|/]' '{print $2}' | uniq)
+}
-git clone https://gerrit.opnfv.org/gerrit/$GERRIT_PROJECT $WORK_DIRECTORY/$GERRIT_PROJECT
-cd $WORK_DIRECTORY/$GERRIT_PROJECT
-git fetch https://gerrit.opnfv.org/gerrit/$GERRIT_PROJECT $GERRIT_REFSPEC && git checkout FETCH_HEAD
-DEPLOY_SCENARIO=$(git diff HEAD^..HEAD --name-only | grep scenarios | awk -F '[/|/]' '{print $2}' | uniq)
+echo "Determining the impacted scenario"
+
+declare -a DEPLOY_SCENARIO
+
+# ensure GERRIT_TOPIC is set
+GERRIT_TOPIC="${GERRIT_TOPIC:-''}"
+
+# this directory is where the temporary clones and files are created
+# while extracting the impacted scenario
+WORK_DIRECTORY=/tmp/$GERRIT_CHANGE_NUMBER/$DISTRO
+/bin/rm -rf $WORK_DIRECTORY && mkdir -p $WORK_DIRECTORY
+
+if [[ $GERRIT_PROJECT == "releng-xci" ]]; then
+ override_generic_scenario
+ determine_generic_scenario
+else
+ determine_external_scenario
+fi
# ensure single scenario is impacted
-if [[ $(echo $DEPLOY_SCENARIO | wc -w) != 1 ]]; then
+ if [[ $(IFS=$'\n' echo ${DEPLOY_SCENARIO[@]} | wc -w) != 1 ]]; then
echo "Change impacts multiple scenarios!"
echo "XCI doesn't support testing of changes that impact multiple scenarios currently."
echo "Please split your change into multiple different/dependent changes, each modifying single scenario."
exit 1
fi
-# save the scenario name into java properties file to be injected to downstream jobs via envInject
-echo "Recording scenario name '$DEPLOY_SCENARIO' for downstream jobs"
-echo "DEPLOY_SCENARIO=$DEPLOY_SCENARIO" > $WORK_DIRECTORY/scenario.properties
+# set the installer
+case ${DEPLOY_SCENARIO[0]} in
+ os-*)
+ INSTALLER_TYPE=osa
+ ;;
+ k8-*)
+ INSTALLER_TYPE=kubespray
+ ;;
+ *)
+ echo "Unable to determine the installer. Exiting!"
+ exit 1
+ ;;
+esac
+
+# save the installer and scenario names into java properties file
+# so they can be injected to downstream jobs via envInject
+echo "Recording the installer '$INSTALLER_TYPE' and scenario '${DEPLOY_SCENARIO[0]}' for downstream jobs"
+echo "INSTALLER_TYPE=$INSTALLER_TYPE" > $WORK_DIRECTORY/scenario.properties
+echo "DEPLOY_SCENARIO=$DEPLOY_SCENARIO" >> $WORK_DIRECTORY/scenario.properties
# 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"
+if ! sed -n "/^- scenario: ${DEPLOY_SCENARIO[0]}$/,/^$/p" $OPNFV_SCENARIO_REQUIREMENTS | grep -q $DISTRO; then
+ echo "# SKIPPED: Scenario ${DEPLOY_SCENARIO[0]} is NOT supported on $DISTRO"
exit 0
fi
# what you are doing.
#----------------------------------------------------------------------
+# ensure GERRIT_TOPIC is set
+GERRIT_TOPIC="${GERRIT_TOPIC:-''}"
+
# skip the deployment if the patch doesn't impact the deployment
if [[ "$GERRIT_TOPIC" =~ skip-verify|skip-deployment ]]; then
echo "Skipping the deployment!"
# what you are doing.
#----------------------------------------------------------------------
+# ensure GERRIT_TOPIC is set
+GERRIT_TOPIC="${GERRIT_TOPIC:-''}"
+
# skip the deployment if the patch doesn't impact the deployment
if [[ "$GERRIT_TOPIC" =~ 'skip-verify' ]]; then
echo "Skipping the deployment!"
kill-phase-on: NEVER
abort-all-job: true
+ publishers:
+ - postbuildscript:
+ script-only-if-succeeded: false
+ script-only-if-failed: false
+ builders:
+ - shell:
+ !include-raw: ./xci-cleanup.sh
+
+
- job-template:
name: 'xci-verify-{distro}-{phase}-{type}-{stream}'
- 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
builders:
- shell:
!include-raw: ./xci-run-functest.sh
- - shell:
- !include-raw: ./xci-cleanup.sh