2019-04-17 23:32:03 +08:00
|
|
|
---
|
2019-04-16 20:35:05 +08:00
|
|
|
yamllint:
|
|
|
|
extends: .job
|
|
|
|
stage: unit-tests
|
2019-12-11 16:10:05 +08:00
|
|
|
variables:
|
|
|
|
LANG: C.UTF-8
|
2019-04-16 20:35:05 +08:00
|
|
|
script:
|
2019-04-20 21:15:41 +08:00
|
|
|
- yamllint --strict .
|
2019-04-16 20:35:05 +08:00
|
|
|
except: ['triggers', 'master']
|
|
|
|
|
2019-05-03 02:24:21 +08:00
|
|
|
vagrant-validate:
|
|
|
|
extends: .job
|
|
|
|
stage: unit-tests
|
|
|
|
script:
|
|
|
|
- curl -sL https://releases.hashicorp.com/vagrant/2.2.4/vagrant_2.2.4_x86_64.deb -o /tmp/vagrant_2.2.4_x86_64.deb
|
|
|
|
- dpkg -i /tmp/vagrant_2.2.4_x86_64.deb
|
|
|
|
- vagrant validate --ignore-provider
|
|
|
|
except: ['triggers', 'master']
|
|
|
|
|
2019-04-16 20:35:05 +08:00
|
|
|
ansible-lint:
|
|
|
|
extends: .job
|
|
|
|
stage: unit-tests
|
|
|
|
# lint every yml/yaml file that looks like it contains Ansible plays
|
|
|
|
script: |-
|
2019-04-29 20:12:22 +08:00
|
|
|
grep -Rl '^- hosts: \|^ hosts: ' --include \*.yml --include \*.yaml . | xargs -P 4 -n 25 ansible-lint -v
|
2019-04-16 20:35:05 +08:00
|
|
|
except: ['triggers', 'master']
|
|
|
|
|
|
|
|
syntax-check:
|
|
|
|
extends: .job
|
|
|
|
stage: unit-tests
|
2019-04-20 21:37:40 +08:00
|
|
|
variables:
|
|
|
|
ANSIBLE_INVENTORY: inventory/local-tests.cfg
|
|
|
|
ANSIBLE_REMOTE_USER: root
|
|
|
|
ANSIBLE_BECOME: "true"
|
|
|
|
ANSIBLE_BECOME_USER: root
|
|
|
|
ANSIBLE_VERBOSITY: "3"
|
2019-04-16 20:35:05 +08:00
|
|
|
script:
|
2019-04-20 21:37:40 +08:00
|
|
|
- ansible-playbook --syntax-check cluster.yml
|
|
|
|
- ansible-playbook --syntax-check upgrade-cluster.yml
|
|
|
|
- ansible-playbook --syntax-check reset.yml
|
|
|
|
- ansible-playbook --syntax-check extra_playbooks/upgrade-only-k8s.yml
|
2019-04-16 20:35:05 +08:00
|
|
|
except: ['triggers', 'master']
|
|
|
|
|
|
|
|
tox-inventory-builder:
|
|
|
|
stage: unit-tests
|
|
|
|
extends: .job
|
2019-12-05 17:48:32 +08:00
|
|
|
before_script:
|
|
|
|
- ./tests/scripts/rebase.sh
|
|
|
|
- apt-get update && apt-get install -y python3-pip
|
|
|
|
- update-alternatives --install /usr/bin/python python /usr/bin/python3 10
|
|
|
|
- python -m pip install -r tests/requirements.txt
|
2019-04-16 20:35:05 +08:00
|
|
|
script:
|
2019-12-05 17:48:32 +08:00
|
|
|
- pip3 install tox
|
2019-04-16 20:35:05 +08:00
|
|
|
- cd contrib/inventory_builder && tox
|
|
|
|
except: ['triggers', 'master']
|
2019-12-04 23:22:57 +08:00
|
|
|
|
|
|
|
markdownlint:
|
|
|
|
stage: unit-tests
|
|
|
|
image: node
|
|
|
|
before_script:
|
|
|
|
- npm install -g markdownlint-cli
|
|
|
|
script:
|
|
|
|
- markdownlint README.md docs --ignore docs/_sidebar.md
|