merge: publish-arm64-based-docker-images
* Merge branch 'publish-arm64-based-docker-images' into 'main' * See merge request hectorjsmith/fail2ban-prometheus-exporter!108 * Merged by: Hector <hector@hjs.dev>
This commit is contained in:
commit
a4c48ba46f
3 changed files with 47 additions and 30 deletions
|
@ -62,17 +62,3 @@ release:
|
||||||
-e DOCKER_USERNAME -e DOCKER_PASSWORD -e DOCKER_REGISTRY \
|
-e DOCKER_USERNAME -e DOCKER_PASSWORD -e DOCKER_REGISTRY \
|
||||||
-e GITLAB_TOKEN \
|
-e GITLAB_TOKEN \
|
||||||
goreleaser/goreleaser release --clean
|
goreleaser/goreleaser release --clean
|
||||||
|
|
||||||
tag images:
|
|
||||||
stage: release
|
|
||||||
image: docker:stable
|
|
||||||
services:
|
|
||||||
- docker:dind
|
|
||||||
needs:
|
|
||||||
- release
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/
|
|
||||||
variables:
|
|
||||||
IMAGE_NAME: registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter
|
|
||||||
script:
|
|
||||||
- ./.gitlab-ci/tagLatestImage.sh
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
VERSION=`echo $CI_COMMIT_TAG | cut -c 2-`
|
|
||||||
MAJOR=`echo $VERSION | cut -d "." -f 1`
|
|
||||||
MINOR=`echo $VERSION | cut -d "." -f 2`
|
|
||||||
|
|
||||||
echo "version: $VERSION (major: $MAJOR; minor: $MINOR)"
|
|
||||||
|
|
||||||
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
||||||
docker pull $IMAGE_NAME:$VERSION
|
|
||||||
docker tag $IMAGE_NAME:$VERSION $IMAGE_NAME:latest
|
|
||||||
docker tag $IMAGE_NAME:$VERSION $IMAGE_NAME:$MAJOR
|
|
||||||
docker tag $IMAGE_NAME:$VERSION $IMAGE_NAME:$MAJOR.$MINOR
|
|
||||||
docker push $IMAGE_NAME
|
|
|
@ -15,9 +15,15 @@ builds:
|
||||||
- "7"
|
- "7"
|
||||||
|
|
||||||
dockers:
|
dockers:
|
||||||
- image_templates: ["registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Version }}"]
|
- image_templates:
|
||||||
dockerfile: Dockerfile
|
- "registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Major }}-amd64"
|
||||||
|
- "registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Major }}.{{ .Minor }}-amd64"
|
||||||
|
- 'registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Version }}-amd64'
|
||||||
|
- "registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest-amd64"
|
||||||
|
use: buildx
|
||||||
build_flag_templates:
|
build_flag_templates:
|
||||||
|
- "--pull"
|
||||||
|
- "--platform=linux/amd64"
|
||||||
- --label=org.opencontainers.image.title={{ .ProjectName }}
|
- --label=org.opencontainers.image.title={{ .ProjectName }}
|
||||||
- --label=org.opencontainers.image.description={{ .ProjectName }}
|
- --label=org.opencontainers.image.description={{ .ProjectName }}
|
||||||
- --label=org.opencontainers.image.url=https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter
|
- --label=org.opencontainers.image.url=https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter
|
||||||
|
@ -26,6 +32,45 @@ dockers:
|
||||||
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
|
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
|
||||||
- --label=org.opencontainers.image.revision={{ .FullCommit }}
|
- --label=org.opencontainers.image.revision={{ .FullCommit }}
|
||||||
- --label=org.opencontainers.image.licenses=MIT
|
- --label=org.opencontainers.image.licenses=MIT
|
||||||
|
- image_templates:
|
||||||
|
- "registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Major }}-arm64"
|
||||||
|
- "registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Major }}.{{ .Minor }}-arm64"
|
||||||
|
- 'registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Version }}-arm64'
|
||||||
|
- "registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest-arm64"
|
||||||
|
use: buildx
|
||||||
|
build_flag_templates:
|
||||||
|
- "--pull"
|
||||||
|
- "--platform=linux/arm64"
|
||||||
|
- --label=org.opencontainers.image.title={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.description={{ .ProjectName }}
|
||||||
|
- --label=org.opencontainers.image.url=https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter
|
||||||
|
- --label=org.opencontainers.image.source=https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter
|
||||||
|
- --label=org.opencontainers.image.version={{ .Version }}
|
||||||
|
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
|
||||||
|
- --label=org.opencontainers.image.revision={{ .FullCommit }}
|
||||||
|
- --label=org.opencontainers.image.licenses=MIT
|
||||||
|
goarch: arm64
|
||||||
|
|
||||||
|
docker_manifests:
|
||||||
|
- name_template: 'registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Major }}'
|
||||||
|
image_templates:
|
||||||
|
- 'registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Major }}-amd64'
|
||||||
|
- 'registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Major }}-arm64'
|
||||||
|
|
||||||
|
- name_template: 'registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Major }}.{{ .Minor }}'
|
||||||
|
image_templates:
|
||||||
|
- 'registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Major }}.{{ .Minor }}-amd64'
|
||||||
|
- 'registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Major }}.{{ .Minor }}-arm64'
|
||||||
|
|
||||||
|
- name_template: 'registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Version }}'
|
||||||
|
image_templates:
|
||||||
|
- 'registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Version }}-amd64'
|
||||||
|
- 'registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:{{ .Version }}-arm64'
|
||||||
|
|
||||||
|
- name_template: 'registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest'
|
||||||
|
image_templates:
|
||||||
|
- 'registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest-amd64'
|
||||||
|
- 'registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest-arm64'
|
||||||
|
|
||||||
changelog:
|
changelog:
|
||||||
groups:
|
groups:
|
||||||
|
|
Loading…
Reference in a new issue