-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
85 lines (72 loc) · 1.46 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
variables:
DOCKER_HOST: "docker"
stages:
- build
- test
- push2registry
# anchors
.build: &build
stage: build
tags:
- dind
script:
- JOB_NAME=( $CI_BUILD_NAME )
- export DIST=${JOB_NAME[1]}
- export DOCKER_TAG="$CI_REGISTRY_IMAGE:$DIST"
- apt-get update
- apt-get install -y debootstrap eatmydata make sudo xz-utils
- eatmydata make image
- make save
artifacts:
name: "$CI_BUILD_NAME"
paths:
- ./*.tar.xz
expire_in: 1 year
.test: &test
stage: test
tags:
- dind
script:
- JOB_NAME=( $CI_BUILD_NAME )
- export DIST=${JOB_NAME[1]}
- export DOCKER_TAG="$CI_REGISTRY_IMAGE:$DIST"
- apt-get update
- apt-get install -y make xz-utils
- make load
- make test
.push2registry: &push2registry
stage: push2registry
only:
- master@nantes_docker/debian
tags:
- dind
script:
- JOB_NAME=( $CI_BUILD_NAME )
- export DIST=${JOB_NAME[1]}
- export DOCKER_TAG="$CI_REGISTRY_IMAGE:$DIST"
- apt-get update
- apt-get install -y make xz-utils
- make load
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- make push
# build
build wheezy:
<<: *build
build jessie:
<<: *build
build stretch:
<<: *build
# test
test wheezy:
<<: *test
test jessie:
<<: *test
test stretch:
<<: *test
# push2registry
push2registry wheezy:
<<: *push2registry
push2registry jessie:
<<: *push2registry
push2registry stretch:
<<: *push2registry