fix CI pipeline for multi-platform Docker builds and add manifest support
Some checks failed
continuous-integration/drone/push Build encountered an error

This commit is contained in:
2026-02-19 13:27:27 +11:00
parent 1b6989b5d9
commit ed326eb8ef

View File

@@ -9,22 +9,22 @@ trigger:
- tag - tag
steps: steps:
- name: lint # - name: lint
image: cache.coadcorp.com/library/golang:1.26 # image: cache.coadcorp.com/library/golang:1.26
environment: # environment:
GOFLAGS: -mod=mod # GOFLAGS: -mod=mod
GOBIN: /usr/local/bin # GOBIN: /usr/local/bin
commands: # commands:
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8 # - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8
- golangci-lint version # - golangci-lint version
- golangci-lint run --timeout=5m # - golangci-lint run --timeout=5m
- name: test # - name: test
image: cache.coadcorp.com/library/golang:1.26 # image: cache.coadcorp.com/library/golang:1.26
environment: # environment:
GOFLAGS: -mod=mod # GOFLAGS: -mod=mod
commands: # commands:
- go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... # - go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: build - name: build
image: cache.coadcorp.com/library/golang:1.26 image: cache.coadcorp.com/library/golang:1.26
@@ -41,38 +41,66 @@ steps:
event: event:
- pull_request - pull_request
- name: docker-publish-commit - name: docker-publish-commit-amd64
image: plugins/docker image: plugins/docker
settings: settings:
registry: registry.coadcorp.com registry: registry.coadcorp.com
repo: registry.coadcorp.com/nathan/invertergui repo: registry.coadcorp.com/nathan/invertergui
dockerfile: Dockerfile dockerfile: Dockerfile
platform: linux/amd64,linux/arm64 platform: linux/amd64
experimental: true
buildx_options_semicolon: --platform=linux/amd64,linux/arm64;--provenance=false
username: nathan username: nathan
password: password:
from_secret: registry_password from_secret: registry_password
tags: tags:
- ${DRONE_COMMIT_SHA} - ${DRONE_COMMIT_SHA}-linux-amd64
when: when:
event: event:
- push - push
- name: docker-publish-latest - name: docker-publish-commit-arm64
image: plugins/docker image: plugins/docker
settings: settings:
registry: registry.coadcorp.com registry: registry.coadcorp.com
repo: registry.coadcorp.com/nathan/invertergui repo: registry.coadcorp.com/nathan/invertergui
dockerfile: Dockerfile dockerfile: Dockerfile
platform: linux/amd64,linux/arm64 platform: linux/arm64
experimental: true
buildx_options_semicolon: --platform=linux/amd64,linux/arm64;--provenance=false
username: nathan username: nathan
password: password:
from_secret: registry_password from_secret: registry_password
tags: tags:
- latest - ${DRONE_COMMIT_SHA}-linux-arm64
when:
event:
- push
- name: docker-manifest-commit
image: plugins/manifest
settings:
registry: registry.coadcorp.com
username: nathan
password:
from_secret: registry_password
target: registry.coadcorp.com/nathan/invertergui:${DRONE_COMMIT_SHA}
template: registry.coadcorp.com/nathan/invertergui:${DRONE_COMMIT_SHA}-OS-ARCH
platforms:
- linux/amd64
- linux/arm64
when:
event:
- push
- name: docker-publish-latest-amd64
image: plugins/docker
settings:
registry: registry.coadcorp.com
repo: registry.coadcorp.com/nathan/invertergui
dockerfile: Dockerfile
platform: linux/amd64
username: nathan
password:
from_secret: registry_password
tags:
- latest-linux-amd64
when: when:
event: event:
- push - push
@@ -80,19 +108,88 @@ steps:
- main - main
- master - master
- name: docker-publish-release - name: docker-publish-latest-arm64
image: plugins/docker image: plugins/docker
settings: settings:
registry: registry.coadcorp.com registry: registry.coadcorp.com
repo: registry.coadcorp.com/nathan/invertergui repo: registry.coadcorp.com/nathan/invertergui
dockerfile: Dockerfile dockerfile: Dockerfile
platform: linux/amd64,linux/arm64 platform: linux/arm64
experimental: true
buildx_options_semicolon: --platform=linux/amd64,linux/arm64;--provenance=false
username: nathan username: nathan
password: password:
from_secret: registry_password from_secret: registry_password
auto_tag: true tags:
- latest-linux-arm64
when:
event:
- push
branch:
- main
- master
- name: docker-manifest-latest
image: plugins/manifest
settings:
registry: registry.coadcorp.com
username: nathan
password:
from_secret: registry_password
target: registry.coadcorp.com/nathan/invertergui:latest
template: registry.coadcorp.com/nathan/invertergui:latest-OS-ARCH
platforms:
- linux/amd64
- linux/arm64
when:
event:
- push
branch:
- main
- master
- name: docker-publish-release-amd64
image: plugins/docker
settings:
registry: registry.coadcorp.com
repo: registry.coadcorp.com/nathan/invertergui
dockerfile: Dockerfile
platform: linux/amd64
username: nathan
password:
from_secret: registry_password
tags:
- ${DRONE_TAG}-linux-amd64
when:
event:
- tag
- name: docker-publish-release-arm64
image: plugins/docker
settings:
registry: registry.coadcorp.com
repo: registry.coadcorp.com/nathan/invertergui
dockerfile: Dockerfile
platform: linux/arm64
username: nathan
password:
from_secret: registry_password
tags:
- ${DRONE_TAG}-linux-arm64
when:
event:
- tag
- name: docker-manifest-release
image: plugins/manifest
settings:
registry: registry.coadcorp.com
username: nathan
password:
from_secret: registry_password
target: registry.coadcorp.com/nathan/invertergui:${DRONE_TAG}
template: registry.coadcorp.com/nathan/invertergui:${DRONE_TAG}-OS-ARCH
platforms:
- linux/amd64
- linux/arm64
when: when:
event: event:
- tag - tag