From 480d0a6472760247d630ec3be625638f1f20c16b Mon Sep 17 00:00:00 2001 From: redxef Date: Wed, 22 Dec 2021 17:34:56 +0100 Subject: [PATCH] Improve makefile and add dockerignore. --- .dockerignore | 6 ++++++ Makefile | 14 ++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..720ef4b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.gitignore +build-docker +Makefile +README.md +start +start.tmpl diff --git a/Makefile b/Makefile index b3fc02d..3fd59a5 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ +PREFIX := /usr/local START_SCRIPT := start START_SCRIPT_SRC := start.tmpl -INSTALLATION_NAME := openvpn-aria2 +INSTALLATION_NAME := docker-aria2 DOCKERFILE := Dockerfile -TAG = openvpn-aria2 +TAG = docker-aria2 build: build-docker $(START_SCRIPT) @@ -15,10 +16,15 @@ $(START_SCRIPT): $(START_SCRIPT_SRC) sed -e "s/{TAG}/$(TAG)/g" -e "s/{INSTALLATION_NAME}/$(INSTALLATION_NAME)/g" $< > $@ chmod +x $@ +shellcheck: $(START_SCRIPT) + shellcheck $< + +check: shellcheck + clean: $(RM) build-docker $(START_SCRIPT) install: build - install -D --mode=755 $(START_SCRIPT) /usr/local/bin/$(INSTALLATION_NAME) + install -D --mode=755 $(START_SCRIPT) $(PREFIX)/bin/$(INSTALLATION_NAME) -.PHONY: clean +.PHONY: shellcheck check clean