0
0
mirror of https://github.com/vx3r/wg-gen-web.git synced 2024-11-04 17:31:17 +00:00
wg-gen-web/.gitlab-ci.yml

42 lines
1013 B
YAML
Raw Normal View History

2020-01-30 06:45:49 +00:00
stages:
- build artifacts
2020-02-05 04:01:17 +00:00
- build docker image
- push docker hub
2020-01-30 06:45:49 +00:00
build-back:
stage: build artifacts
image: golang:latest
script:
- GOOS=linux GOARCH=amd64 go build -ldflags="-X 'gitlab.127-0-0-1.fr/vx3r/wg-gen-web/util.Version=${CI_COMMIT_SHORT_SHA}'" -o ${CI_PROJECT_NAME}-linux-amd64
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
2020-02-05 04:01:17 +00:00
build:
stage: build docker image
image: docker:latest
2020-01-30 06:45:49 +00:00
script:
2020-02-05 04:01:17 +00:00
- docker info
- docker build --build-arg COMMIT=${CI_COMMIT_SHORT_SHA} --network br_docker --tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA} .
2020-01-30 06:45:49 +00:00
2020-02-05 04:01:17 +00:00
push:
stage: push docker hub
2020-01-30 06:45:49 +00:00
image: docker:latest
only:
- master
script:
2020-02-05 04:01:17 +00:00
- echo ${REGISTRY_PASSWORD} | docker login -u ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY}
2020-01-30 06:45:49 +00:00
- docker push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}