2020-12-26 13:11:49 +00:00
|
|
|
image: registry.gitlab.com/inetmock/ci-image
|
|
|
|
|
2021-01-16 16:43:54 +00:00
|
|
|
cache: &global_cache
|
|
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
|
|
paths:
|
|
|
|
- .task/
|
2021-01-16 16:49:20 +00:00
|
|
|
- ./**/*.pb.go
|
2021-01-16 16:43:54 +00:00
|
|
|
policy: pull-push
|
|
|
|
|
2020-12-26 13:11:49 +00:00
|
|
|
stages:
|
|
|
|
- test
|
|
|
|
- build
|
|
|
|
- release
|
|
|
|
|
|
|
|
test:
|
|
|
|
stage: test
|
2021-01-16 16:43:54 +00:00
|
|
|
cache:
|
|
|
|
<<: *global_cache
|
2020-12-26 13:11:49 +00:00
|
|
|
script:
|
|
|
|
- task cli-cover-report
|
2020-12-27 11:16:06 +00:00
|
|
|
artifacts:
|
|
|
|
reports:
|
|
|
|
junit: out/report.xml
|
|
|
|
cobertura: out/coverage.xml
|
2020-12-26 13:11:49 +00:00
|
|
|
|
|
|
|
lint:
|
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- golangci-lint run
|
|
|
|
allow_failure: true
|
|
|
|
|
|
|
|
snapshot-release:
|
|
|
|
stage: build
|
2021-01-16 16:43:54 +00:00
|
|
|
cache:
|
|
|
|
<<: *global_cache
|
2020-12-26 13:11:49 +00:00
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
before_script:
|
|
|
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
|
|
|
script:
|
|
|
|
- task snapshot-release
|
|
|
|
except:
|
|
|
|
- tags
|
|
|
|
|
|
|
|
release:
|
|
|
|
stage: release
|
2021-01-16 16:43:54 +00:00
|
|
|
cache:
|
|
|
|
<<: *global_cache
|
2020-12-26 13:11:49 +00:00
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
variables:
|
|
|
|
GIT_DEPTH: 0
|
|
|
|
script:
|
|
|
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
2021-01-04 16:21:03 +00:00
|
|
|
- goreleaser release --rm-dist
|