ubnt-freifunk-map-api/.drone.jsonnet
Stefan Hoffmann 93dbdb0ac7
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
only build linux/amd64, other testting in testing branch
2021-01-03 12:38:46 +01:00

52 lines
1.5 KiB
Plaintext

local pipeline(os, arch) = {
kind: "pipeline",
name: "build " + os + "/" + arch,
steps: [{
name: "compile " + os + "/" + arch,
image: "golang:1.15.6-alpine3.12",
environment: {
"GOOS": os,
"GOARCH": arch,
"CGO_ENABLED": "0",
},
commands: [
'go build -ldflags "-s -w -X main.version=${DRONE_TAG##v}" -trimpath -o release/' + os + "/" + arch + "/ubnt-freifunk-map-api .",
"tar -cvzf release/ubnt-freifunk-map-api_"+ os + "-" + arch + ".tar.gz -C release/" + os + "/" + arch + " ubnt-freifunk-map-api"
],
},
{
name: "gitea_release " + os + "/" + arch,
image: "plugins/gitea-release",
settings: {
api_key: { "from_secret": "gitea_api_key" },
base_url: "https://git.freifunk-rhein-sieg.net",
files: "release/*.tar.gz"
},
when: {
event: "tag"
},
},
{
name: "upload to docker hub " + os + "/" + arch,
image: "plugins/docker:" + os + "-" + arch,
settings: {
repo: "fftdf/ffmap-ubnt-api",
username: { "from_secret": "docker_username" },
password: { "from_secret": "docker_password" },
auto_tag: true,
auto_tag_suffix: os + "-" + arch
},
when: {
event: "tag"
},
},
],
};
[
pipeline("linux", "amd64"),
// pipeline("linux", "arm64"),
// pipeline("darwin", "amd64"),
// pipeline("darwin", "arm64"),
// pipeline("windows", "amd64"),
]