murano-deployment/murano-ci/jenkins/jobs/macros.yaml

359 lines
11 KiB
YAML
Executable File

- publisher:
name: collect-report
publishers:
- postbuildscript:
builders:
- shell: |
#!/bin/bash
# Include of the common functions library file
export SKIP_INIT=yes
source "${WORKSPACE}/murano-ci/scripts/common.inc"
#-----------------
pushd "${STACK_HOME}/devstack"
set +o xtrace
echo "Importing openrc ..."
source openrc "${ADMIN_USERNAME}" "${ADMIN_TENANT}"
set -o xtrace
popd
source "${WORKSPACE}/murano-ci/scripts/collect_results.sh"
source "${WORKSPACE}/murano-ci/scripts/collect_logs.sh"
# Cleaning up resources
sudo pkill murano || true
# wait till murano processes gracefully shutdown
while pgrep -f murano-api || pgrep -f murano-engine ; do
sleep 10
done
# cleanup stacks
ensure_no_heat_stacks_left
onsuccess: false
onfailure: false
script-only-if-succeeded: false
script-only-if-failed: false
- publisher:
name: collect-gate-artifacts
publishers:
- scp:
site: 'localhost'
files:
- target: 'logs/$LOG_PATH/'
source: 'artifacts/**'
copy-console: false
keep-hierarchy: true
copy-after-failure: true
- target: 'logs/$LOG_PATH/'
source: 'index.html'
copy-console: false
copy-after-failure: true
- target: 'logs/$LOG_PATH/'
source: ''
copy-console: true
copy-after-failure: true
- publisher:
name: collect-heartbeat-artifacts
publishers:
- scp:
site: 'localhost'
files:
- target: 'logs/heartbeat/$JOB_NAME/$BUILD_NUMBER/'
source: 'artifacts/**'
copy-console: false
keep-hierarchy: true
copy-after-failure: true
- target: 'logs/heartbeat/$JOB_NAME/$BUILD_NUMBER/'
source: 'index.html'
copy-console: false
copy-after-failure: true
- target: 'logs/heartbeat/$JOB_NAME/$BUILD_NUMBER/'
source: ''
copy-console: true
copy-after-failure: true
- publisher:
name: collect-coverage-artifacts
publishers:
- scp:
site: 'localhost'
files:
- target: 'logs/coverage/$JOB_NAME/$BUILD_NUMBER/'
source: 'artifacts/**'
copy-console: false
keep-hierarchy: true
copy-after-failure: true
- target: 'logs/coverage/$JOB_NAME/$BUILD_NUMBER/'
source: 'index.html'
copy-console: false
copy-after-failure: true
- target: 'logs/coverage/$JOB_NAME/$BUILD_NUMBER/'
source: ''
copy-console: true
copy-after-failure: true
- publisher:
name: archive-artifacts
publishers:
- archive:
artifacts: 'artifacts/**'
allow-empty: 'true'
- builder:
name: gerrit-git-prep
builders:
- shell: "/usr/local/jenkins/slave_scripts/gerrit-git-prep.sh https://review.openstack.org https://review.openstack.org"
- builder:
name: coverage
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-cover.sh {github-org} {project}"
- builder:
name: docs
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-docs.sh {github-org} {project}"
- builder:
name: bash8
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-bash8.sh {github-org} {project}"
- builder:
name: pep8
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-pep8.sh {github-org} {project}"
- builder:
name: pylint
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-pylint.sh {github-org} {project}"
- builder:
name: run-tests
builders:
- shell: "./run-tests.sh {github-org} {project}"
- builder:
name: selenium
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-selenium.sh {github-org} {project}"
- builder:
name: python26
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-unittests.sh 26 {github-org} {project}"
- builder:
name: python27
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-unittests.sh 27 {github-org} {project}"
- builder:
name: python33
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-unittests.sh 33 {github-org} {project}"
- builder:
name: pypy
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-unittests.sh py {github-org} {project}"
- builder:
name: tox
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-tox.sh {envlist} {github-org} {project}"
- builder:
name: assert-no-extra-files
builders:
- shell: |
#!/bin/bash
OUT=`git ls-files --other --exclude-standard --directory`
if [ -z "$OUT" ]; then
echo "No extra files created during test."
exit 0
else
echo "The following un-ignored files were created during the test:"
echo "$OUT"
exit 0 # TODO: change to 1 to fail tests.
fi
- builder:
name: tarball
builders:
- shell: "/usr/local/jenkins/slave_scripts/run-tarball.sh {github-org} {project}"
- builder:
name: devstack-checkout
builders:
- shell: |
#!/bin/bash -xe
if [[ ! -e devstack-gate ]]; then
git clone git://git.openstack.org/openstack-infra/devstack-gate
else
cd devstack-gate
git remote set-url origin git://git.openstack.org/openstack-infra/devstack-gate
git remote update
git reset --hard
if ! git clean -x -f ; then
sleep 1
git clean -x -f
fi
git checkout master
git reset --hard remotes/origin/master
if ! git clean -x -f ; then
sleep 1
git clean -x -f
fi
cd ..
fi
- builder:
name: experimental-devstack-checkout
builders:
- shell: |
#!/bin/bash -xe
if [[ ! -e devstack-gate ]]; then
git clone git://git.openstack.org/openstack-infra/devstack-gate
fi
cd devstack-gate
/usr/local/jenkins/slave_scripts/gerrit-git-prep.sh https://review.openstack.org http://zuul.openstack.org git://git.openstack.org
cd ..
- builder:
name: link-logs
builders:
- shell: |
#!/bin/sh
if test "$LOG_PATH" ; then
echo "Detailed logs: http://logs.openstack.org/$LOG_PATH/"
else
echo "Detailed logs: http://logs.openstack.org/periodic/$JOB_NAME/$NODE_NAME/$BUILD_NUMBER/"
fi
- builder:
name: update-pypi-mirror
builders:
- shell: |
#!/bin/bash -xe
/usr/local/bin/run-mirror -c /home/jenkins/pypimirror/etc/pypi-mirror.yaml
find /home/jenkins/pypimirror/mirror/ \( -name index.html -or -name full.html \) -delete
rsync -a --ignore-existing --itemize-changes /home/jenkins/pypimirror/mirror/ jenkins@static.openstack.org:/srv/static/pypi/
# ======================================================================
- publisher:
name: tarball
publishers:
- archive:
artifacts: 'dist/*.tar.gz'
- scp:
site: '{site}'
files:
- target: 'tarballs/{project}/'
source: 'dist/*.tar.gz'
- publisher:
name: console-log
publishers:
- scp:
site: 'localhost'
files:
- target: 'logs/$LOG_PATH'
copy-console: true
copy-after-failure: true
- publisher:
name: console-log-periodic
publishers:
- scp:
site: 'localhost'
files:
- target: 'logs/periodic/$JOB_NAME/$NODE_NAME/$BUILD_NUMBER'
copy-console: true
copy-after-failure: true
- publisher:
name: devstack-logs
publishers:
- scp:
site: 'localhost'
files:
- target: 'logs/$LOG_PATH'
source: 'logs/**'
keep-hierarchy: true
copy-after-failure: true
- target: 'logs/$LOG_PATH'
source: '**/testr_results.html.gz'
keep-hierarchy: false
copy-after-failure: true
- target: 'logs/$LOG_PATH'
source: '**/subunit_log.txt.gz'
keep-hierarchy: false
copy-after-failure: true
- publisher:
name: devstack-logs-periodic
publishers:
- scp:
site: 'localhost'
files:
- target: 'logs/periodic/$JOB_NAME/$NODE_NAME/$BUILD_NUMBER'
source: 'logs/**'
keep-hierarchy: true
copy-after-failure: true
- target: 'logs/periodic/$JOB_NAME/$NODE_NAME/$BUILD_NUMBER'
source: '**/testr_results.html.gz'
keep-hierarchy: false
copy-after-failure: true
- target: 'logs/periodic/$JOB_NAME/$NODE_NAME/$BUILD_NUMBER'
source: '**/subunit_log.txt.gz'
keep-hierarchy: false
copy-after-failure: true
- publisher:
name: coverage-log
publishers:
- scp:
site: 'localhost'
files:
- target: 'logs/$LOG_PATH'
source: 'cover/**'
keep-hierarchy: true
copy-after-failure: true
- publisher:
name: test-results
publishers:
- scp:
site: 'localhost'
files:
- target: 'logs/$LOG_PATH'
source: '**/*nose_results.html'
keep-hierarchy: false
copy-after-failure: true
- target: 'logs/$LOG_PATH'
source: '**/*testr_results.html.gz'
keep-hierarchy: false
copy-after-failure: true
- target: 'logs/$LOG_PATH'
source: '.testrepository/tmp*'
keep-hierarchy: false
copy-after-failure: true
- target: 'logs/$LOG_PATH'
source: '**/*subunit_log.txt.gz'
keep-hierarchy: false
copy-after-failure: true
- publisher:
name: email-on-unstable-build
publishers:
- email:
recipients: mkarpin@mirantis.com nstarodubtsev@mirantis.com
notify-every-unstable-build: true
send-to-individuals: false