setup docker manifest plugin

This commit is contained in:
Brad Rydzewski 2018-09-17 13:44:45 -07:00
parent fb83dd1476
commit 0745333899
2 changed files with 137 additions and 84 deletions

View File

@ -1,108 +1,130 @@
--- ---
metadata: kind: pipeline
name: linux-amd64 name: linux-amd64
platform: platform:
name: linux/amd64 os: linux
arch: amd64
pipeline: steps:
- test: - name: test
image: golang:1.10 image: golang:1.10
commands: commands:
- cd posix - cd posix
- tar -xf fixtures.tar -C / - tar -xf fixtures.tar -C /
- go test -v - go test -v
- publish: - image: plugins/docker
image: plugins/docker settings:
auto_tag: true
auto_tag_suffix: linux-amd64
dockerfile: docker/Dockerfile.linux.amd64 dockerfile: docker/Dockerfile.linux.amd64
password:
$secret: password
repo: drone/git repo: drone/git
secrets: username:
- docker_username $secret: username
- docker_password
when: when:
event: event:
- push - push
- tag - tag
secrets:
docker_username:
external:
name: drone/docker#username
docker_password:
external:
name: drone/docker#password
--- ---
metadata: kind: pipeline
name: linux-arm64 name: linux-arm64
platform: platform:
name: linux/arm64 os: linux
arch: arm64
pipeline: steps:
- test: - name: test
image: arm64v8/golang:1.10 image: golang:1.10
commands: commands:
- cd posix - cd posix
- tar -xf fixtures.tar -C / - tar -xf fixtures.tar -C /
- go test -v - go test -v
- publish: - image: plugins/docker:linux-arm64
image: plugins/docker:linux-arm64 settings:
dockerfile: docker/Dockerfile.linux.arm64
repo: drone/git
auto_tag: true auto_tag: true
auto_tag_suffix: linux-arm64 auto_tag_suffix: linux-arm64
secrets: dockerfile: docker/Dockerfile.linux.arm64
- docker_username password:
- docker_password $secret: password
repo: drone/git
username:
$secret: username
when: when:
event: event:
- push - push
- tag - tag
secrets:
docker_username:
external:
name: drone/docker#username
docker_password:
external:
name: drone/docker#password
--- ---
metadata: kind: pipeline
name: linux-arm name: linux-arm
platform: platform:
name: linux/arm os: linux
arch: arm
pipeline: steps:
- test: - name: test
image: arm32v7/golang:1.10.3 image: golang:1.10
commands: commands:
- cd posix - cd posix
- tar -xf fixtures.tar -C / - tar -xf fixtures.tar -C /
- go test -v - go test -v
- publish: - image: plugins/docker:linux-arm
image: plugins/docker:linux-arm settings:
dockerfile: docker/Dockerfile.linux.arm
repo: drone/git
auto_tag: true auto_tag: true
auto_tag_suffix: linux-arm auto_tag_suffix: linux-arm
secrets: dockerfile: docker/Dockerfile.linux.arm
- docker_username password:
- docker_password $secret: password
repo: drone/git
username:
$secret: username
when: when:
event: event:
- push - push
- tag - tag
secrets: ---
docker_username: kind: pipeline
external: name: after
name: drone/docker#username
docker_password: platform:
external: os: linux
name: drone/docker#password arch: amd64
steps:
- name: manifest
image: plugins/manifest:1
settings:
ignore_missing: true
password:
$secret: password
spec: docker/manifest.tmpl
username:
$secret: username
when:
branch:
- master
event:
- push
depends_on:
- linux-arm
- linux-arm64
- linux-amd64
---
kind: secret
type: external
data:
password: "drone/docker#password"
username: "drone/docker#username"
...

31
docker/manifest.tmpl Normal file
View File

@ -0,0 +1,31 @@
image: drone/git:latest
manifests:
-
image: drone/git:linux-amd64
platform:
architecture: amd64
os: linux
-
image: drone/git:linux-arm64
platform:
variant: v8
architecture: arm64
os: linux
-
image: drone/git:linux-arm
platform:
variant: v7
architecture: arm
os: linux
-
image: drone/git:linux-arm
platform:
variant: v6
architecture: arm
os: linux
-
image: drone/git:windows-1803
platform:
architecture: arm
os: linux
os.version: 10.0.17134.165