2019-03-27 17:26:09 +01:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
go_build:
|
|
|
|
stage: build
|
|
|
|
image: golang:1.12
|
2019-03-28 16:05:43 +01:00
|
|
|
variables:
|
|
|
|
CGO_ENABLED: 0
|
2019-03-27 17:29:52 +01:00
|
|
|
script:
|
|
|
|
- mkdir -p .cache/cache
|
|
|
|
- mkdir -p .cache/go
|
|
|
|
- export GOCACHE="$CI_PROJECT_DIR/.cache/cache"
|
|
|
|
- export GOPATH="$CI_PROJECT_DIR/.cache/go"
|
2019-03-28 16:05:43 +01:00
|
|
|
- go test -race ./...
|
|
|
|
- mkdir -p build || true
|
|
|
|
- go env
|
|
|
|
- GOOS=linux GOARCH=amd64 go build -a -ldflags '-extldflags "-static"' -o build/${CI_PROJECT_NAME}-amd64 ./cmd/wg-quick
|
|
|
|
- GOOS=linux GOARCH=arm GOARM=7 go build -a -ldflags '-extldflags "-static"' -o build/${CI_PROJECT_NAME}-arm32v7 ./cmd/wg-quick
|
|
|
|
- GOOS=linux GOARCH=arm64 go build -a -ldflags '-extldflags "-static"' -o build/${CI_PROJECT_NAME}-arm64v8 ./cmd/wg-quick
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- build/
|
|
|
|
cache:
|
|
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
|
|
paths:
|
|
|
|
- .cache
|