-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
121 lines (110 loc) · 3.59 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
---
include:
- project: veepee/vptech/sre/iac/ci-cd/markdown-lint
ref: latest
file: gitlab-ci.yml
- project: veepee/vptech/sre/iac/ci-cd/semantic-release
ref: 4-latest
file: gitlab-ci.yml
.template: &build
stage: build
image: docker.registry.vptech.eu/debian:bullseye
before_script:
- apt-get update -qq -y
- apt-get install -qq -y apt-transport-https ca-certificates curl debootstrap kmod gnupg-agent procps software-properties-common sudo systemd tar
- curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
- add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
- apt-get update -qq -y
- apt-get install -qq -y docker-ce docker-ce-cli containerd.io
- env DOCKER_DRIVER=vfs dockerd &
artifacts:
expire_in: 1 day
paths:
- image
tags:
- dind
variables:
DOCKER_DRIVER: overlay
.template: &deploy
stage: deploy
image: docker.registry.vptech.eu/docker:latest
before_script:
- docker login -u "$DOCKER_PUBLIC_REGISTRY_USERNAME" -p "$DOCKER_PUBLIC_REGISTRY_PASSWORD"
- docker load -i image/debian-v9.0.tar
- docker load -i image/debian-v9.0-systemd.tar
- docker load -i image/debian-v10.0.tar
- docker load -i image/debian-v10.0-systemd.tar
- docker load -i image/debian-v11.0.tar
- docker load -i image/debian-v11.0-systemd.tar
only:
- master
services:
- name: docker.registry.vptech.eu/docker:dind
alias: docker
tags:
- dind
variables:
DOCKER_DRIVER: overlay
stages:
- lint
- build
- deploy
- release
# build
build:9:
<<: *build
script:
- ./build.sh -d stretch -v
- mkdir image
- docker save debian:stretch > image/debian-v9.0.tar
build:9-systemd:
<<: *build
script:
- ./build.sh -d stretch -e "systemd" -T "systemd" -v
- mkdir image
- docker save debian:stretch-systemd > image/debian-v9.0-systemd.tar
build:10:
<<: *build
script:
- ./build.sh -d buster -v
- mkdir image
- docker save debian:buster > image/debian-v10.0.tar
build:10-systemd:
<<: *build
script:
- ./build.sh -d buster -e "systemd" -T "systemd" -v
- mkdir image
- docker save debian:buster-systemd > image/debian-v10.0-systemd.tar
build:11:
<<: *build
script:
- ./build.sh -d bullseye -v
- mkdir image
- docker save debian:bullseye > image/debian-v11.0.tar
build:11-systemd:
<<: *build
script:
- ./build.sh -d bullseye -e "systemd" -T "systemd" -v
- mkdir image
- docker save debian:bullseye-systemd > image/debian-v11.0-systemd.tar
# deploy
vptech:
<<: *deploy
script:
- docker tag debian:stretch vptech/debian:9
- docker tag debian:stretch-systemd vptech/debian:9-systemd
- docker tag debian:stretch vptech/debian:stretch
- docker tag debian:stretch-systemd vptech/debian:stretch-systemd
- docker tag debian:buster vptech/debian:10
- docker tag debian:buster-systemd vptech/debian:10-systemd
- docker tag debian:buster vptech/debian:buster
- docker tag debian:buster-systemd vptech/debian:buster-systemd
- docker tag debian:bullseye vptech/debian:11
- docker tag debian:bullseye-systemd vptech/debian:11-systemd
- docker tag debian:bullseye vptech/debian:bullseye
- docker tag debian:bullseye-systemd vptech/debian:bullseye-systemd
- docker tag debian:buster vptech/debian:oldstable
- docker tag debian:bullseye vptech/debian:stable
- docker tag debian:bullseye vptech/debian:latest
- docker push --all-tags vptech/debian
# EOF