add new nightly build job

This commit is contained in:
Hector 2022-02-03 20:49:25 +00:00
parent b32c2ac73a
commit 49656af487
2 changed files with 31 additions and 12 deletions

View File

@ -1,28 +1,41 @@
image: golang:latest
before_script:
- make go/dependencies
stages:
- test
- build
.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
dependencies:
extends: .go_template
stage: test
script:
- make go/checkDependencies
format:
extends: .go_template
stage: test
script:
- make go/checkFmt
test:
extends: .go_template
stage: test
script:
- make go/test
build:
extends: .go_template
stage: build
only:
- main
@ -37,17 +50,20 @@ build:
expire_in: 1 day
docker/gitlab:
extends: .docker_template
stage: build
only:
- tags
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
docker/gitlab/nightly:
extends: .docker_template
stage: build
only:
- main
script:
- make docker/build/nightly
- docker push registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter

View File

@ -32,5 +32,8 @@ build/docker:
docker/build/latest:
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest .
docker/build/nightly:
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:nightly .
docker/build/tag:
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:$(shell git describe --tags) .