2017-04-24 09:20:46 -06:00
|
|
|
NAME=sour.is-paste
|
|
|
|
VERSION=$(shell cat VERSION)
|
|
|
|
RELEASE=$(shell cat RELEASE)
|
|
|
|
|
2018-02-15 09:11:52 -07:00
|
|
|
REPO_HOST="kapha"
|
2017-04-24 09:20:46 -06:00
|
|
|
REPO_PATH="/opt/web/pub/sour.is/debian/"
|
|
|
|
|
|
|
|
all: release build copy
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -r BUILD/*
|
|
|
|
|
|
|
|
release:
|
|
|
|
export RELEASE=`cat RELEASE`; \
|
|
|
|
echo `expr $${RELEASE} + 1` > RELEASE
|
|
|
|
|
|
|
|
build:
|
|
|
|
export VERSION=`cat VERSION`; \
|
|
|
|
export RELEASE=`cat RELEASE`; \
|
|
|
|
export DATE=`date -u +%FT%TZ`; \
|
|
|
|
export BUILD="BUILD/$(NAME)_$${VERSION}-$${RELEASE}"; \
|
|
|
|
rm -rf ./$${BUILD}; \
|
|
|
|
cp -r ROOT "$${BUILD}"; \
|
2018-03-13 16:25:18 -06:00
|
|
|
sed -i'.tmp' "s_Version:.*_Version: $${VERSION}-$${RELEASE}_" "$${BUILD}/DEBIAN/control"
|
|
|
|
|
|
|
|
export VERSION=`cat VERSION`; \
|
|
|
|
export RELEASE=`cat RELEASE`; \
|
|
|
|
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 \
|
2018-02-15 08:01:35 -07:00
|
|
|
-ldflags "-X main.AppVersion=$${VERSION}-$${RELEASE} -X main.AppBuild=$${DATE}"\
|
2017-04-24 09:20:46 -06:00
|
|
|
sour.is/x/paste; \
|
|
|
|
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";
|
2017-04-24 09:20:46 -06:00
|
|
|
|
|
|
|
deploy:
|
2018-02-15 09:11:52 -07:00
|
|
|
ansible $(REPO_HOST) -s -m apt -a "name=sour.is-paste update_cache=yes state=latest"
|
2018-03-13 16:25:18 -06:00
|
|
|
|
|
|
|
.PHONY: clean release build copy # deploy
|