forked from orvice/v2ray-mu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
48 lines (41 loc) · 972 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
image: docker:latest
services:
- docker:dind
stages:
- build
- test
- notify
- deploy
build:
stage: build
image: docker
script:
- export IMAGE_TAG=$(echo -en $CI_BUILD_REF_NAME | tr -c '[:alnum:]_.-' '-')
- docker login -u "$CI_BUILD_USER" -p "$CI_BUILD_TOKEN" $CI_REGISTRY
- docker build --pull -t "$CI_REGISTRY_IMAGE:$IMAGE_TAG" .
- docker push "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
- docker tag "$CI_REGISTRY_IMAGE:$IMAGE_TAG" "$CI_REGISTRY_IMAGE:latest"
- docker push "$CI_REGISTRY_IMAGE:latest"
test:
stage: test
image: golang
allow_failure: true
script:
- go test -v ./...
notify_fail:
image: orvice/telegram-notify:shell
stage: notify
script:
- /app/bin/notify.sh ❌
when: on_failure
notify_success:
image: orvice/telegram-notify:shell
stage: notify
script:
- /app/bin/notify.sh ✅
when: on_success
deploy_dev:
image: orvice/ubuntu-base
stage: deploy
script:
- echo "todo"