go-paste/debian/Makefile

43 lines
1.3 KiB
Makefile
Raw Normal View History

NAME=sour.is-paste
VERSION=$(shell cat VERSION)
RELEASE=$(shell cat RELEASE)
2018-02-15 09:11:52 -07:00
REPO_HOST="kapha"
REPO_PATH="/opt/web/pub/sour.is/debian/"
all: release build copy
clean:
rm -r BUILD/*
release:
echo `expr $${RELEASE} + 1` > RELEASE
2020-08-17 09:40:10 -06:00
git commit -am "release version $${RELEASE}"
2020-08-17 11:54:01 -06:00
git tag -a -m "release version $${RELEASE}"
2020-08-17 09:40:10 -06:00
git push --tags
build:
export BUILD="BUILD/$(NAME)_$${VERSION}-$${RELEASE}"; \
rm -rf ./$${BUILD}; \
cp -r ROOT "$${BUILD}"; \
sed -i'.tmp' "s_Version:.*_Version: $${VERSION}-$${RELEASE}_" "$${BUILD}/DEBIAN/control"
2020-08-17 09:40:10 -06:00
export DATE=`date -u +%FT%TZ`; \
export BUILD="BUILD/$(NAME)_$${VERSION}-$${RELEASE}"; \
env GOOS=linux GOARCH=amd64 go build -v -o $${BUILD}/opt/sour.is/bin/paste \
-ldflags "-X main.AppVersion=$${VERSION}-$${RELEASE} -X main.AppBuild=$${DATE}"\
sour.is/x/paste/cmd/paste; \
2018-03-23 17:07:31 -06:00
dpkg -b $${BUILD};
copy:
export VERSION=`cat VERSION`; \
export RELEASE=`cat RELEASE`; \
export BUILD="BUILD/$(NAME)_$${VERSION}-$${RELEASE}"; \
2018-02-15 09:11:52 -07:00
scp "$${BUILD}.deb" $(REPO_HOST):$(REPO_PATH); \
ssh $(REPO_HOST) -- $(REPO_PATH)scan.sh "$(REPO_PATH)$(NAME)_$${VERSION}-$${RELEASE}.deb";
deploy:
2018-04-27 16:44:44 -06:00
ansible $(REPO_HOST) -b -m apt -a "name=sour.is-paste update_cache=yes state=latest"
2018-04-27 16:44:44 -06:00
.PHONY: clean release build copy # deploy