2021-02-05 23:49:47 +01:00
|
|
|
image: golang:latest
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- make install-deps
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- test
|
2021-02-07 11:51:43 +01:00
|
|
|
- build
|
2021-02-05 23:49:47 +01:00
|
|
|
|
|
|
|
format:
|
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- make format
|
|
|
|
|
|
|
|
dependencies:
|
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- make go-mod-tidy
|
|
|
|
|
|
|
|
test:
|
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- make test
|
2021-02-07 11:51:43 +01:00
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
2021-02-07 12:00:13 +01:00
|
|
|
only:
|
|
|
|
- main
|
|
|
|
- tags
|
2021-02-07 11:51:43 +01:00
|
|
|
script:
|
|
|
|
- git fetch --tags
|
|
|
|
- make build/snapshot
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- dist/*.tar.gz
|
|
|
|
- dist/checksums.txt
|
|
|
|
expire_in: 1 day
|
2021-02-08 21:00:27 +01:00
|
|
|
|
|
|
|
docker-gitlab:
|
|
|
|
stage: build
|
|
|
|
image: docker:stable
|
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
before_script:
|
|
|
|
- apk add git
|
|
|
|
- apk add make
|
|
|
|
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
|
|
script:
|
|
|
|
- make docker/build-latest
|
|
|
|
- make docker/build-tag
|
|
|
|
- docker push registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter
|