forked from instantlinux/docker-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.image-gitlab-ci.yml
43 lines (36 loc) · 1.14 KB
/
.image-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
variables:
DOCKER_CLI_EXPERIMENTAL: enabled
DOCKER_TLS_CERTDIR: ""
IMAGE: {{ IMAGE }}
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
REGISTRY: $REGISTRY_URI/$CI_PROJECT_PATH
stages:
- Static Code Analysis
- Create Image
- Functional Tests
- Promote Image
image: docker:19.03.8
.registry_template: ®istry_login
before_script:
- export TAG=bld_$CI_PIPELINE_IID_${CI_COMMIT_SHORT_SHA}
- docker login -u $CI_REGISTRY_USER -p $CI_JOB_TOKEN $REGISTRY
services: [ "docker:dind" ]
analysis:
stage: Static Code Analysis
image: instantlinux/python-builder:latest
script: cd images/$IMAGE && make analysis
create_image:
<<: *registry_login
stage: Create Image
script: apk add make && cd images/$IMAGE && make create_image
services: [ { name: "docker:dind", command: ["--experimental"] } ]
test:
stage: Functional Tests
script: apk add make && cd images/$IMAGE && make test_functional
promote_image:
stage: Promote Image
<<: *registry_login
script: apk add curl jq make && cd images/$IMAGE && make promote_image
only:
refs: [ master, tags ]
variables: [ $REGISTRY_URI == "registry.gitlab.com" ]