This repository has been archived on 2026-03-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
kubesplit/.gitlab-ci.yml
T
2019-02-27 16:05:41 +01:00

51 lines
1.1 KiB
YAML

variables:
GOCACHE: "${CI_PROJECT_DIR}/_go/cache"
# A hack to make Golang-in-Gitlab happy
before_script:
- rm -rf /go/pkg
- ln -s ${CI_PROJECT_DIR}/_go/pkg /go/pkg
- ln -s ${CI_PROJECT_DIR}/_go/bin /go/bin
- cd ${PACKAGE_PATH}
cache:
key: "$CI_COMMIT_REF_NAME"
paths:
- _go
untracked: true
stages:
- deps
- test
- build
deps:
stage: deps
image: golang:1.12
script:
- go get
test:
stage: test
dependencies:
- deps
image: golang:1.12
script:
- go fmt $(go list ./...)
- go vet $(go list ./...)
- CGO_ENABLED=1 go test -race $(go list ./...) -coverprofile .testCoverage.txt
build:
stage: build
dependencies:
- deps
image: golang:1.12
script:
- go get github.com/ahmetb/govvv
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 govvv build -o release/linux/kubesplit -ldflags '-w -s'
- GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 govvv build -o release/darwin/kubesplit -ldflags '-w -s'
- GOOS=windows GOARCH=amd64 CGO_ENABLED=0 govvv build -o release/windows/kubesplit -ldflags '-w -s'
artifacts:
paths:
- release/