flucky/Makefile

37 lines
1.1 KiB
Makefile

# UID/GID
# UID or GID is the UNIX user ID or group ID of the user who executes
# make. If the UID or GID is not passed as a make variable, an attempt
# is made to determine it.
UID?=$(shell id --user)
GID?=$(shell id --group)
# VERSION
# If no version is specified as a parameter of make, the last git hash
# value is taken.
VERSION:=$(or ${TRAVIS_TAG}, ${TRAVIS_TAG}, $(shell git rev-parse --short HEAD)-git)
GOARCH?=amd64
GOOS?=linux
# default build
build:
GOOS=${GOOS} \
GOARCH=${GOARCH} \
go build -ldflags "-X main.version=${VERSION}"
chown -R ${UID}:${GID} *
container-build:
docker run \
--volume ${PWD}:/workspace \
volkerraschek/build-image:1.0.0 \
make build UID=${UID} GID=${GID} VERSION=${VERSION} GOOS=${GOOS} GOARCH=${GOARCH}
hades:
$(MAKE) build GOARCH=arm
scp flucky hades.hellenthal.cryptic.systems:/usr/local/bin
ssh hades.hellenthal.cryptic.systems "chmod +x /usr/local/bin/flucky"
poseidon:
$(MAKE) build GOARCH=arm
scp flucky poseidon.trier.cryptic.systems:/usr/local/bin
ssh poseidon.trier.cryptic.systems "chmod +x /usr/local/bin/flucky"