first commit

This commit is contained in:
James Brumond 2022-12-03 14:20:30 -08:00
commit e6e4fac6c7
Signed by: james
GPG Key ID: 24BA25B8B303B023
4 changed files with 105 additions and 0 deletions

21
build.yaml Normal file
View File

@ -0,0 +1,21 @@
---
kind: pipeline
type: kubernetes
name: build-{{ .input.os }}-{{ .input.arch }}
trigger:
event: [ push ]
branch: [ master ]
steps:
- name: build
image: plugins/docker
settings:
registry: https://gitea.internal.example.com
username: drone
password:
from_secret: gitea-internal-password
repo: gitea.internal.example.com/{{ .input.repo }}-{{ .input.os }}-{{ .input.arch }}
cache_from: gitea.internal.example.com/{{ .input.repo }}-{{ .input.os }}-{{ .input.arch }}:ci
tags:
- "ci"

28
multiarch.yaml Normal file
View File

@ -0,0 +1,28 @@
---
kind: pipeline
type: kubernetes
name: publish-multiarch-manifest
trigger:
event: [ promote ]
target: [ publish ]
steps:
- name: publish-manifest
image: plugins/manifest
settings:
registry: https://gitea.internal.example.com
username: drone
password:
from_secret: gitea-internal-password
target: gitea.internal.example.com/{{ .input.repo }}
template: gitea.internal.example.com/{{ .input.repo }}-OS-ARCH
platforms:
{{ range .input.platforms }}
- {{ .os }}/{{ .arch }}
{{ end }}
depends_on:
{{ range .input.platforms }}
- publish-{{ .os }}-{{ .arch }}
{{ range .input.platforms }}

21
publish.yaml Normal file
View File

@ -0,0 +1,21 @@
---
kind: pipeline
type: kubernetes
name: publish-{{ .input.os }}-{{ .input.arch }}
trigger:
event: [ promote ]
target: [ "publish-{{ .input.os }}-{{ .input.arch }}" ]
steps:
- name: build-and-publish
image: plugins/docker
settings:
registry: https://gitea.internal.example.com
username: drone
password:
from_secret: gitea-internal-password
repo: gitea.internal.example.com/{{ .input.repo }}-{{ .input.os }}-{{ .input.arch }}
cache_from: gitea.internal.example.com/{{ .input.repo }}-{{ .input.os }}-{{ .input.arch }}:ci
tags:
- "latest"

35
readme.md Normal file
View File

@ -0,0 +1,35 @@
## Drone CI Pipeline Templates for Multi-Arch Builds
See https://blog.jbrumond.me/post/raspberry-pi-cluster-part-4:-gitea-and-drone for more info
### Usage
```yaml
---
kind: template
load: build.yaml
data:
repo: examples/docker
os: linux
arch: arm64
---
kind: template
load: publish.yaml
data:
repo: examples/docker
os: linux
arch: arm64
---
kind: template
load: multiarch.yaml
data:
repo: examples/docker
platforms:
- os: linux
arch: arm64
```