-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
32 lines (31 loc) · 971 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
32
stages:
- build
build:
stage: build
except:
refs:
- tags
only:
- master
tags:
- shell
- zerotier
retry:
max: 2
when: runner_system_failure
before_script:
- docker login -u gitlab-ci -p gitlab-ci https://$REGISTRY
- docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD http://$REGISTRY_MIRROR || true
script:
- mkdir -p .go
- docker pull $REGISTRY/$CI_PROJECT_PATH:latest || true
- docker build . --cache-from $REGISTRY/$CI_PROJECT_PATH:latest
-t $REGISTRY/$CI_PROJECT_PATH:latest
-t $REGISTRY_MIRROR/$CI_PROJECT_PATH:latest
--build-arg GITLAB_TOKEN=$GITLAB_TOKEN
--build-arg GITLAB_DOMAIN=$GITLAB_DOMAIN
- docker push $REGISTRY/$CI_PROJECT_PATH:latest
- docker push $REGISTRY_MIRROR/$CI_PROJECT_PATH:latest || true
- docker image rm $REGISTRY/$CI_PROJECT_PATH:latest
- docker image rm $REGISTRY_MIRROR/$CI_PROJECT_PATH:latest
- curl -X POST $DEPLOY_WEBHOOK