This repository has been archived by the owner on Sep 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
106 lines (90 loc) · 1.98 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
image: docker:latest
services:
- docker:dind
# ---------------------------------------
# Global
# ---------------------------------------
stages:
- build
- test
- deploy
variables:
STAGING_REGISTRY: registry.gitlab.com
STAGING_NAMESPACE: jrbeverly-docker
STAGING_PROJECT: docker-glibc
REGISTRY: docker.io
NAMESPACE: jrbeverly
PROJECT: glibc
GIT_COMMIT: ${CI_COMMIT_SHA}
TAG_PREFIX: ${CI_PIPELINE_ID}-
# ----------------------------------------
# Prescript
# ----------------------------------------
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $STAGING_REGISTRY
- apk --update-cache add make
# ----------------------------------------
# Build
# ----------------------------------------
build-baseimage:
stage: build
variables:
VERSION: baseimage
script:
- make -C build/ build
- make -C build/ push
only:
- web
- master
build-privileged:
stage: build
variables:
VERSION: privileged
script:
- make -C build/ build
- make -C build/ push
only:
- web
- master
# ----------------------------------------
# Tests
# ----------------------------------------
test-baseimage:
stage: test
variables:
VERSION: baseimage
script:
- make -s -C build/ pull
- make -s -C build/ test
dependencies:
- build-baseimage
only:
- web
- master
test-privileged:
stage: test
variables:
VERSION: privileged
script:
- make -s -C build/ pull
- make -s -C build/ test
dependencies:
- build-privileged
only:
- web
- master
# ----------------------------------------
# Deploy
# ----------------------------------------
deploy:
stage: deploy
script:
- sh build/ci/pull.sh
- docker login -u $DOCKER_BUILD_USER -p $DOCKER_BUILD_TOKEN
- sh build/ci/deploy.sh
dependencies:
- test-baseimage
- test-privileged
only:
- web
- master