-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
117 lines (117 loc) · 5.29 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Copyright 2019-2024 Chris Croome
#
# This file is part of the Webarchitects Ansible role.
#
# The Webarchitects Ansible role is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
#
# The Webarchitects Ansible role is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with the Webarchitects Ansible role. If not, see <https://www.gnu.org/licenses/>.
---
variables:
ANSIBLE_ANY_ERRORS_FATAL: "1"
ANSIBLE_CALLBACK_RESULT_FORMAT: "yaml"
ANSIBLE_DEFAULT_VERBOSITY: "1"
ANSIBLE_DIFF_ALWAYS: "1"
ANSIBLE_DISPLAY_SKIPPED_HOSTS: "0"
ANSIBLE_ERROR_ON_UNDEFINED_VARS: "1"
ANSIBLE_FORCE_COLOR: "1"
ANSIBLE_INJECT_FACT_VARS: "0"
ANSIBLE_NOCOWS: "1"
ANSIBLE_REMOTE_TMP: "/tmp"
ANSIBLE_SHELL_ALLOW_WORLD_READABLE_TEMP: "1"
DEBIAN_FRONTEND: "noninteractive"
DEFAULT_MANAGED_STR: "Ansible managed"
MOLECULE_VERBOSITY: "0"
PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
PIPX_BIN_DIR: /usr/local/bin
PIPX_HOME: /opt/pipx
PRE_COMMIT_COLOR: always
PY_COLORS: "1"
USER: "root"
stages:
- bookworm
- bullseye
- jammy
- noble
- trixie
bookworm:
image: debian:bookworm-backports
stage: bookworm
script:
- chmod 700 $(pwd)
- ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
- apt-get update -qq
- apt-get dist-upgrade -qqy
# Install packages for pipx
- apt-get install -qqy ansible ansible-lint git jc jo libpq-dev pipx pre-commit procps postgresql-client python3-apt python3-argcomplete python3-commonmark python3-jmespath python3-lxml python3-netaddr python3-pip python3-psycopg python3-resolvelib python3-ruamel.yaml python3-setuptools python3-venv
- pre-commit install
- pre-commit run --all-files
- pipx install molecule
- pipx inject molecule ansible jc jmespath
- molecule test --all
bullseye:
image: debian:bullseye-backports
stage: bullseye
script:
- chmod 700 $(pwd)
- ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
- apt-get update -qq
- apt-get dist-upgrade -qqy
# Install packages for pipx
- apt-get install -qqy ansible ansible-lint git jc jo libpq-dev pipx pre-commit procps postgresql-client python3-apt python3-argcomplete python3-commonmark python3-jmespath python3-lxml python3-netaddr python3-pip python3-psycopg2 python3-resolvelib python3-ruamel.yaml python3-setuptools python3-venv
# https://github.com/ansible/ansible-lint/releases
# Newer versions of ansible-lint can't be installed on Bullseye as they require Python >= 3.10
- mv .pre-commit-config-gitlab-ci.yaml .pre-commit-config.yaml
- pre-commit install
- pre-commit run --all-files
- pipx install molecule
- pipx inject --include-apps --include-deps molecule ansible jc jmespath
- molecule test --all
jammy:
image: ubuntu:jammy
stage: jammy
script:
- chmod 700 $(pwd)
- ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
- apt-get update -qq
- apt-get dist-upgrade -qqy
# Install packages for pipx
- apt-get install -qqy ansible ansible-lint git jc jo libpq-dev pipx pre-commit procps postgresql-client python3-apt python3-argcomplete python3-commonmark python3-jmespath python3-lxml python3-netaddr python3-pip python3-psycopg2 python3-resolvelib python3-ruamel.yaml python3-setuptools python3-venv
- pre-commit run --all-files
- pipx install molecule
- pipx inject --include-apps --include-deps molecule ansible jc jmespath
- molecule test --all
noble:
image: ubuntu:noble
stage: noble
script:
- chmod 700 $(pwd)
- ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
- apt-get update -qq
- apt-get dist-upgrade -qqy
# Install packages for pipx
- apt-get install -qqy ansible ansible-lint git jc jo libpq-dev pipx pre-commit procps postgresql-client python3-apt python3-argcomplete python3-commonmark python3-jmespath python3-lxml python3-netaddr python3-pip python3-psycopg2 python3-resolvelib python3-ruamel.yaml python3-setuptools python3-venv
- pre-commit install
- pre-commit run --all-files
- pipx install molecule
- pipx inject --include-apps --include-deps molecule ansible jc jmespath
- molecule test --all
trixie:
image: debian:trixie-backports
stage: trixie
script:
- chmod 700 $(pwd)
- ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
- apt-get update -qq
- apt-get dist-upgrade -qqy
# Install packages for pipx
# NOTE that the jc package is not available for Trixie
# https://packages.debian.org/trixie/jc
- apt-get install -qqy ansible ansible-core ansible-lint git jo libpq-dev pipx pre-commit procps postgresql-client python3-apt python3-argcomplete python3-commonmark python3-jmespath python3-lxml python3-netaddr python3-pip python3-psycopg python3-resolvelib python3-ruamel.yaml python3-setuptools python3-venv
- pre-commit install
- pre-commit run --all-files
- pipx install molecule
- pipx inject --include-apps --include-deps molecule ansible jc jmespath
- molecule test --all
...