ubnt-freifunk-map-api/.drone.jsonnet

54 lines
1.4 KiB
Plaintext
Raw Normal View History

2021-01-02 22:23:58 +00:00
local pipeline(os, arch) = {
2021-01-02 22:22:07 +00:00
kind: "pipeline",
2021-01-03 16:03:09 +00:00
name: os + "/" + arch,
platform: {
"os": os,
"arch": arch,
},
2021-01-02 22:01:44 +00:00
steps: [{
2021-01-02 22:20:26 +00:00
name: "compile " + os + "/" + arch,
2023-04-28 18:06:57 +00:00
image: "golang:1.20.3-alpine3.17",
2021-01-02 22:01:44 +00:00
environment: {
"GOOS": os,
"GOARCH": arch,
"CGO_ENABLED": "0",
},
commands: [
2021-01-02 22:20:26 +00:00
'go build -ldflags "-s -w -X main.version=${DRONE_TAG##v}" -trimpath -o release/' + os + "/" + arch + "/ubnt-freifunk-map-api .",
2021-01-02 22:36:27 +00:00
"tar -cvzf release/ubnt-freifunk-map-api_"+ os + "-" + arch + ".tar.gz -C release/" + os + "/" + arch + " ubnt-freifunk-map-api"
2021-01-02 22:01:44 +00:00
],
},
{
name: "gitea_release " + os + "/" + arch,
image: "plugins/gitea-release",
settings: {
2021-01-02 23:22:14 +00:00
api_key: { "from_secret": "gitea_api_key" },
base_url: "https://git.freifunk-rhein-sieg.net",
files: "release/*.tar.gz"
},
when: {
event: "tag"
},
},
2021-01-02 23:39:50 +00:00
{
2023-04-28 20:37:31 +00:00
name: "upload to gitea container registry",
image: "plugins/docker:latest",
2021-01-02 23:39:50 +00:00
settings: {
2023-04-28 20:22:55 +00:00
repo: "git.freifunk-rhein-sieg.net/freifunk-troisdorf/ubnt-freifunk-map-api",
2023-04-28 19:52:43 +00:00
registry: "git.freifunk-rhein-sieg.net",
2021-01-02 23:39:50 +00:00
username: { "from_secret": "docker_username" },
password: { "from_secret": "docker_password" },
2023-04-28 20:45:07 +00:00
tags: {"latest"},
2021-01-02 23:39:50 +00:00
auto_tag: true,
},
when: {
event: "tag"
},
},
2021-01-02 22:01:44 +00:00
],
};
2021-01-02 23:19:39 +00:00
2021-01-02 22:01:44 +00:00
[
2023-04-28 20:34:55 +00:00
pipeline("linux", "amd64")
2023-04-28 20:09:25 +00:00
]