2021-06-15 00:01:52 +00:00
|
|
|
DOCKER_TAG ?= docker-restic-cron-$(USER)
|
2017-06-29 01:12:49 +00:00
|
|
|
|
2021-06-14 22:55:26 +00:00
|
|
|
.PHONY: all
|
|
|
|
all: check test-all
|
|
|
|
|
2017-11-15 19:02:12 +00:00
|
|
|
.PHONY: default
|
2017-06-29 01:12:49 +00:00
|
|
|
default: build-x86
|
|
|
|
|
2017-11-15 19:02:12 +00:00
|
|
|
.PHONY: test
|
2017-07-30 19:18:12 +00:00
|
|
|
test: test-x86
|
|
|
|
|
2017-11-15 19:02:12 +00:00
|
|
|
.PHONY: build-x86
|
2017-06-29 01:12:49 +00:00
|
|
|
build-x86:
|
2021-06-15 17:52:16 +00:00
|
|
|
docker build --build-arg TARGETARCH=amd64 -f ./Dockerfile -t $(DOCKER_TAG) .
|
2017-06-29 01:12:49 +00:00
|
|
|
|
2017-11-15 19:02:12 +00:00
|
|
|
.PHONY: build-arm
|
2017-06-29 01:12:49 +00:00
|
|
|
build-arm:
|
2021-06-15 17:41:57 +00:00
|
|
|
docker build --build-arg REPO=arm32v7 --build-arg TARGETARCH=arm -f ./Dockerfile -t $(DOCKER_TAG)-arm .
|
2017-06-29 01:12:49 +00:00
|
|
|
|
2017-11-15 19:02:12 +00:00
|
|
|
.PHONY: build-all
|
2017-06-29 01:12:49 +00:00
|
|
|
build-all: build-x86 build-arm
|
|
|
|
|
2017-11-15 19:02:12 +00:00
|
|
|
.PHONY: test-x86
|
2017-06-29 01:12:49 +00:00
|
|
|
test-x86: build-x86
|
2018-07-24 15:38:22 +00:00
|
|
|
cd tests && ./test.sh $(DOCKER_TAG)
|
2019-01-28 19:44:38 +00:00
|
|
|
cd tests && ./test-pre-scripts.sh $(DOCKER_TAG)
|
2017-06-29 01:12:49 +00:00
|
|
|
|
2021-06-15 00:01:52 +00:00
|
|
|
.PHONY: test-arm
|
|
|
|
test-arm: build-arm
|
|
|
|
cd tests && ./test.sh $(DOCKER_TAG)-arm
|
|
|
|
cd tests && ./test-pre-scripts.sh $(DOCKER_TAG)-arm
|
|
|
|
|
2017-11-15 19:02:12 +00:00
|
|
|
.PHONY: test-all
|
2017-06-29 01:12:49 +00:00
|
|
|
test-all: test-x86 test-arm
|
2017-07-17 02:37:03 +00:00
|
|
|
|
2017-11-16 17:23:03 +00:00
|
|
|
.PHONY: test-s3-x86
|
|
|
|
test-s3-x86:
|
2021-06-15 17:52:16 +00:00
|
|
|
cd tests && env TARGETARCH=amd64 ./test-s3.sh
|
2017-11-16 17:23:03 +00:00
|
|
|
|
2017-11-15 19:02:12 +00:00
|
|
|
.PHONY: shell-x86
|
2017-07-17 02:37:03 +00:00
|
|
|
shell-x86: build-x86
|
2018-07-24 15:38:22 +00:00
|
|
|
docker run --rm -it $(DOCKER_TAG) bash
|
2017-07-17 02:37:03 +00:00
|
|
|
|
2017-11-15 19:02:12 +00:00
|
|
|
.PHONY: shell
|
2017-07-17 02:37:03 +00:00
|
|
|
shell: shell-x86
|
2017-11-16 17:23:03 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2021-06-15 00:01:52 +00:00
|
|
|
docker-compose -f ./tests/docker-compose-test-s3.yml down -v
|
|
|
|
rm -fr my-backups/
|
|
|
|
rm -fr my-data/
|
2021-06-14 22:55:26 +00:00
|
|
|
|
|
|
|
.PHONY: install-hooks
|
|
|
|
install-hooks:
|
|
|
|
pre-commit install
|
|
|
|
|
|
|
|
.PHONY: check
|
|
|
|
check:
|
|
|
|
pre-commit run --all-files
|