-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
31 lines (28 loc) · 965 Bytes
/
.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
---
image: docker:latest
variables:
PUBLISHER_REPOSITORY: 'igwn/publisher'
stages:
- docker
docker:build:
stage: docker
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build --pull -t $CI_REGISTRY_IMAGE:latest .
- docker push $CI_REGISTRY_IMAGE:latest
- |
# push to docker hub
if [[ $CI_PROJECT_NAMESPACE == 'docker' ]]; then
docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_TOKEN
docker tag $CI_REGISTRY_IMAGE:latest $PUBLISHER_REPOSITORY:latest
docker push $PUBLISHER_REPOSITORY:latest
docker logout
fi
- |
# push to quay.io
if [[ $CI_PROJECT_NAMESPACE == 'docker' ]]; then
docker login -u $QUAY_USER -p $QUAY_TOKEN quay.io
docker tag $CI_REGISTRY_IMAGE:latest quay.io/$PUBLISHER_REPOSITORY:latest
docker push quay.io/$PUBLISHER_REPOSITORY:latest
docker logout quay.io
fi