-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.gitlab-ci.yml
69 lines (62 loc) · 1.53 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
variables:
GITHUB_REPO: $CI_PROJECT_NAME
GITHUB_GROUP: enix
ANSIBLE_INVENTORY: "tests/inventory"
PYTHONUNBUFFERED: "1"
ANSIBLE_FORCE_COLOR: "true"
PY_COLORS: '1'
stages:
- lint
- test
- deploy
.ansible_test_template: &ansible_test
script:
- ansible --version
# Uncomment if your role have depends
# - ansible-galaxy install -v -r requirements.yml
- ansible-playbook -vvv --connection=local tests/test.yml
# This part is used to check role run.
# Add your own tests depending on your $ROLE
# - echo "=======> Starting output tests"
# check that our dummy file exists. TOBEREMOVED
# - cat /tmp/.dummy-ansible-task
linting:
stage: lint
image: registry.gitlab.com/lcaflc/ansiblecheck:debian-bullseye
before_script:
- ansible --version
script:
# Run linters. Does not fail if no errors reported
- ansible-lint --force-color . || true
- yamllint -f colored . || true
- ansible-playbook tests/test.yml --syntax-check
proxmox-6:
stage: test
image: debian-10-base
<<: *ansible_test
tags:
- virtualbox
proxmox-7:
stage: test
image: debian-11-base
<<: *ansible_test
tags:
- virtualbox
proxmox-8:
stage: test
image: debian-12-base
<<: *ansible_test
tags:
- virtualbox
importgalaxy:
stage: deploy
image: registry.gitlab.com/lcaflc/ansiblecheck:debian-bullseye
only:
- main
- master
- tags
when: on_success
before_script:
- ansible --version
script:
- ansible-galaxy role import ${GITHUB_GROUP} ${GITHUB_REPO} --token ${GALAXY_API_TOKEN}