-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
72 lines (67 loc) · 1.87 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
---
stages:
- build
- molecule
# See https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
variables:
DOCKER_REPOSITORY: $CI_REGISTRY_IMAGE/buildx
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip
- venv/
Build Docker image:
stage: build
only:
changes:
- .dockerfile-ci
- .gitlab-ci.yml
interruptible: true
image: docker:latest
services:
- docker:dind
script:
- docker info
- docker -D login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker -D build -f .dockerfile-ci -t $DOCKER_REPOSITORY .
- docker -D push $DOCKER_REPOSITORY
Run linter:
stage: molecule
image: $CI_REGISTRY_IMAGE/buildx
services:
- docker:dind
before_script:
- apk add --no-cache python3 python3-dev py3-pip py3-lxml
build-base rust cargo libffi libffi-dev openssl openssl-dev libxml2
libxml2-dev linux-headers libxslt libxslt-dev
- pip3 install pip setuptools --upgrade --break-system-packages
- docker info
script:
- docker -v
- docker buildx install
- python3 -V
- pip3 install -r molecule/requirements.txt --break-system-packages
- ansible --version
- ansible-lint defaults/ tasks/
- yamllint defaults/ tasks/
Run molecule:
stage: molecule
image: $CI_REGISTRY_IMAGE/buildx
services:
- docker:dind
before_script:
- apk add --no-cache python3 python3-dev py3-pip py3-lxml
build-base rust cargo libffi libffi-dev openssl openssl-dev libxml2
libxml2-dev linux-headers libxslt libxslt-dev
- pip3 install pip setuptools --upgrade --break-system-packages
- docker info
script:
- docker -v
- docker buildx install
- python3 -V
- pip3 install -r molecule/requirements.txt --break-system-packages
- ansible --version
- molecule --version
- molecule test