-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yaml
44 lines (40 loc) · 1.08 KB
/
.gitlab-ci.yaml
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
stages:
- docker
- test
services:
- docker:20.10.5-dind
variables:
DOCKER_IMAGE_NAME: n1c0l4stournier/compliance-testing:poc
docker:
stage: docker
image:
name: docker:20.10.5
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
script:
- docker build -t $DOCKER_IMAGE_NAME .
- docker save -o image.tar $DOCKER_IMAGE_NAME
artifacts:
paths:
- image.tar
expire_in: 30 min
structure-test:
stage: test
image:
name: docker:20.10.5
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
before_script:
- apk --no-cache add curl
- curl -LO https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64
- chmod +x container-structure-test-linux-amd64
- mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test
script:
- docker load -i image.tar
- container-structure-test test --image $DOCKER_IMAGE_NAME --config structure-test.yaml -o junit --test-report report.xml
artifacts:
reports:
junit: report.xml
expire_in: 30 min