feat(ci): use docker buildx for multiarch builds

This commit is contained in:
kolaente 2022-11-12 14:43:29 +01:00
parent 995cc12880
commit c07954f2b8
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 41 additions and 231 deletions

View File

@ -342,111 +342,7 @@ steps:
--- ---
kind: pipeline kind: pipeline
type: docker type: docker
name: docker-arm-release name: docker-release
depends_on:
- release-latest
- release-version
platform:
os: linux
arch: arm64
trigger:
ref:
- refs/heads/main
- "refs/tags/**"
event:
exclude:
- cron
steps:
- name: docker-unstable
image: plugins/docker:linux-arm
pull: always
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: vikunja/frontend
tags: unstable-linux-arm
build_args:
- USE_RELEASE=true
- RELEASE_VERSION=unstable
when:
ref:
- refs/heads/main
depends_on:
- clone
- name: docker-version
image: plugins/docker:linux-arm
pull: always
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: vikunja/frontend
auto_tag: true
auto_tag_suffix: linux-arm
build_args:
- USE_RELEASE=true
- RELEASE_VERSION=${DRONE_TAG##v}
when:
ref:
- "refs/tags/**"
depends_on:
- clone
- name: docker-unstable-arm64
image: plugins/docker:linux-arm64
pull: always
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: vikunja/frontend
tags: unstable-linux-arm64
build_args:
- USE_RELEASE=true
- RELEASE_VERSION=unstable
when:
ref:
- refs/heads/main
depends_on:
- clone
- name: docker-version-arm64
image: plugins/docker:linux-arm64
pull: always
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: vikunja/frontend
auto_tag: true
auto_tag_suffix: linux-arm64
build_args:
- USE_RELEASE=true
- RELEASE_VERSION=${DRONE_TAG##v}
when:
ref:
- "refs/tags/**"
depends_on:
- clone
---
kind: pipeline
type: docker
name: docker-amd64-release
platform:
os: linux
arch: amd64
depends_on: depends_on:
- release-latest - release-latest
@ -461,101 +357,57 @@ trigger:
- cron - cron
steps: steps:
- name: fetch-tags
image: docker:git
commands:
- git fetch --tags
- name: docker-unstable - name: docker-unstable
image: plugins/docker:linux-amd64 image: thegeeklab/drone-docker-buildx
pull: always privileged: true
pull: true
settings: settings:
username: username:
from_secret: docker_username from_secret: docker_username
password: password:
from_secret: docker_password from_secret: docker_password
repo: vikunja/frontend repo: vikunja/frontend
tags: unstable-linux-amd64
build_args:
- USE_RELEASE=true
- RELEASE_VERSION=unstable
when:
ref:
- refs/heads/main
- name: docker-version
image: plugins/docker:linux-amd64
pull: always
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: vikunja/frontend
auto_tag: true
auto_tag_suffix: linux-amd64
build_args:
- USE_RELEASE=true
- RELEASE_VERSION=${DRONE_TAG##v}
when:
ref:
- "refs/tags/**"
---
kind: pipeline
type: docker
name: docker-manifest
trigger:
ref:
- refs/heads/main
- "refs/tags/**"
event:
exclude:
- cron
depends_on:
- docker-amd64-release
- docker-arm-release
steps:
- name: manifest-unstable
pull: always
image: plugins/manifest
settings:
tags: unstable tags: unstable
spec: docker-manifest-unstable.tmpl build_args:
password: - USE_RELEASE=true
from_secret: docker_password - RELEASE_VERSION=unstable
username: platforms:
from_secret: docker_username - linux/386
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64/v8
depends_on: [ fetch-tags ]
when: when:
ref: ref:
- refs/heads/main - refs/heads/main
- name: manifest-release - name: docker-release
pull: always image: thegeeklab/drone-docker-buildx
image: plugins/manifest privileged: true
pull: true
settings: settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: vikunja/frontend
auto_tag: true auto_tag: true
ignore_missing: true build_args:
spec: docker-manifest.tmpl - USE_RELEASE=true
password: - RELEASE_VERSION=${DRONE_TAG##v}
from_secret: docker_password platforms:
username: - linux/386
from_secret: docker_username - linux/amd64
when: - linux/arm/v6
ref: - linux/arm/v7
- "refs/tags/**" - linux/arm64/v8
depends_on: [ fetch-tags ]
- name: manifest-release-latest
pull: always
image: plugins/manifest
depends_on:
- clone
settings:
tags: latest
ignore_missing: true
spec: docker-manifest.tmpl
password:
from_secret: docker_password
username:
from_secret: docker_username
when: when:
ref: ref:
- "refs/tags/**" - "refs/tags/**"
@ -578,9 +430,7 @@ depends_on:
- release-version - release-version
- release-latest - release-latest
- trigger-desktop-update - trigger-desktop-update
- docker-arm-release - docker-release
- docker-amd64-release
- docker-manifest
steps: steps:
- name: notify - name: notify
@ -663,6 +513,6 @@ steps:
from_secret: crowdin_key from_secret: crowdin_key
--- ---
kind: signature kind: signature
hmac: 6784e836f6568c67abfb909449c6e845cc73cbe9a31e9e7ad9166a0eb59e30a2 hmac: 9f26b5af73e3464e9ee1b5fbcb96854ca8a7e5f8d6ee2d85fd8376aad951b446
... ...

View File

@ -1,5 +1,5 @@
# Stage 1: Build application # Stage 1: Build application
FROM node:18-alpine AS compile-image FROM --platform=$BUILDPLATFORM node:18-alpine AS compile-image
WORKDIR /build WORKDIR /build

View File

@ -1,17 +0,0 @@
image: vikunja/frontend:unstable
manifests:
-
image: vikunja/frontend:unstable-linux-amd64
platform:
architecture: amd64
os: linux
-
image: vikunja/frontend:unstable-linux-arm64
platform:
architecture: arm64
os: linux
-
image: vikunja/frontend:unstable-linux-arm
platform:
architecture: arm
os: linux

View File

@ -1,23 +0,0 @@
image: vikunja/frontend:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
-
image: vikunja/frontend:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
platform:
architecture: amd64
os: linux
-
image: vikunja/frontend:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
platform:
architecture: arm64
os: linux
-
image: vikunja/frontend:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm
platform:
architecture: arm
os: linux