feat(ci): build multi-arch blog image
All checks were successful
continuous-integration/drone Build is passing
All checks were successful
continuous-integration/drone Build is passing
This commit is contained in:
parent
f3ff91370d
commit
e6040be0b4
1 changed files with 75 additions and 0 deletions
75
.drone.yml
Normal file
75
.drone.yml
Normal file
|
@ -0,0 +1,75 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: amd64
|
||||
|
||||
platform:
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: image build
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
network_mode: host
|
||||
commands:
|
||||
- >
|
||||
echo "{\"auths\": {\"https://code.icb4dc0.de\": {\"auth\" : \"$(printf '%s:%s' $$GITEA_USER $$GITEA_TOKEN | base64)\" }}}" > /kaniko/.docker/config.json
|
||||
- /kaniko/executor --destination "$${IMAGE_REPO}:$${IMAGE_TAG}" --context "$${BUILD_CONTEXT}"
|
||||
environment:
|
||||
GITEA_USER: prskr
|
||||
GITEA_TOKEN:
|
||||
from_secret: gitea_token
|
||||
IMAGE_REPO: code.icb4dc0.de/prskr/blog
|
||||
IMAGE_TAG: x86_64
|
||||
BUILD_CONTEXT: .
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: arm64
|
||||
|
||||
platform:
|
||||
arch: arm64
|
||||
|
||||
steps:
|
||||
- name: image build
|
||||
image: gcr.io/kaniko-project/executor:debug
|
||||
network_mode: host
|
||||
commands:
|
||||
- >
|
||||
echo "{\"auths\": {\"https://code.icb4dc0.de\": {\"auth\" : \"$(printf '%s:%s' $$GITEA_USER $$GITEA_TOKEN | base64)\" }}}" > /kaniko/.docker/config.json
|
||||
- /kaniko/executor --destination "$${IMAGE_REPO}:$${IMAGE_TAG}" --context "$${BUILD_CONTEXT}"
|
||||
environment:
|
||||
GITEA_USER: prskr
|
||||
GITEA_TOKEN:
|
||||
from_secret: gitea_token
|
||||
IMAGE_REPO: code.icb4dc0.de/prskr/blog
|
||||
IMAGE_TAG: arm64
|
||||
BUILD_CONTEXT: .
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: deploy
|
||||
|
||||
depends_on:
|
||||
- amd64
|
||||
- arm64
|
||||
|
||||
steps:
|
||||
- name: manifest
|
||||
image: quay.io/buildah/stable
|
||||
network_mode: host
|
||||
privileged: true
|
||||
commands:
|
||||
- buildah login "$${IMAGE_REGISTRY}" --username "$${GITEA_USER}" --password "$${GITEA_TOKEN}"
|
||||
- buildah manifest create "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}"
|
||||
- buildah manifest add "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}" "docker://$${IMAGE_REGISTRY}/$${IMAGE_REPO}:x86_64"
|
||||
- buildah manifest add "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}" "docker://$${IMAGE_REGISTRY}/$${IMAGE_REPO}:arm64"
|
||||
- buildah manifest push --all "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}" "docker://$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}"
|
||||
environment:
|
||||
GITEA_USER: prskr
|
||||
GITEA_TOKEN:
|
||||
from_secret: gitea_token
|
||||
IMAGE_REGISTRY: code.icb4dc0.de
|
||||
IMAGE_REPO: prskr/blog
|
||||
IMAGE_TAG: latest
|
Loading…
Reference in a new issue