Merge branch '19-update-creation-of-docker-image-labels' into 'main'

Resolve "Update creation of docker image labels"

Closes #19

See merge request hectorjsmith/fail2ban-prometheus-exporter!56
This commit is contained in:
Hector 2022-02-12 17:31:01 +00:00
commit 9f0327b028
3 changed files with 32 additions and 14 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,18 +50,20 @@ build:
expire_in: 1 day
docker/gitlab:
extends: .docker_template
stage: build
only:
- main
- 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) .

View file

@ -94,7 +94,7 @@ Use it by pulling the following image:
registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest
```
Use the `:latest` tag to get the most up to date code (less stable) or use one of the version tagged images to use a specific release.
Use the `:latest` tag to get the latest stable release. Or use the `:nightly` tag for the latest (unstable) version.
See the [registry page](https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/container_registry) for all available tags.
### 3.1. Volumes