-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.gitlab-ci.yml
55 lines (52 loc) · 1.64 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
---
variables:
DEBIAN_FRONTEND: noninteractive
molecule:
image: python:3.13
script:
- apt-get update -qq
- apt-get -y -qq install yamllint docker.io
# Configure Docker for systemd
- mkdir -p /etc/docker
- echo '{"features":{"buildkit":true},"exec-opts":["native.cgroupdriver=systemd"]}' > /etc/docker/daemon.json
- service docker restart || true
# Install dependencies and run tests
- pip install --no-cache-dir ansible-lint molecule molecule-plugins[docker] ansible-core
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- if [ -f requirements.yml ]; then ansible-galaxy install -r requirements.yml; fi
# Create proper role directory structure for molecule
- mkdir -p ~/.ansible/roles
- ln -s $CI_PROJECT_DIR ~/.ansible/roles/robertdebock.grub
# Run molecule tests
- cd $CI_PROJECT_DIR
- ANSIBLE_ROLES_PATH=~/.ansible/roles:$CI_PROJECT_DIR molecule test
rules:
- if: $CI_COMMIT_REF_NAME == "master"
parallel:
matrix:
- image: "alpine"
tag: "latest"
- image: "enterpriselinux"
tag: "latest"
- image: "debian"
tag: "latest"
- image: "debian"
tag: "bullseye"
- image: "fedora"
tag: "40"
- image: "fedora"
tag: "latest"
- image: "ubuntu"
tag: "latest"
- image: "ubuntu"
tag: "jammy"
- image: "ubuntu"
tag: "focal"
galaxy:
image: python:3.13
script:
- apt-get update -qq
- apt-get -y -qq install ansible-core
- ansible-galaxy role import --api-key ${GALAXY_API_KEY} robertdebock ${CI_PROJECT_NAME}
rules:
- if: $CI_COMMIT_TAG != null