added manifest feature #4

Merged
nils merged 1 commits from feature/manifest into master 2021-01-03 16:06:15 +00:00
3 changed files with 52 additions and 7 deletions
Showing only changes of commit 9362979e13 - Show all commits

View File

@ -1,6 +1,10 @@
local pipeline(os, arch) = {
kind: "pipeline",
name: "build " + os + "/" + arch,
name: os + "/" + arch,
platform: {
"os": os,
"arch": arch,
},
steps: [{
name: "compile " + os + "/" + arch,
image: "golang:1.15.6-alpine3.12",
@ -34,7 +38,7 @@ local pipeline(os, arch) = {
username: { "from_secret": "docker_username" },
password: { "from_secret": "docker_password" },
auto_tag: true,
//auto_tag_suffix: os + "-" + arch
auto_tag_suffix: os + "-" + arch
},
when: {
event: "tag"
@ -43,10 +47,32 @@ local pipeline(os, arch) = {
],
};
local manifest() = {
kind: "pipeline",
type: "docker",
name: "manifest",
depends_on: ["linux/arm64", "linux/amd64"],
when: {
event: "tag"
},
steps: [
{
name: "publish",
image: "plugins/manifest",
settings: {
auto_tag: true,
ignore_missing: true,
spec: "manifest.yml",
username: { "from_secret": "docker_username" },
password: { "from_secret": "docker_password" },
},
},
],
};
[
pipeline("linux", "amd64"),
// pipeline("linux", "arm64"),
// pipeline("darwin", "amd64"),
// pipeline("darwin", "arm64"),
// pipeline("windows", "amd64"),
pipeline("linux", "arm64"),
manifest()
]

View File

@ -1,4 +1,4 @@
FROM alpine:3.12.3
FROM alpine
WORKDIR /opt/
ADD ./release/*/*/ubnt-freifunk-map-api /opt/ubnt-freifunk-map-api

19
manifest.yml Normal file
View File

@ -0,0 +1,19 @@
image: fftdf/ffmap-ubnt-api:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
{{#if build.tags}}
tags:
- "latest"
{{#each build.tags}}
- {{this}}
{{/each}}
{{/if}}
manifests:
-
image: fftdf/ffmap-ubnt-api:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
platform:
architecture: amd64
os: linux
-
image: fftdf/ffmap-ubnt-api:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
platform:
architecture: arm64
os: linux