first commit
This commit is contained in:
commit
e6e4fac6c7
21
build.yaml
Normal file
21
build.yaml
Normal 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
28
multiarch.yaml
Normal 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
21
publish.yaml
Normal 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
35
readme.md
Normal 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
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user