docker-xmrig/Makefile

35 lines
799 B
Makefile
Raw Normal View History

2023-06-07 15:14:52 +03:00
VERSION = 6.19.3
REL = $(VERSION)-1
2019-10-12 01:31:10 +03:00
THREADS = $(shell nproc)
PRIORITY = 0
2023-06-07 15:14:52 +03:00
REPO=docker.io/metal3d/xmrig
CC=podman
2019-10-12 01:31:10 +03:00
2019-10-12 02:06:57 +03:00
HUB=https://hub.docker.com/v2
2019-10-12 01:31:10 +03:00
all: build run
2019-10-10 19:21:47 +03:00
build:
2023-06-07 15:14:52 +03:00
$(CC) build -t $(REPO):$(REL) --build-arg VERSION=$(VERSION) .
$(CC) tag $(REPO):$(REL) $(REPO):latest
2019-10-10 19:21:47 +03:00
run:
2023-06-07 15:14:52 +03:00
$(CC) run --rm -it -e THREADS=$(THREADS) -e PRIORITY=$(PRIORITY) $(REPO):$(REL)
2019-10-12 02:06:57 +03:00
deploy: build
2023-06-07 15:14:52 +03:00
$(CC) push $(REPO):$(REL)
$(CC) push $(REPO):latest
2019-10-12 02:06:57 +03:00
test:
.ONESHELL:
set-description:
ifdef PASSWORD
@echo "Changing description"
token=`http $(HUB)/users/login username=$(USERNAME) password=$(PASSWORD) | jq -r '.token'`
http --form PATCH $(HUB)/repositories/metal3d/xmrig/ Authorization:"JWT $$token" full_description=@README.md
else
@echo "You need to provide repo password in PASSWORD variable argument"
endif