multiple arch CI build
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
48
.drone.yml
48
.drone.yml
@@ -3,19 +3,37 @@ kind: pipeline
|
|||||||
name: unit
|
name: unit
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
# -------------------- tests (host arch only) --------------------
|
||||||
image: golang
|
- name: test
|
||||||
pull: if-not-exists
|
image: golang:1.22-alpine
|
||||||
commands:
|
pull: if-not-exists
|
||||||
- go test
|
commands:
|
||||||
- go build
|
- go test ./...
|
||||||
|
|
||||||
|
# -------------------- build + push multi-arch image --------------------
|
||||||
|
- name: publish
|
||||||
|
image: plugins/docker:latest
|
||||||
|
privileged: true # needed for docker/buildx
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: docker-user
|
||||||
|
password:
|
||||||
|
from_secret: docker-pw
|
||||||
|
repo:
|
||||||
|
from_secret: docker-repo
|
||||||
|
|
||||||
|
# build context & dockerfile
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
|
||||||
|
# enable buildx / multi-arch
|
||||||
|
buildx: true
|
||||||
|
platforms:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
|
- linux/arm/v7
|
||||||
|
|
||||||
|
# tags to push (all as a single multi-arch manifest)
|
||||||
|
tags:
|
||||||
|
- latest
|
||||||
|
|
||||||
- name: publish
|
|
||||||
image: plugins/docker:latest
|
|
||||||
settings:
|
|
||||||
username:
|
|
||||||
from_secret: docker-user
|
|
||||||
password:
|
|
||||||
from_secret: docker-pw
|
|
||||||
repo:
|
|
||||||
from_secret: docker-repo
|
|
||||||
|
|||||||
Reference in New Issue
Block a user