forked from CyberFlameGO/shoya-go
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
76 lines (68 loc) · 2.06 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
default:
image: golang:1.18
stages:
- build
- docker-build
build:
stage: build
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- vendor/
script:
- mkdir -p ./bin
- go mod download
- go mod vendor
- GOARCH=amd64 GOOS=linux go build -ldflags="-s -w" -o bin/shoya_amd64 .
artifacts:
name: shoya_amd64
paths:
- bin/shoya_amd64
expose_as: shoya_amd64
untracked: false
expire_in: 7 days
docker_api:
image: docker:latest
stage: docker-build
dependencies:
- build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- mkdir ./.docker/api/bin -p
- cp ./bin/shoya_amd64 ./.docker/api/bin/shoya
- cd ./.docker/api/
- docker build -t registry.gitlab.com/george/shoya-go/api:latest .
- docker push registry.gitlab.com/george/shoya-go/api:latest
docker_discovery:
image: docker:latest
stage: docker-build
dependencies:
- build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- mkdir ./.docker/discovery/bin -p
- cp ./bin/shoya_amd64 ./.docker/discovery/bin/shoya
- cd ./.docker/discovery/
- docker build -t registry.gitlab.com/george/shoya-go/discovery:latest .
- docker push registry.gitlab.com/george/shoya-go/discovery:latest
docker_files:
image: docker:latest
stage: docker-build
dependencies:
- build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- mkdir ./.docker/files/bin -p
- cp ./bin/shoya_amd64 ./.docker/files/bin/shoya
- cd ./.docker/files/
- docker build -t registry.gitlab.com/george/shoya-go/files:latest .
- docker push registry.gitlab.com/george/shoya-go/files:latest