From 4ea2ba1fb872c55911ce6706ac617f94b740c685 Mon Sep 17 00:00:00 2001 From: Paolo Asperti Date: Fri, 10 Jun 2022 23:43:16 +0200 Subject: [PATCH] multiarch --- .drone.yml | 108 +++++++++++++++++++++++++++++++++++++++++++++++--- manifest.tmpl | 31 +++++++++++++++ 2 files changed, 134 insertions(+), 5 deletions(-) create mode 100644 manifest.tmpl diff --git a/.drone.yml b/.drone.yml index fbab43e..1bddf65 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,11 +1,16 @@ kind: pipeline type: docker -name: default +name: linux-amd64 + +platform: + arch: amd64 + os: linux steps: - name: build_and_publish image: plugins/docker:linux-amd64 settings: + dockerfile: Dockerfile force_tag: true password: from_secret: docker_password @@ -14,11 +19,104 @@ steps: username: from_secret: docker_username tags: - - latest - - ${DRONE_TAG} - - ${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR} - - ${DRONE_SEMVER_MAJOR} + - ${DRONE_TAG}-linux-amd64 + - ${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR}-linux-amd64 + - ${DRONE_SEMVER_MAJOR}-linux-amd64 trigger: event: - tag + - push + +--- +kind: pipeline +type: docker +name: linux-arm64 + +platform: + arch: arm64 + os: linux + +steps: + - name: build_and_publish + image: plugins/docker:linux-arm64 + settings: + dockerfile: Dockerfile + force_tag: true + password: + from_secret: docker_password + registry: docker.asperti.com + repo: docker.asperti.com/paspo/ftps + username: + from_secret: docker_username + tags: + - ${DRONE_TAG}-linux-arm64 + - ${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR}-linux-arm64 + - ${DRONE_SEMVER_MAJOR}-linux-arm64 + +trigger: + event: + - tag + +--- +kind: pipeline +type: docker +name: linux-arm + +platform: + arch: arm + os: linux + +steps: + - name: build_and_publish + image: plugins/docker:linux-arm + settings: + dockerfile: Dockerfile + force_tag: true + password: + from_secret: docker_password + registry: docker.asperti.com + repo: docker.asperti.com/paspo/ftps + username: + from_secret: docker_username + tags: + - ${DRONE_TAG}-linux-arm + - ${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR}-linux-arm + - ${DRONE_SEMVER_MAJOR}-linux-arm + +trigger: + event: + - tag + - push + +--- +kind: pipeline +type: docker +name: manifest + +steps: +- name: manifest + image: plugins/manifest + settings: + auto_tag: "true" + ignore_missing: "true" + spec: manifest.tmpl + username: + from_secret: docker_username + password: + from_secret: docker_password + tags: + - latest + - ${DRONE_TAG} + - ${DRONE_SEMVER_MAJOR}.${DRONE_SEMVER_MINOR} + - ${DRONE_SEMVER_MAJOR} + +trigger: + event: + - push + - tag + +depends_on: +- linux-amd64 +# - linux-arm64 +- linux-arm diff --git a/manifest.tmpl b/manifest.tmpl new file mode 100644 index 0000000..f2a3322 --- /dev/null +++ b/manifest.tmpl @@ -0,0 +1,31 @@ +image: docker.asperti.com/paspo/ftps:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} +{{#if build.tags}} +tags: +{{#each build.tags}} + - {{this}} +{{/each}} +{{/if}} +manifests: + - + image: docker.asperti.com/paspo/ftps:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 + platform: + architecture: amd64 + os: linux + - + image: docker.asperti.com/paspo/ftps:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64 + platform: + variant: v8 + architecture: arm64 + os: linux + - + image: docker.asperti.com/paspo/ftps:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm + platform: + variant: v7 + architecture: arm + os: linux + - + image: docker.asperti.com/paspo/ftps:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm + platform: + variant: v6 + architecture: arm + os: linux