forked from itsankoff/gopro-plus
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
43 lines (33 loc) · 947 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.PHONY: docker, release
# Docker default environment
ACTION ?= download
PAGES ?= 1
PER_PAGE ?= 2
DOWNLOAD_PATH ?= ./download
AUTH_TOKEN := $(shell echo $$AUTH_TOKEN)
# Docker container
CONTAINER_NAME ?= gopro
# Docker image
BUILD_PLATFORMS ?= linux/amd64,linux/arm64,linux/arm/v7
IMAGE := itsankoff/gopro
VERSION := $(shell cat VERSION.txt)
IMAGE_WITH_VERSION = $(IMAGE):$(VERSION)
run: clean
@docker run -d --name $(CONTAINER_NAME) \
-v ./download:/app/download \
-e AUTH_TOKEN=$(AUTH_TOKEN) \
-e ACTION=$(ACTION) \
-e PAGES=$(PAGES) \
-e PER_PAGE=$(PER_PAGE) \
-e DOWNLOAD_PATH=$(DOWNLOAD_PATH) \
$(IMAGE_WITH_VERSION)
stop:
@docker stop $(CONTAINER_NAME) || true
logs:
@docker logs -f $(CONTAINER_NAME)
clean: stop
@docker rm $(CONTAINER_NAME) || true
docker:
@docker build -t $(IMAGE_WITH_VERSION) .
release:
@docker buildx build --platform $(BUILD_PLATFORMS) -t $(IMAGE_WITH_VERSION) -t $(IMAGE):latest --push .