-
Notifications
You must be signed in to change notification settings - Fork 192
/
.gitlab-ci.yml
41 lines (37 loc) · 1.01 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
stages:
- build artifacts
- build docker image
- push docker hub
build-back:
stage: build artifacts
image: golang:latest
script:
- GOOS=linux GOARCH=amd64 go build -o ${CI_PROJECT_NAME}-linux-amd64 -ldflags="-X 'github.com/vx3r/wg-gen-web/version.Version=${CI_COMMIT_SHA}'" github.com/vx3r/wg-gen-web/cmd/wg-gen-web
artifacts:
paths:
- ${CI_PROJECT_NAME}-linux-amd64
build-front:
stage: build artifacts
image: node:10-alpine
script:
- cd ./ui
- npm install
- npm run build
- cd ..
artifacts:
paths:
- ui/dist
build:
stage: build docker image
image: docker:latest
script:
- docker info
- docker build --build-arg COMMIT=${CI_COMMIT_SHA} --network br_docker --tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA} .
push:
stage: push docker hub
image: docker:latest
only:
- master
script:
- echo ${REGISTRY_PASSWORD} | docker login -u ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY}
- docker push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}