2022-05-16 16:41:23 +03:00
|
|
|
MAKEFLAGS := --jobs=1
|
2023-11-17 05:03:23 +03:00
|
|
|
PYTHON := python3
|
|
|
|
PIP := pip3
|
2021-10-24 04:29:45 +03:00
|
|
|
VERSION := $(shell git describe --tag)
|
2022-08-01 22:34:14 +03:00
|
|
|
COMMIT := $(shell git rev-parse --short HEAD)
|
2021-10-24 04:29:45 +03:00
|
|
|
|
|
|
|
.PHONY:
|
|
|
|
|
|
|
|
help:
|
2022-03-18 20:53:52 +03:00
|
|
|
@echo "Typical commands (more see below):"
|
2022-05-21 17:08:33 +03:00
|
|
|
@echo " make build - Build web app, documentation and server/client (sloowwww)"
|
|
|
|
@echo " make cli-linux-amd64 - Build server/client binary (amd64, no web app or docs)"
|
|
|
|
@echo " make install-linux-amd64 - Install ntfy binary to /usr/bin/ntfy (amd64)"
|
|
|
|
@echo " make web - Build the web app"
|
|
|
|
@echo " make docs - Build the documentation"
|
|
|
|
@echo " make check - Run all tests, vetting/formatting checks and linters"
|
2022-03-18 20:53:52 +03:00
|
|
|
@echo
|
|
|
|
@echo "Build everything:"
|
2022-05-21 17:08:33 +03:00
|
|
|
@echo " make build - Build web app, documentation and server/client"
|
|
|
|
@echo " make clean - Clean build/dist folders"
|
2022-03-18 20:53:52 +03:00
|
|
|
@echo
|
2022-05-21 17:08:33 +03:00
|
|
|
@echo "Build server & client (using GoReleaser, not release version):"
|
|
|
|
@echo " make cli - Build server & client (all architectures)"
|
|
|
|
@echo " make cli-linux-amd64 - Build server & client (Linux, amd64 only)"
|
|
|
|
@echo " make cli-linux-armv6 - Build server & client (Linux, armv6 only)"
|
|
|
|
@echo " make cli-linux-armv7 - Build server & client (Linux, armv7 only)"
|
|
|
|
@echo " make cli-linux-arm64 - Build server & client (Linux, arm64 only)"
|
|
|
|
@echo " make cli-windows-amd64 - Build client (Windows, amd64 only)"
|
|
|
|
@echo " make cli-darwin-all - Build client (macOS, arm64+amd64 universal binary)"
|
|
|
|
@echo
|
|
|
|
@echo "Build server & client (without GoReleaser):"
|
|
|
|
@echo " make cli-linux-server - Build client & server (no GoReleaser, current arch, Linux)"
|
|
|
|
@echo " make cli-darwin-server - Build client & server (no GoReleaser, current arch, macOS)"
|
|
|
|
@echo " make cli-client - Build client only (no GoReleaser, current arch, Linux/macOS/Windows)"
|
2022-03-18 20:53:52 +03:00
|
|
|
@echo
|
2023-05-26 22:40:18 +03:00
|
|
|
@echo "Build dev Docker:"
|
|
|
|
@echo " make docker-dev - Build client & server for current architecture using Docker only"
|
|
|
|
@echo
|
2022-03-18 20:53:52 +03:00
|
|
|
@echo "Build web app:"
|
2022-05-21 17:08:33 +03:00
|
|
|
@echo " make web - Build the web app"
|
|
|
|
@echo " make web-deps - Install web app dependencies (npm install the universe)"
|
|
|
|
@echo " make web-build - Actually build the web app"
|
2023-05-26 22:40:18 +03:00
|
|
|
@echo " make web-lint - Run eslint on the web app"
|
2023-10-30 02:57:06 +03:00
|
|
|
@echo " make web-fmt - Run prettier on the web app"
|
|
|
|
@echo " make web-fmt-check - Run prettier on the web app, but don't change anything"
|
2022-03-18 20:53:52 +03:00
|
|
|
@echo
|
|
|
|
@echo "Build documentation:"
|
2022-05-21 17:08:33 +03:00
|
|
|
@echo " make docs - Build the documentation"
|
|
|
|
@echo " make docs-deps - Install Python dependencies (pip3 install)"
|
|
|
|
@echo " make docs-build - Actually build the documentation"
|
2021-10-24 04:29:45 +03:00
|
|
|
@echo
|
|
|
|
@echo "Test/check:"
|
2022-05-21 17:08:33 +03:00
|
|
|
@echo " make test - Run tests"
|
|
|
|
@echo " make race - Run tests with -race flag"
|
|
|
|
@echo " make coverage - Run tests and show coverage"
|
|
|
|
@echo " make coverage-html - Run tests and show coverage (as HTML)"
|
|
|
|
@echo " make coverage-upload - Upload coverage results to codecov.io"
|
2021-10-24 04:29:45 +03:00
|
|
|
@echo
|
|
|
|
@echo "Lint/format:"
|
2022-05-21 17:08:33 +03:00
|
|
|
@echo " make fmt - Run 'go fmt'"
|
|
|
|
@echo " make fmt-check - Run 'go fmt', but don't change anything"
|
|
|
|
@echo " make vet - Run 'go vet'"
|
|
|
|
@echo " make lint - Run 'golint'"
|
|
|
|
@echo " make staticcheck - Run 'staticcheck'"
|
2021-10-24 04:29:45 +03:00
|
|
|
@echo
|
2022-03-18 20:53:52 +03:00
|
|
|
@echo "Releasing:"
|
2022-05-21 17:08:33 +03:00
|
|
|
@echo " make release - Create a release"
|
|
|
|
@echo " make release-snapshot - Create a test release"
|
2021-10-24 04:29:45 +03:00
|
|
|
@echo
|
|
|
|
@echo "Install locally (requires sudo):"
|
2022-05-21 17:08:33 +03:00
|
|
|
@echo " make install-linux-amd64 - Copy amd64 binary from dist/ to /usr/bin/ntfy"
|
|
|
|
@echo " make install-linux-armv6 - Copy armv6 binary from dist/ to /usr/bin/ntfy"
|
|
|
|
@echo " make install-linux-armv7 - Copy armv7 binary from dist/ to /usr/bin/ntfy"
|
|
|
|
@echo " make install-linux-arm64 - Copy arm64 binary from dist/ to /usr/bin/ntfy"
|
|
|
|
@echo " make install-linux-deb-amd64 - Install .deb from dist/ (amd64 only)"
|
|
|
|
@echo " make install-linux-deb-armv6 - Install .deb from dist/ (armv6 only)"
|
|
|
|
@echo " make install-linux-deb-armv7 - Install .deb from dist/ (armv7 only)"
|
|
|
|
@echo " make install-linux-deb-arm64 - Install .deb from dist/ (arm64 only)"
|
2022-03-18 20:53:52 +03:00
|
|
|
|
|
|
|
|
|
|
|
# Building everything
|
|
|
|
|
|
|
|
clean: .PHONY
|
|
|
|
rm -rf dist build server/docs server/site
|
|
|
|
|
2022-05-13 22:11:03 +03:00
|
|
|
build: web docs cli
|
2021-10-24 04:29:45 +03:00
|
|
|
|
2022-05-10 18:50:48 +03:00
|
|
|
update: web-deps-update cli-deps-update docs-deps-update
|
2022-05-26 23:50:36 +03:00
|
|
|
docker pull alpine
|
2021-10-24 04:29:45 +03:00
|
|
|
|
2023-05-26 22:40:18 +03:00
|
|
|
docker-dev:
|
|
|
|
docker build \
|
|
|
|
--file ./Dockerfile-build \
|
|
|
|
--tag binwiederhier/ntfy:$(VERSION) \
|
|
|
|
--tag binwiederhier/ntfy:dev \
|
|
|
|
--build-arg VERSION=$(VERSION) \
|
|
|
|
--build-arg COMMIT=$(COMMIT) \
|
|
|
|
./
|
|
|
|
|
2023-11-16 13:31:53 +03:00
|
|
|
|
2022-05-31 18:01:36 +03:00
|
|
|
# Ubuntu-specific
|
|
|
|
|
|
|
|
build-deps-ubuntu:
|
2023-05-26 22:14:59 +03:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y \
|
2022-05-31 18:01:36 +03:00
|
|
|
curl \
|
|
|
|
gcc-aarch64-linux-gnu \
|
|
|
|
gcc-arm-linux-gnueabi \
|
2023-11-16 13:31:53 +03:00
|
|
|
python3 \
|
|
|
|
python3-venv \
|
2022-05-31 18:01:36 +03:00
|
|
|
jq
|
2023-05-26 22:14:59 +03:00
|
|
|
which pip3 || sudo apt-get install -y python3-pip
|
2022-05-31 18:01:36 +03:00
|
|
|
|
2023-11-16 13:31:53 +03:00
|
|
|
|
2021-12-07 20:23:42 +03:00
|
|
|
# Documentation
|
2022-03-06 05:15:40 +03:00
|
|
|
|
2022-03-18 20:53:52 +03:00
|
|
|
docs: docs-deps docs-build
|
|
|
|
|
2023-11-16 13:31:53 +03:00
|
|
|
docs-venv: .PHONY
|
2023-11-17 05:03:23 +03:00
|
|
|
$(PYTHON) -m venv ./venv
|
2023-11-16 13:31:53 +03:00
|
|
|
|
|
|
|
docs-build: docs-venv
|
2023-11-17 05:39:13 +03:00
|
|
|
(. venv/bin/activate && $(PYTHON) -m mkdocs build)
|
2022-05-10 18:50:48 +03:00
|
|
|
|
2023-11-16 13:31:53 +03:00
|
|
|
docs-deps: docs-venv
|
2023-11-17 05:03:23 +03:00
|
|
|
(. venv/bin/activate && $(PIP) install -r requirements.txt)
|
2021-12-07 21:37:01 +03:00
|
|
|
|
2022-05-10 18:50:48 +03:00
|
|
|
docs-deps-update: .PHONY
|
2023-11-17 05:03:23 +03:00
|
|
|
(. venv/bin/activate && $(PIP) install -r requirements.txt --upgrade)
|
2021-12-07 20:23:42 +03:00
|
|
|
|
2022-03-06 04:24:10 +03:00
|
|
|
|
|
|
|
# Web app
|
|
|
|
|
2022-03-18 20:53:52 +03:00
|
|
|
web: web-deps web-build
|
|
|
|
|
2022-03-06 04:24:10 +03:00
|
|
|
web-build:
|
|
|
|
cd web \
|
|
|
|
&& npm run build \
|
|
|
|
&& mv build/index.html build/app.html \
|
|
|
|
&& rm -rf ../server/site \
|
|
|
|
&& mv build ../server/site \
|
|
|
|
&& rm \
|
2023-05-24 13:24:34 +03:00
|
|
|
../server/site/config.js
|
2022-03-06 04:24:10 +03:00
|
|
|
|
2022-05-10 18:50:48 +03:00
|
|
|
web-deps:
|
|
|
|
cd web && npm install
|
|
|
|
# If this fails for .svg files, optimize them with svgo
|
|
|
|
|
|
|
|
web-deps-update:
|
|
|
|
cd web && npm update
|
2022-03-18 20:53:52 +03:00
|
|
|
|
2023-10-30 02:57:06 +03:00
|
|
|
web-fmt:
|
2023-05-23 21:54:00 +03:00
|
|
|
cd web && npm run format
|
|
|
|
|
2023-10-30 02:57:06 +03:00
|
|
|
web-fmt-check:
|
2023-05-23 21:54:00 +03:00
|
|
|
cd web && npm run format:check
|
2022-05-31 18:01:36 +03:00
|
|
|
|
2023-05-23 22:20:20 +03:00
|
|
|
web-lint:
|
|
|
|
cd web && npm run lint
|
|
|
|
|
2022-03-18 20:53:52 +03:00
|
|
|
# Main server/client build
|
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
cli: cli-deps
|
2023-03-28 21:41:16 +03:00
|
|
|
goreleaser build --snapshot --clean
|
2022-03-18 20:53:52 +03:00
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
cli-linux-amd64: cli-deps-static-sites
|
2023-03-28 21:41:16 +03:00
|
|
|
goreleaser build --snapshot --clean --id ntfy_linux_amd64
|
2022-03-18 20:53:52 +03:00
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
cli-linux-armv6: cli-deps-static-sites cli-deps-gcc-armv6-armv7
|
2023-03-28 21:41:16 +03:00
|
|
|
goreleaser build --snapshot --clean --id ntfy_linux_armv6
|
2022-04-07 02:45:30 +03:00
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
cli-linux-armv7: cli-deps-static-sites cli-deps-gcc-armv6-armv7
|
2023-03-28 21:41:16 +03:00
|
|
|
goreleaser build --snapshot --clean --id ntfy_linux_armv7
|
2022-03-18 20:53:52 +03:00
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
cli-linux-arm64: cli-deps-static-sites cli-deps-gcc-arm64
|
2023-03-28 21:41:16 +03:00
|
|
|
goreleaser build --snapshot --clean --id ntfy_linux_arm64
|
2022-03-18 20:53:52 +03:00
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
cli-windows-amd64: cli-deps-static-sites
|
2023-03-28 21:41:16 +03:00
|
|
|
goreleaser build --snapshot --clean --id ntfy_windows_amd64
|
2022-03-18 20:53:52 +03:00
|
|
|
|
2022-05-11 05:10:38 +03:00
|
|
|
cli-darwin-all: cli-deps-static-sites
|
2023-03-28 21:41:16 +03:00
|
|
|
goreleaser build --snapshot --clean --id ntfy_darwin_all
|
2022-05-10 04:25:00 +03:00
|
|
|
|
2022-05-21 17:08:33 +03:00
|
|
|
cli-linux-server: cli-deps-static-sites
|
|
|
|
# This is a target to build the CLI (including the server) manually.
|
|
|
|
# Use this for development, if you really don't want to install GoReleaser ...
|
|
|
|
mkdir -p dist/ntfy_linux_server server/docs
|
2022-05-21 16:34:53 +03:00
|
|
|
CGO_ENABLED=1 go build \
|
2022-05-21 17:08:33 +03:00
|
|
|
-o dist/ntfy_linux_server/ntfy \
|
2022-05-21 16:34:53 +03:00
|
|
|
-tags sqlite_omit_load_extension,osusergo,netgo \
|
|
|
|
-ldflags \
|
2022-08-01 22:34:14 +03:00
|
|
|
"-linkmode=external -extldflags=-static -s -w -X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(shell date +%s)"
|
2022-05-21 16:34:53 +03:00
|
|
|
|
2022-05-21 17:08:33 +03:00
|
|
|
cli-darwin-server: cli-deps-static-sites
|
|
|
|
# This is a target to build the CLI (including the server) manually.
|
|
|
|
# Use this for macOS/iOS development, so you have a local server to test with.
|
|
|
|
mkdir -p dist/ntfy_darwin_server server/docs
|
|
|
|
CGO_ENABLED=1 go build \
|
|
|
|
-o dist/ntfy_darwin_server/ntfy \
|
|
|
|
-tags sqlite_omit_load_extension,osusergo,netgo \
|
|
|
|
-ldflags \
|
2022-08-01 22:34:14 +03:00
|
|
|
"-linkmode=external -s -w -X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(shell date +%s)"
|
2022-05-21 17:08:33 +03:00
|
|
|
|
|
|
|
cli-client: cli-deps-static-sites
|
|
|
|
# This is a target to build the CLI (excluding the server) manually. This should work on Linux/macOS/Windows.
|
|
|
|
# Use this for development, if you really don't want to install GoReleaser ...
|
|
|
|
mkdir -p dist/ntfy_client server/docs
|
2022-05-21 16:46:49 +03:00
|
|
|
CGO_ENABLED=0 go build \
|
2022-05-21 17:08:33 +03:00
|
|
|
-o dist/ntfy_client/ntfy \
|
2022-05-21 16:46:49 +03:00
|
|
|
-tags noserver \
|
|
|
|
-ldflags \
|
2022-08-01 22:34:14 +03:00
|
|
|
"-X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(shell date +%s)"
|
2022-05-21 16:46:49 +03:00
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
cli-deps: cli-deps-static-sites cli-deps-all cli-deps-gcc
|
2022-03-18 20:53:52 +03:00
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
cli-deps-gcc: cli-deps-gcc-armv6-armv7 cli-deps-gcc-arm64
|
|
|
|
|
|
|
|
cli-deps-static-sites:
|
2022-03-18 20:53:52 +03:00
|
|
|
mkdir -p server/docs server/site
|
|
|
|
touch server/docs/index.html server/site/app.html
|
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
cli-deps-all:
|
2022-05-31 18:01:36 +03:00
|
|
|
go install github.com/goreleaser/goreleaser@latest
|
2022-03-18 20:53:52 +03:00
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
cli-deps-gcc-armv6-armv7:
|
2022-04-07 02:45:30 +03:00
|
|
|
which arm-linux-gnueabi-gcc || { echo "ERROR: ARMv6/ARMv7 cross compiler not installed. On Ubuntu, run: apt install gcc-arm-linux-gnueabi"; exit 1; }
|
2022-03-18 20:53:52 +03:00
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
cli-deps-gcc-arm64:
|
2022-03-18 20:53:52 +03:00
|
|
|
which aarch64-linux-gnu-gcc || { echo "ERROR: ARM64 cross compiler not installed. On Ubuntu, run: apt install gcc-aarch64-linux-gnu"; exit 1; }
|
2022-03-06 04:24:10 +03:00
|
|
|
|
2022-05-10 18:50:48 +03:00
|
|
|
cli-deps-update:
|
|
|
|
go get -u
|
2022-05-11 05:10:38 +03:00
|
|
|
go install honnef.co/go/tools/cmd/staticcheck@latest
|
2022-05-31 18:01:36 +03:00
|
|
|
go install golang.org/x/lint/golint@latest
|
|
|
|
go install github.com/goreleaser/goreleaser@latest
|
|
|
|
|
|
|
|
cli-build-results:
|
|
|
|
cat dist/config.yaml
|
|
|
|
[ -f dist/artifacts.json ] && cat dist/artifacts.json | jq . || true
|
|
|
|
[ -f dist/metadata.json ] && cat dist/metadata.json | jq . || true
|
|
|
|
[ -f dist/checksums.txt ] && cat dist/checksums.txt || true
|
|
|
|
find dist -maxdepth 2 -type f \
|
|
|
|
\( -name '*.deb' -or -name '*.rpm' -or -name '*.zip' -or -name '*.tar.gz' -or -name 'ntfy' \) \
|
|
|
|
-and -not -path 'dist/goreleaserdocker*' \
|
|
|
|
-exec sha256sum {} \;
|
2022-03-06 04:24:10 +03:00
|
|
|
|
2021-10-24 04:29:45 +03:00
|
|
|
# Test/check targets
|
|
|
|
|
2023-10-30 02:57:06 +03:00
|
|
|
check: test web-fmt-check fmt-check vet web-lint lint staticcheck
|
2021-10-24 04:29:45 +03:00
|
|
|
|
|
|
|
test: .PHONY
|
2023-02-10 01:21:12 +03:00
|
|
|
go test $(shell go list ./... | grep -vE 'ntfy/(test|examples|tools)')
|
|
|
|
|
|
|
|
testv: .PHONY
|
2021-12-23 01:20:43 +03:00
|
|
|
go test -v $(shell go list ./... | grep -vE 'ntfy/(test|examples|tools)')
|
2021-10-24 04:29:45 +03:00
|
|
|
|
|
|
|
race: .PHONY
|
2023-01-28 17:03:14 +03:00
|
|
|
go test -v -race $(shell go list ./... | grep -vE 'ntfy/(test|examples|tools)')
|
2021-10-24 04:29:45 +03:00
|
|
|
|
|
|
|
coverage:
|
|
|
|
mkdir -p build/coverage
|
2023-01-28 17:03:14 +03:00
|
|
|
go test -v -race -coverprofile=build/coverage/coverage.txt -covermode=atomic $(shell go list ./... | grep -vE 'ntfy/(test|examples|tools)')
|
2021-12-23 01:20:43 +03:00
|
|
|
go tool cover -func build/coverage/coverage.txt
|
2021-10-24 04:29:45 +03:00
|
|
|
|
|
|
|
coverage-html:
|
|
|
|
mkdir -p build/coverage
|
2021-12-23 01:20:43 +03:00
|
|
|
go test -race -coverprofile=build/coverage/coverage.txt -covermode=atomic $(shell go list ./... | grep -vE 'ntfy/(test|examples|tools)')
|
|
|
|
go tool cover -html build/coverage/coverage.txt
|
2021-10-24 04:29:45 +03:00
|
|
|
|
|
|
|
coverage-upload:
|
|
|
|
cd build/coverage && (curl -s https://codecov.io/bash | bash)
|
|
|
|
|
2021-11-20 23:43:15 +03:00
|
|
|
|
2021-10-24 04:29:45 +03:00
|
|
|
# Lint/formatting targets
|
|
|
|
|
2023-10-30 02:57:06 +03:00
|
|
|
fmt: web-fmt
|
2021-12-07 23:39:42 +03:00
|
|
|
gofmt -s -w .
|
2021-10-24 04:29:45 +03:00
|
|
|
|
|
|
|
fmt-check:
|
|
|
|
test -z $(shell gofmt -l .)
|
|
|
|
|
|
|
|
vet:
|
2021-12-23 01:20:43 +03:00
|
|
|
go vet ./...
|
2021-10-24 04:29:45 +03:00
|
|
|
|
|
|
|
lint:
|
2022-01-26 06:30:53 +03:00
|
|
|
which golint || go install golang.org/x/lint/golint@latest
|
2021-12-23 01:20:43 +03:00
|
|
|
go list ./... | grep -v /vendor/ | xargs -L1 golint -set_exit_status
|
2021-10-24 04:29:45 +03:00
|
|
|
|
|
|
|
staticcheck: .PHONY
|
|
|
|
rm -rf build/staticcheck
|
2021-12-07 22:06:33 +03:00
|
|
|
which staticcheck || go install honnef.co/go/tools/cmd/staticcheck@latest
|
2021-10-24 04:29:45 +03:00
|
|
|
mkdir -p build/staticcheck
|
2021-12-23 01:20:43 +03:00
|
|
|
ln -s "go" build/staticcheck/go
|
2021-10-24 04:29:45 +03:00
|
|
|
PATH="$(PWD)/build/staticcheck:$(PATH)" staticcheck ./...
|
|
|
|
rm -rf build/staticcheck
|
|
|
|
|
2021-11-20 23:43:15 +03:00
|
|
|
|
2022-03-18 20:53:52 +03:00
|
|
|
# Releasing targets
|
2021-10-24 04:29:45 +03:00
|
|
|
|
2023-03-18 20:22:58 +03:00
|
|
|
release: clean cli-deps release-checks docs web check
|
2023-03-18 05:27:10 +03:00
|
|
|
goreleaser release --clean
|
2021-10-24 04:29:45 +03:00
|
|
|
|
2023-03-18 20:22:58 +03:00
|
|
|
release-snapshot: clean cli-deps docs web check
|
2023-03-18 05:27:10 +03:00
|
|
|
goreleaser release --snapshot --skip-publish --clean
|
2021-10-24 04:29:45 +03:00
|
|
|
|
2022-05-31 18:01:36 +03:00
|
|
|
release-checks:
|
2021-12-06 00:28:12 +03:00
|
|
|
$(eval LATEST_TAG := $(shell git describe --abbrev=0 --tags | cut -c2-))
|
2021-12-07 00:43:06 +03:00
|
|
|
if ! grep -q $(LATEST_TAG) docs/install.md; then\
|
2021-12-06 00:28:12 +03:00
|
|
|
echo "ERROR: Must update docs/install.md with latest tag first.";\
|
|
|
|
exit 1;\
|
|
|
|
fi
|
2022-03-13 23:06:40 +03:00
|
|
|
if ! grep -q $(LATEST_TAG) docs/releases.md; then\
|
2022-03-19 00:18:52 +03:00
|
|
|
echo "ERROR: Must update docs/releases.md with latest tag first.";\
|
2022-03-13 23:06:40 +03:00
|
|
|
exit 1;\
|
|
|
|
fi
|
2022-05-31 18:01:36 +03:00
|
|
|
if [ -n "$(shell git status -s)" ]; then\
|
|
|
|
echo "ERROR: Git repository is in an unclean state.";\
|
|
|
|
exit 1;\
|
|
|
|
fi
|
2021-12-06 00:28:12 +03:00
|
|
|
|
2021-10-24 04:29:45 +03:00
|
|
|
|
2022-03-18 20:53:52 +03:00
|
|
|
# Installing targets
|
2021-10-24 04:29:45 +03:00
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
install-linux-amd64: remove-binary
|
2022-06-12 18:54:58 +03:00
|
|
|
sudo cp -a dist/ntfy_linux_amd64_linux_amd64_v1/ntfy /usr/bin/ntfy
|
2021-10-24 04:29:45 +03:00
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
install-linux-armv6: remove-binary
|
2022-06-12 18:54:58 +03:00
|
|
|
sudo cp -a dist/ntfy_linux_armv6_linux_arm_6/ntfy /usr/bin/ntfy
|
2022-04-07 02:45:30 +03:00
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
install-linux-armv7: remove-binary
|
2022-06-12 18:54:58 +03:00
|
|
|
sudo cp -a dist/ntfy_linux_armv7_linux_arm_7/ntfy /usr/bin/ntfy
|
2021-10-24 04:29:45 +03:00
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
install-linux-arm64: remove-binary
|
2022-06-12 18:54:58 +03:00
|
|
|
sudo cp -a dist/ntfy_linux_arm64_linux_arm64/ntfy /usr/bin/ntfy
|
2022-03-18 20:53:52 +03:00
|
|
|
|
|
|
|
remove-binary:
|
2021-10-24 04:29:45 +03:00
|
|
|
sudo rm -f /usr/bin/ntfy
|
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
install-linux-amd64-deb: purge-package
|
2022-03-18 20:53:52 +03:00
|
|
|
sudo dpkg -i dist/ntfy_*_linux_amd64.deb
|
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
install-linux-armv6-deb: purge-package
|
2022-04-25 04:41:40 +03:00
|
|
|
sudo dpkg -i dist/ntfy_*_linux_armv6.deb
|
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
install-linux-armv7-deb: purge-package
|
2022-03-18 20:53:52 +03:00
|
|
|
sudo dpkg -i dist/ntfy_*_linux_armv7.deb
|
|
|
|
|
2022-05-10 02:46:32 +03:00
|
|
|
install-linux-arm64-deb: purge-package
|
2022-03-18 20:53:52 +03:00
|
|
|
sudo dpkg -i dist/ntfy_*_linux_arm64.deb
|
|
|
|
|
|
|
|
purge-package:
|
2021-10-24 04:29:45 +03:00
|
|
|
sudo systemctl stop ntfy || true
|
|
|
|
sudo apt-get purge ntfy || true
|