-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
88 lines (83 loc) · 5.09 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
stages:
- build
build:alpine:
image: docker:stable
stage: build
script:
- docker build -t ${CI_REGISTRY_IMAGE}:latest .
- docker build -t ${CI_REGISTRY_IMAGE}/alpine:latest -f Dockerfile_alpine .
- docker tag ${CI_REGISTRY_IMAGE}:latest ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest
- docker tag ${CI_REGISTRY_IMAGE}/alpine:latest ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-alpine
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker login -u ${DOCKERHUB_USER} -p ${DOCKERHUB_SECRET}
- docker push ${CI_REGISTRY_IMAGE}:latest
- docker push ${CI_REGISTRY_IMAGE}/alpine:latest
- docker push ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest
- docker push ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-alpine
build:debian:
image: docker:stable
stage: build
script:
- docker build -t ${CI_REGISTRY_IMAGE}/debian:latest -f Dockerfile_debian .
- docker build -t ${CI_REGISTRY_IMAGE}/debian/buster:latest -f Dockerfile_debian_buster .
- docker build -t ${CI_REGISTRY_IMAGE}/debian/bullseye:latest -f Dockerfile_debian_bullseye .
- docker tag ${CI_REGISTRY_IMAGE}/debian:latest ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-debian
- docker tag ${CI_REGISTRY_IMAGE}/debian/buster:latest ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-debian-buster
- docker tag ${CI_REGISTRY_IMAGE}/debian/bullseye:latest ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-debian-bullseye
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker login -u ${DOCKERHUB_USER} -p ${DOCKERHUB_SECRET}
- docker push ${CI_REGISTRY_IMAGE}/debian:latest
- docker push ${CI_REGISTRY_IMAGE}/debian/buster:latest
- docker push ${CI_REGISTRY_IMAGE}/debian/bullseye:latest
- docker push ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-debian
- docker push ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-debian-buster
- docker push ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-debian-bullseye
build:ubuntu:
image: docker:stable
stage: build
script:
- docker build -t ${CI_REGISTRY_IMAGE}/ubuntu:latest -f Dockerfile_ubuntu .
- docker build -t ${CI_REGISTRY_IMAGE}/ubuntu/16.04:latest -f Dockerfile_ubuntu_1604 .
- docker build -t ${CI_REGISTRY_IMAGE}/ubuntu/18.04:latest -f Dockerfile_ubuntu_1804 .
- docker build -t ${CI_REGISTRY_IMAGE}/ubuntu/20.04:latest -f Dockerfile_ubuntu_2004 .
- docker build -t ${CI_REGISTRY_IMAGE}/ubuntu/22.04:latest -f Dockerfile_ubuntu_2004 .
- docker tag ${CI_REGISTRY_IMAGE}/ubuntu:latest ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-ubuntu
- docker tag ${CI_REGISTRY_IMAGE}/ubuntu/16.04:latest ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-ubuntu-16.04
- docker tag ${CI_REGISTRY_IMAGE}/ubuntu/18.04:latest ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-ubuntu-18.04
- docker tag ${CI_REGISTRY_IMAGE}/ubuntu/20.04:latest ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-ubuntu-20.04
- docker tag ${CI_REGISTRY_IMAGE}/ubuntu/22.04:latest ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-ubuntu-22.04
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker login -u ${DOCKERHUB_USER} -p ${DOCKERHUB_SECRET}
- docker push ${CI_REGISTRY_IMAGE}/ubuntu:latest
- docker push ${CI_REGISTRY_IMAGE}/ubuntu/16.04:latest
- docker push ${CI_REGISTRY_IMAGE}/ubuntu/18.04:latest
- docker push ${CI_REGISTRY_IMAGE}/ubuntu/20.04:latest
- docker push ${CI_REGISTRY_IMAGE}/ubuntu/22.04:latest
- docker push ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-ubuntu
- docker push ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-ubuntu-16.04
- docker push ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-ubuntu-18.04
- docker push ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-ubuntu-22.04
build:centos:
image: docker:stable
stage: build
script:
- docker build -t ${CI_REGISTRY_IMAGE}/centos/7:latest -f Dockerfile_centos_7 .
- docker tag ${CI_REGISTRY_IMAGE}/centos/7:latest ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-centos-7
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker login -u ${DOCKERHUB_USER} -p ${DOCKERHUB_SECRET}
- docker push ${CI_REGISTRY_IMAGE}/centos/7:latest
- docker push ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-centos-7
build:rocky:
image: docker:stable
stage: build
script:
- docker build -t ${CI_REGISTRY_IMAGE}/rocky:latest -f Dockerfile_rocky .
- docker build -t ${CI_REGISTRY_IMAGE}/rocky/8:latest -f Dockerfile_rocky_8 .
- docker tag ${CI_REGISTRY_IMAGE}/rocky:latest ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-rocky
- docker tag ${CI_REGISTRY_IMAGE}/rocky/8:latest ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-rocky-8
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker login -u ${DOCKERHUB_USER} -p ${DOCKERHUB_SECRET}
- docker push ${CI_REGISTRY_IMAGE}/rocky:latest
- docker push ${CI_REGISTRY_IMAGE}/rocky/8:latest
- docker push ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-rocky
- docker push ${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest-rocky-8