-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
123 lines (111 loc) · 3.62 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
122
123
---
include:
- project: veepee/vptech/sre/iac/ci-cd/markdown-lint
ref: 1.4.0
file: gitlab-ci.yml
- project: veepee/vptech/sre/iac/ci-cd/semantic-release
ref: 3.11.0
file: gitlab-ci.yml
variables:
SEMANTIC_CONFIG_FILE: changelog
.template: &build
stage: build
image: docker.registry.vptech.eu/vptech/debian:buster
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
- ln -s /usr/share/debootstrap/scripts/gutsy /usr/share/debootstrap/scripts/focal
- 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/ubuntu-v16.04.tar
- docker load -i image/ubuntu-v16.04-systemd.tar
- docker load -i image/ubuntu-v18.04.tar
- docker load -i image/ubuntu-v18.04-systemd.tar
- docker load -i image/ubuntu-v20.04.tar
- docker load -i image/ubuntu-v20.04-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:16.04:
<<: *build
script:
- ./build.sh -d xenial -v
- mkdir image
- docker save ubuntu:xenial > image/ubuntu-v16.04.tar
build:16.04-systemd:
<<: *build
script:
- ./build.sh -d xenial -e "systemd" -T "systemd" -v
- mkdir image
- docker save ubuntu:xenial-systemd > image/ubuntu-v16.04-systemd.tar
build:18.04:
<<: *build
script:
- ./build.sh -d bionic -v
- mkdir image
- docker save ubuntu:bionic > image/ubuntu-v18.04.tar
build:18.04-systemd:
<<: *build
script:
- ./build.sh -d bionic -e "systemd" -T "systemd" -v
- mkdir image
- docker save ubuntu:bionic-systemd > image/ubuntu-v18.04-systemd.tar
build:20.04:
<<: *build
script:
- ./build.sh -d focal -v
- mkdir image
- docker save ubuntu:focal > image/ubuntu-v20.04.tar
build:20.04-systemd:
<<: *build
script:
- ./build.sh -d focal -e "systemd" -T "systemd" -v
- mkdir image
- docker save ubuntu:focal-systemd > image/ubuntu-v20.04-systemd.tar
# deploy
vptech:
<<: *deploy
script:
- docker tag ubuntu:xenial vptech/ubuntu:xenial
- docker tag ubuntu:xenial vptech/ubuntu:16.04
- docker tag ubuntu:xenial-systemd vptech/ubuntu:xenial-systemd
- docker tag ubuntu:xenial-systemd vptech/ubuntu:16.04-systemd
- docker tag ubuntu:bionic vptech/ubuntu:bionic
- docker tag ubuntu:bionic vptech/ubuntu:18.04
- docker tag ubuntu:bionic-systemd vptech/ubuntu:bionic-systemd
- docker tag ubuntu:bionic-systemd vptech/ubuntu:18.04-systemd
- docker tag ubuntu:focal vptech/ubuntu:focal
- docker tag ubuntu:focal vptech/ubuntu:20.04
- docker tag ubuntu:focal-systemd vptech/ubuntu:focal-systemd
- docker tag ubuntu:focal-systemd vptech/ubuntu:20.04-systemd
- docker tag ubuntu:focal vptech/ubuntu:latest
- docker push --all-tags vptech/ubuntu
# EOF