avatars/Makefile
Andreas Shimokawa 0acd3d10ec make go happy
2019-05-28 11:21:37 +02:00

37 lines
912 B
Makefile
Executable File

HOSTNAME_FQDN := codeberg.org
export BUILDDIR := /tmp/build
export GOROOT := ${BUILDDIR}/go
export GOPATH := ${BUILDDIR}/gitea
export PATH := ${GOROOT}/bin:${GOPATH}/bin:${PATH}
GOTAR = go1.12.1.$(shell uname | tr [:upper:] [:lower:])-amd64.tar.gz
ORIGIN = ssh://prlgc.com/git/gogs-gitea
TARGETS = ${GOPATH}/bin/avatar
all : ${TARGETS}
${GOPATH}/bin/avatar : main.go ${GOROOT}/bin/go
go build -o $@ $<
deployment : deploy-avatar
deploy-avatar : ${GOPATH}/bin/avatar
-ssh root@${HOSTNAME_FQDN} systemctl stop avatar
scp $< root@${HOSTNAME_FQDN}:/usr/local/bin/
scp -r etc/* root@${HOSTNAME_FQDN}:/etc/
ssh root@${HOSTNAME_FQDN} systemctl daemon-reload
ssh root@${HOSTNAME_FQDN} systemctl enable avatar
ssh root@${HOSTNAME_FQDN} systemctl start avatar
ssh root@${HOSTNAME_FQDN} systemctl status avatar
clean :
${MAKE} -C ${GOPATH}/src/code.gitea.io/gitea clean
realclean :
rm -rf ${BUILDDIR}