Makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. include config.inc
  2. NAME=sour.is-skillet
  3. VERSION=$(shell debian/inc_version.sh -p $(shell git describe --tags `git rev-list --tags --max-count=1`)|cut -b2-)
  4. VERSION_MIN=$(shell debian/inc_version.sh -m $(VERSION))
  5. VERSION_MAJ=$(shell debian/inc_version.sh -M $(VERSION))
  6. DATE:=$(shell date -u +%FT%TZ)
  7. run: bin/skillet
  8. cd shell && ../bin/skillet -vv connect -u /tmp/skillet.sock
  9. clean:
  10. rm -f bin/*
  11. bin/skillet:
  12. mkdir -p bin
  13. go build -v -o bin/skillet \
  14. -ldflags "-X main.AppVersion=$(VERSION) -X main.AppBuild=$(DATE)"\
  15. sour.is/x/skillet/cmd/skillet;
  16. bin/skillet-lnx64:
  17. mkdir -p bin
  18. export GOOS=linux GOARCH=amd64; \
  19. go build -v -o bin/skillet-lnx64 \
  20. -ldflags "-X main.AppVersion=$(VERSION) -X main.AppBuild=$(DATE)"\
  21. sour.is/x/skillet/cmd/skillet
  22. tag-patch:
  23. git tag -a -m "release version $(VERSION)" "v$(VERSION)"
  24. git push --tags
  25. tag-minor:
  26. git tag -a -m "release version $(VERSION_MIN)" "v$(VERSION_MIN)"
  27. git push --tags
  28. tag-major:
  29. git tag -a -m "release version $(VERSION_MAJ)" "v$(VERSION_MAJ)"
  30. git push --tags
  31. # Creates a deb file
  32. pkg: clean bin/skillet-lnx64
  33. export BUILD="debian/BUILD/$(NAME)_$(VERSION)"; \
  34. rm -rf "debian/BUILD"; \
  35. mkdir -p debian/BUILD; \
  36. cp -r debian/ROOT "$${BUILD}"; \
  37. mkdir -p $$BUILD/opt/sour.is/bin; \
  38. sed -i'.tmp' "s_Version:.*_Version: $(VERSION)_" "$${BUILD}/DEBIAN/control"; \
  39. cp bin/skillet-lnx64 $$BUILD/opt/sour.is/bin/skillet; \
  40. dpkg-deb -b -Zgzip $${BUILD}
  41. REPO_HOST="kapha"
  42. REPO_PATH="/opt/web/pub/sour.is/debian/"
  43. ANSIBLE_HOST="skillet"
  44. copy:
  45. export BUILD="debian/BUILD/$(NAME)_$(VERSION)"; \
  46. scp "$${BUILD}.deb" $(REPO_HOST):$(REPO_PATH); \
  47. ssh $(REPO_HOST) -- $(REPO_PATH)scan.sh "$(REPO_PATH)$(NAME)_$(VERSION).deb";
  48. deploy:
  49. ansible $(ANSIBLE_HOST) -b -m apt -a "name=$(NAME) update_cache=yes state=latest"