-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path.gitlab-ci.yml
47 lines (44 loc) · 1.47 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
variables:
QUAY_REGISTRY_IMAGE: quay.io/connectical/polaris
stages:
- Container
Build and push container image:
stage: Container
image: docker
services:
- docker:dind
script:
- docker context create builder
- docker buildx create builder --use
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker login -u ${QUAY_USERNAME} -p ${QUAY_PASSWORD} quay.io
- source .env
- |
docker build --push \
--build-arg ALPINE_VERSION=${ALPINE_VERSION} \
--build-arg POLARIS_VERSION=${POLARIS_VERSION} \
--tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME} \
--tag ${QUAY_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME} .
rules:
- if: $CI_COMMIT_TAG == null && $CI_COMMIT_REF_PROTECTED == "true"
Build and push tagged container image:
stage: Container
image: docker
services:
- docker:dind
script:
- docker context create builder
- docker buildx create builder --use
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- docker login -u ${QUAY_USERNAME} -p ${QUAY_PASSWORD} quay.io
- source .env
- |
docker build --push \
--build-arg ALPINE_VERSION=${ALPINE_VERSION} \
--build-arg POLARIS_VERSION=${POLARIS_VERSION} \
--tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG} \
--tag ${CI_REGISTRY_IMAGE}:latest \
--tag ${QUAY_REGISTRY_IMAGE}:${CI_COMMIT_TAG} \
--tag ${QUAY_REGISTRY_IMAGE}:latest .
rules:
- if: $CI_COMMIT_TAG