mirror of
https://github.com/shouptech/tempgopher.git
synced 2026-02-03 08:39:43 +00:00
43 lines
873 B
YAML
43 lines
873 B
YAML
image: golang:1.11
|
|
|
|
variables:
|
|
binary_name: tempgopher
|
|
project_prefix: gitlab.com/shouptech
|
|
project_path: $project_prefix/tempgopher
|
|
|
|
|
|
stages:
|
|
- test
|
|
- build
|
|
|
|
before_script:
|
|
- mkdir -p ${GOPATH}/src/${project_prefix}
|
|
- cp -r ${CI_PROJECT_DIR} ${GOPATH}/src/${project_path}
|
|
- cd ${GOPATH}/src/${project_path}
|
|
- go get -v ./...
|
|
|
|
test:
|
|
stage: test
|
|
variables:
|
|
GIN_MODE: debug
|
|
INFLUXDB_DB: db
|
|
services:
|
|
- influxdb
|
|
script:
|
|
- go get -v -t ./...
|
|
- go test -v -coverprofile=$CI_PROJECT_DIR/coverage.out
|
|
artifacts:
|
|
paths:
|
|
- coverage.out
|
|
|
|
build:
|
|
stage: build
|
|
variables:
|
|
build_binary: $CI_PROJECT_DIR/${binary_name}
|
|
script:
|
|
- go get -v github.com/gobuffalo/packr/...
|
|
- GOOS=linux GOARCH=arm GOARM=6 packr build -v -a -ldflags '-s -w -extldflags "-static"' -o ${build_binary}
|
|
artifacts:
|
|
paths:
|
|
- tempgopher
|
|
- install.sh
|