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:
name: linux-amd64
kind: pipeline
name: linux-amd64
platform:
name: linux/amd64
os: linux
arch: amd64
pipeline:
- test:
steps:
- name: test
image: golang:1.10
commands:
- cd posix
- tar -xf fixtures.tar -C /
- go test -v
- publish:
image: plugins/docker
- image: plugins/docker
settings:
auto_tag: true
auto_tag_suffix: linux-amd64
dockerfile: docker/Dockerfile.linux.amd64
password:
$secret: password
repo: drone/git
secrets:
- docker_username
- docker_password
username:
$secret: username
when:
event:
- push
- tag
secrets:
docker_username:
external:
name: drone/docker#username
docker_password:
external:
name: drone/docker#password
---
metadata:
name: linux-arm64
kind: pipeline
name: linux-arm64
platform:
name: linux/arm64
os: linux
arch: arm64
pipeline:
- test:
image: arm64v8/golang:1.10
steps:
- name: test
image: golang:1.10
commands:
- cd posix
- tar -xf fixtures.tar -C /
- go test -v
- publish:
image: plugins/docker:linux-arm64
dockerfile: docker/Dockerfile.linux.arm64
repo: drone/git
- image: plugins/docker:linux-arm64
settings:
auto_tag: true
auto_tag_suffix: linux-arm64
secrets:
- docker_username
- docker_password
dockerfile: docker/Dockerfile.linux.arm64
password:
$secret: password
repo: drone/git
username:
$secret: username
when:
event:
- push
- tag
secrets:
docker_username:
external:
name: drone/docker#username
docker_password:
external:
name: drone/docker#password
---
metadata:
name: linux-arm
kind: pipeline
name: linux-arm
platform:
name: linux/arm
os: linux
arch: arm
pipeline:
- test:
image: arm32v7/golang:1.10.3
steps:
- name: test
image: golang:1.10
commands:
- cd posix
- tar -xf fixtures.tar -C /
- go test -v
- publish:
image: plugins/docker:linux-arm
dockerfile: docker/Dockerfile.linux.arm
repo: drone/git
- image: plugins/docker:linux-arm
settings:
auto_tag: true
auto_tag_suffix: linux-arm
secrets:
- docker_username
- docker_password
dockerfile: docker/Dockerfile.linux.arm
password:
$secret: password
repo: drone/git
username:
$secret: username
when:
event:
- push
- tag
secrets:
docker_username:
external:
name: drone/docker#username
docker_password:
external:
name: drone/docker#password
---
kind: pipeline
name: after
platform:
os: linux
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