2020-01-30 07:45:49 +01:00
|
|
|
stages:
|
2020-02-19 08:19:16 +01:00
|
|
|
- build artifacts
|
2020-02-05 05:01:17 +01:00
|
|
|
- build docker image
|
|
|
|
- push docker hub
|
2020-01-30 07:45:49 +01:00
|
|
|
|
2020-02-19 08:19:16 +01:00
|
|
|
build-back:
|
|
|
|
stage: build artifacts
|
|
|
|
image: golang:latest
|
|
|
|
script:
|
2021-04-06 14:23:23 +02:00
|
|
|
- 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
|
2020-02-19 08:19:16 +01:00
|
|
|
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 05:01:17 +01:00
|
|
|
build:
|
|
|
|
stage: build docker image
|
|
|
|
image: docker:latest
|
2020-01-30 07:45:49 +01:00
|
|
|
script:
|
2020-02-05 05:01:17 +01:00
|
|
|
- docker info
|
2020-03-06 11:43:32 +01:00
|
|
|
- docker build --build-arg COMMIT=${CI_COMMIT_SHA} --network br_docker --tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA} .
|
2020-01-30 07:45:49 +01:00
|
|
|
|
2020-02-05 05:01:17 +01:00
|
|
|
push:
|
|
|
|
stage: push docker hub
|
2020-01-30 07:45:49 +01:00
|
|
|
image: docker:latest
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
script:
|
2020-02-05 05:01:17 +01:00
|
|
|
- echo ${REGISTRY_PASSWORD} | docker login -u ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY}
|
2020-01-30 07:45:49 +01:00
|
|
|
- docker push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}
|