feat: attempt 2 at testing using molecule in gitlab ci
This commit is contained in:
parent
22eb305514
commit
e6a564c1b8
2 changed files with 22 additions and 15 deletions
|
|
@ -6,6 +6,7 @@ stages:
|
|||
# deployment
|
||||
- "gitleaks"
|
||||
- "linting"
|
||||
- "testing"
|
||||
- "deployment"
|
||||
|
||||
|
||||
|
|
@ -15,6 +16,7 @@ include:
|
|||
# deployment
|
||||
- local: ".gitlab/deployment.yaml"
|
||||
- local: ".gitlab/gitleaks.yaml"
|
||||
- local: ".gitlab/testing.yaml"
|
||||
|
||||
# linting
|
||||
- component: "$CI_SERVER_FQDN/components/ansible/linting@v2.0.1"
|
||||
|
|
|
|||
|
|
@ -1,21 +1,26 @@
|
|||
---
|
||||
|
||||
stages:
|
||||
- "testing"
|
||||
|
||||
variables:
|
||||
DOCKER_DRIVER: "overlay2"
|
||||
DOCKER_HOST: "tcp://docker:2375"
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
|
||||
molecule:
|
||||
stage: "testing"
|
||||
image: "cr.simoncor.net/siempie/molecule-ci:v25.07.18"
|
||||
services:
|
||||
- "docker:dind"
|
||||
variables:
|
||||
ANSIBLE_FORCE_COLOR: "true"
|
||||
PY_COLORS: "1"
|
||||
image: python:3.13
|
||||
script:
|
||||
- "docker info"
|
||||
- "molecule test"
|
||||
- apt-get update -qq
|
||||
- apt-get -y -qq install yamllint docker.io
|
||||
- mkdir -p /etc/docker
|
||||
- echo '{"features":{"buildkit":true},"exec-opts":["native.cgroupdriver=systemd"]}' > /etc/docker/daemon.json
|
||||
- service docker restart || true
|
||||
- pip install --no-cache-dir ansible-lint molecule molecule-plugins[docker] ansible-core
|
||||
- mkdir -p ~/.ansible/roles
|
||||
- ln -s $CI_PROJECT_DIR ~/.ansible/roles/siempie.dns
|
||||
- cd $CI_PROJECT_DIR
|
||||
- ANSIBLE_ROLES_PATH=~/.ansible/roles:$CI_PROJECT_DIR molecule test
|
||||
parallel:
|
||||
matrix:
|
||||
- image: "debian"
|
||||
tag: "12"
|
||||
- image: "ubuntu"
|
||||
tag: "22.04"
|
||||
- image: "ubuntu"
|
||||
tag: "24.04"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue