infrastructure/.drone.yml
Peter Kurfer c592010f90
All checks were successful
continuous-integration/drone/push Build is passing
feat: prepare GhostCMS
2023-11-01 19:47:08 +01:00

122 lines
3.9 KiB
YAML

---
kind: pipeline
type: docker
name: default
platform:
arch: arm64
steps:
- name: keydb
image: quay.io/buildah/stable
network_mode: host
privileged: true
commands:
- buildah login "$${IMAGE_REGISTRY}" --username "$${GITEA_USER}" --password "$${GITEA_TOKEN}"
- buildah pull "docker.io/eqalpha/keydb:x86_64_$${IMAGE_TAG}"
- buildah tag "docker.io/eqalpha/keydb:x86_64_$${IMAGE_TAG}" "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:x86_64_$${IMAGE_TAG}"
- buildah pull "docker.io/eqalpha/keydb:arm64_$${IMAGE_TAG}"
- buildah tag "docker.io/eqalpha/keydb:arm64_$${IMAGE_TAG}" "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:arm64_$${IMAGE_TAG}"
- buildah manifest create "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}"
- buildah manifest add "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}" "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:x86_64_$${IMAGE_TAG}"
- buildah manifest add "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}" "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:arm64_$${IMAGE_TAG}"
- 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/infrastructure/keydb
IMAGE_TAG: v6.3.3
---
kind: pipeline
type: docker
name: arm64
platform:
arch: 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 bud \
--tag "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}" \
--arch $${IMAGE_ARCH} \
apps/ghostcms
buildah push "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}"
environment:
GITEA_USER: prskr
GITEA_TOKEN:
from_secret: gitea_token
IMAGE_REGISTRY: code.icb4dc0.de
IMAGE_REPO: prskr/ghostcms
IMAGE_TAG: 5.71.0-alpine_arm64
IMAGE_ARCH: arm64
---
kind: pipeline
type: docker
name: amd64
platform:
arch: amd64
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 bud \
--tag "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}" \
--arch $${IMAGE_ARCH} \
apps/ghostcms
buildah push "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}"
environment:
GITEA_USER: prskr
GITEA_TOKEN:
from_secret: gitea_token
IMAGE_REGISTRY: code.icb4dc0.de
IMAGE_REPO: prskr/ghostcms
IMAGE_TAG: 5.71.0-alpine_amd64
IMAGE_ARCH: amd64
---
kind: pipeline
type: docker
name: manifest
platform:
arch: arm64
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}:$${DRONE_COMMIT_SHA}"
buildah pull --arch amd64 "docker://$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}_amd64"
buildah pull --arch arm64 "docker://$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}_arm64"
buildah manifest add "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${DRONE_COMMIT_SHA}" "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}_amd64"
buildah manifest add "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${DRONE_COMMIT_SHA}" "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${IMAGE_TAG}_arm64"
buildah manifest push --all "$${IMAGE_REGISTRY}/$${IMAGE_REPO}:$${DRONE_COMMIT_SHA}" "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/ghostcms
IMAGE_TAG: 5.71.0-alpine