CI and Dockerfile updated
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Stefan Hoffmann 2021-01-02 19:04:11 +01:00
parent e15708fb6b
commit 40fcff34b6
2 changed files with 28 additions and 6 deletions

View File

@ -1,12 +1,34 @@
kind: pipeline
name: build-ffmap-ubnt-api
type: docker
name: build go
steps:
- name: build go
- name: build linux/amd64
image: golang
commands:
- go build .
- go build -ldflags "-X main.version=${DRONE_TAG}" -o release/linux/amd64/ubnt-freifunk-map-api .
- tar -cvzf release/ubnt-freifunk-map-api_linux_amd64.tar.gz -C release/linux/amd64 ubnt-freifunk-map-api
environment:
GOARCH: amd64
GOOS: linux
- name: build linux/arm64
image: golang
commands:
- go build -ldflags "-X main.version=${DRONE_TAG}" -o release/linux/arm64/ubnt-freifunk-map-api .
- tar -cvzf release/ubnt-freifunk-map-api_linux_arm64.tar.gz -C release/linux/arm64 ubnt-freifunk-map-api
environment:
GOARCH: arm64
GOOS: linux
- name: build windows
image: golang
commands:
- go build -ldflags "-X main.version=${DRONE_TAG}" -o release/windows/amd64/ubnt-freifunk-map-api .
- tar -cvzf release/ubnt-freifunk-map-api_windows_amd64.tar.gz -C release/windows/amd64 ubnt-freifunk-map-api
environment:
GOARCH: amd64
GOOS: windows
- name: docker
image: plugins/docker
@ -26,7 +48,7 @@ steps:
from_secret: gitea_api_key
base_url: https://git.freifunk-rhein-sieg.net
files:
- ubnt-freifunk-map-api
- release/*.tar.gz
title: ${DRONE_TAG}
checksum:
- md5

View File

@ -1,7 +1,7 @@
FROM alpine:latest
WORKDIR /opt/
ADD ./ubnt-freifunk-map-api /opt/ubnt-freifunk-map-api
ADD ./release/linux/arm64/ubnt-freifunk-map-api /opt/ubnt-freifunk-map-api
ADD ./devices.json /opt/devices.json
RUN chmod +x /opt/ubnt-freifunk-map-api