project-config/jenkins/jobs/ansible-role-jobs.yaml
Major Hayden 5fd623e1c3
Enable minimum CentOS repositories
The CentOS CI images have many yum repositories enabled by default.
This can cause package conflicts in gate jobs and it doesn't match
what a basic CentOS system would look like for an OpenStack-Ansible
deployer.

This patch disables all repositories for the ansible-role-jobs and
only enables base, epel, and updates. This allows individual roles
to add extra repositories when they need them.

Related-Bug: 1708493
Change-Id: I2ac5a9c463991e4668a3e7608831c1944377e85e
2017-08-03 12:07:55 -05:00

180 lines
5.4 KiB
YAML

- job-template:
name: 'gate-{name}-ansible-lint'
node: ubuntu-trusty
builders:
- zuul-git-prep
- install-distro-packages
- ansible-prep
- ansible-lint-prep
- revoke-sudo
- ansible-syntax
- ansible-lint
publishers:
- console-log
- job-group:
# TODO(pabelanger): Remove in favor of ansible-role-jobs
name: 'ansible-lint-jobs'
jobs:
- 'gate-{name}-ansible-lint'
- job-template:
name: '{pipeline}-{name}-dsvm-ansible-func-{ostype}{suffix}'
node: '{ostype}'
wrappers:
- build-timeout:
timeout: 100
- timestamps
builders:
- print-template-name:
template-name: "{template-name}"
- zuul-git-prep
- devstack-checkout
- shell: |
# Allow Jenkins user to ssh into localhost
ssh-keygen -f ~/.ssh/id_rsa -N ""
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh-keyscan localhost >> ~/.ssh/known_hosts
ssh-keyscan 127.0.0.1 >> ~/.ssh/known_hosts
- shell: |
#!/bin/bash -xe
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_NEUTRON=1
export PROJECTS="$ZUUL_PROJECT $PROJECTS"
export BRANCH_OVERRIDE={branch-override}
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
fi
function post_test_hook {{
$BASE/new/{name}/tests/hooks/post_test_hook.sh
}}
export -f post_test_hook
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
./safe-devstack-vm-gate-wrap.sh
publishers:
- devstack-logs
- console-log
- job-template:
name: '{pipeline}-{name}-ansible-{scenario}-{ostype}{suffix}'
node: '{ostype}'
wrappers:
- build-timeout:
timeout: 60
- timestamps
builders:
- print-template-name:
template-name: "{template-name}"
- zuul-git-prep-upper-constraints
- shell: |
# NOTE(mhayden): The CentOS CI image has many repositories enabled by
# default that can cause package conflicts. We must disable all of
# them here and only enable base, updates, and epel.
if [[ -e /usr/bin/yum ]] && [[ -x /usr/bin/yum-config-manager ]]; then
sudo yum-config-manager --disable \*
sudo yum-config-manager --enable base
sudo yum-config-manager --enable epel
sudo yum-config-manager --enable updates
fi
- install-distro-packages
- shell: |
# NOTE(mhayden): EPEL is no longer required after installing distro
# packages with bindep. Individual roles may re-enable EPEL if they
# need it for their package installation tasks.
if [[ -e /usr/bin/yum ]] && [[ -x /usr/bin/yum-config-manager ]]; then
sudo yum-config-manager --disable epel
fi
- shell: |
# Allow Jenkins user to ssh into localhost
ssh-keygen -f ~/.ssh/id_rsa -N ""
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh-keyscan localhost >> ~/.ssh/known_hosts
ssh-keyscan 127.0.0.1 >> ~/.ssh/known_hosts
- shell: |
# Many of the Ansible roles have a tox environment
# called 'functional', so we implement a mapping
# of the scenario 'func' to 'functional' so reduce
# the need for code churn in those repositories
# immediately.
if [ "{scenario}" == "func" ]; then
/usr/local/jenkins/slave_scripts/run-tox.sh functional
else
/usr/local/jenkins/slave_scripts/run-tox.sh {scenario}
fi
publishers:
# Although these aren't devstack jobs, we want to capture logs
# similar in nature to devstack (Ansible logs, system logs, etc.)
- devstack-logs
- console-log
- job-group:
name: 'ansible-role-jobs'
jobs:
- 'gate-{name}-docs-{node}':
node: ubuntu-xenial
- 'gate-{name}-linters-{node}':
node: ubuntu-xenial
# For some oses we need both voting and non-voting jobs.
- '{pipeline}-{name}-ansible-{scenario}-{ostype}{suffix}':
ostype:
- centos-7
- fedora-25
- ubuntu-xenial
- opensuse-422
- opensuse-423
pipeline: gate
scenario: func
suffix:
- '-nv'
- ''
# Other oses only have voting jobs.
- '{pipeline}-{name}-ansible-{scenario}-{ostype}{suffix}':
ostype:
- ubuntu-trusty
pipeline: gate
scenario: func
suffix: ''
- '{name}-announce-release'
- job-group:
name: 'ansible-role-dsvm-jobs'
jobs:
- 'gate-{name}-docs-{node}':
node: ubuntu-xenial
- 'gate-{name}-linters-{node}':
node: ubuntu-xenial
- '{pipeline}-{name}-dsvm-ansible-func-{ostype}{suffix}':
branch-override: default
ostype:
- centos-7
- ubuntu-trusty
pipeline: gate
suffix: ''
- '{name}-announce-release'
- job:
name: propose-openstack-ansible-update-osa-test-scripts
node: proposal
builders:
- proposal-slave-cleanup
- revoke-sudo
- link-logs
- net-info
- zuul-git-prep
- shell: /usr/local/jenkins/slave_scripts/propose_update.sh openstack-ansible-tests
publishers:
- console-log