forked from chriz2600/quartus-lite
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
28 lines (24 loc) · 1.08 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
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
docker:
image: docker
stage: deploy
services:
- name: docker:dind
script:
- |
echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
echo $DOCKER_HUB_PASSWORD | docker login -u $DOCKER_HUB_USERNAME --password-stdin
docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME --build-arg VERSION="=$CI_COMMIT_REF_NAME" --build-arg DOCKER_TAG="$CI_COMMIT_REF_NAME" .
docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME $CI_REGISTRY_IMAGE:latest
docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME $DOCKER_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME
docker tag $DOCKER_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME $DOCKER_HUB_USERNAME/$CI_PROJECT_NAME:latest
docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
docker push $CI_REGISTRY_IMAGE:latest
docker push $DOCKER_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME
docker push $DOCKER_HUB_USERNAME/$CI_PROJECT_NAME:latest
only:
- tags
tags:
- docker-privileged