2021-02-05 22:49:47 +00:00
|
|
|
stages:
|
|
|
|
- test
|
2021-02-07 10:51:43 +00:00
|
|
|
- build
|
2021-02-05 22:49:47 +00:00
|
|
|
|
2022-02-12 17:31:01 +00:00
|
|
|
.go_template:
|
|
|
|
image: golang:latest
|
|
|
|
before_script:
|
|
|
|
- make go/dependencies
|
|
|
|
|
|
|
|
.docker_template:
|
|
|
|
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
|
|
|
|
|
2021-10-17 17:39:02 +00:00
|
|
|
dependencies:
|
2022-02-12 17:31:01 +00:00
|
|
|
extends: .go_template
|
2021-10-17 17:39:02 +00:00
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- make go/checkDependencies
|
|
|
|
|
2021-02-05 22:49:47 +00:00
|
|
|
format:
|
2022-02-12 17:31:01 +00:00
|
|
|
extends: .go_template
|
2021-02-05 22:49:47 +00:00
|
|
|
stage: test
|
|
|
|
script:
|
2021-10-17 17:39:02 +00:00
|
|
|
- make go/checkFmt
|
2021-02-05 22:49:47 +00:00
|
|
|
|
|
|
|
test:
|
2022-02-12 17:31:01 +00:00
|
|
|
extends: .go_template
|
2021-02-05 22:49:47 +00:00
|
|
|
stage: test
|
|
|
|
script:
|
2021-10-17 17:39:02 +00:00
|
|
|
- make go/test
|
2021-02-07 10:51:43 +00:00
|
|
|
|
|
|
|
build:
|
2022-02-12 17:31:01 +00:00
|
|
|
extends: .go_template
|
2021-02-07 10:51:43 +00:00
|
|
|
stage: build
|
2021-02-07 11:00:13 +00:00
|
|
|
only:
|
|
|
|
- main
|
|
|
|
- tags
|
2021-02-07 10:51:43 +00:00
|
|
|
script:
|
|
|
|
- git fetch --tags
|
|
|
|
- make build/snapshot
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- dist/*.tar.gz
|
|
|
|
- dist/checksums.txt
|
|
|
|
expire_in: 1 day
|
2021-02-08 20:00:27 +00:00
|
|
|
|
2021-10-17 17:39:02 +00:00
|
|
|
docker/gitlab:
|
2022-02-12 17:31:01 +00:00
|
|
|
extends: .docker_template
|
2021-02-08 20:00:27 +00:00
|
|
|
stage: build
|
2021-02-08 20:07:56 +00:00
|
|
|
only:
|
|
|
|
- tags
|
2021-02-08 20:00:27 +00:00
|
|
|
script:
|
2021-10-17 17:39:02 +00:00
|
|
|
- make docker/build/latest
|
|
|
|
- make docker/build/tag
|
2021-02-08 20:00:27 +00:00
|
|
|
- docker push registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter
|
2022-02-12 17:31:01 +00:00
|
|
|
|
|
|
|
docker/gitlab/nightly:
|
|
|
|
extends: .docker_template
|
|
|
|
stage: build
|
|
|
|
only:
|
|
|
|
- main
|
|
|
|
script:
|
|
|
|
- make docker/build/nightly
|
|
|
|
- docker push registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter
|