Skip to content

Commit 191ed5a

Browse files
committed
Add a Makefile
Signed-off-by: Joe Block <jpb@unixorn.net>
1 parent 023f631 commit 191ed5a

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

Makefile

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
.PHONY: c clean \
2+
f format \
3+
h help \
4+
local \
5+
multiarch_image \
6+
publish \
7+
t test \
8+
wheel
9+
10+
h: help
11+
c: clean
12+
f: format
13+
t: test
14+
15+
help:
16+
@echo "Options:"
17+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
18+
19+
HUB_USER=unixorn
20+
MOOSEFS_VERSION=3.116
21+
PLATFORMS=linux/arm64,linux/amd64,linux/arm/v7
22+
23+
# If this pukes trying to import paho, try running 'poetry install'
24+
# MOOSEFS_VERSION=$(shell poetry run python3 -c 'from ha_mqtt_discoverable import __version__;print(__version__)' )
25+
26+
install_hooks: ## Install the git hooks
27+
poetry run pre-commit install
28+
29+
local_cgiserver: ## Makes a moosefs-cgiserver docker image for only the architecture we're running on. Does not push to dockerhub.
30+
docker buildx build --load -t ${HUB_USER}/moosefs-cgiserver -f Dockerfile.cgiserver .
31+
32+
multiarch_cgiserver: ## Makes a moosefs-cgiserver multi-architecture docker image for linux/arm64, linux/amd64 and linux/arm/v7 and pushes it to dockerhub
33+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-cgiserver:$(MOOSEFS_VERSION) -f Dockerfile.cgiserver .
34+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-cgiserver:latest -f Dockerfile.cgiserver .
35+
make local_cgiserver
36+
37+
local_chunkserver: ## Makes a moosefs-chunkserver docker image for only the architecture we're running on. Does not push to dockerhub.
38+
docker buildx build --load -t ${HUB_USER}/moosefs-chunkserver -f Dockerfile.chunkserver .
39+
40+
multiarch_chunkserver: ## Makes a moosefs-chunkserver multi-architecture docker image for linux/arm64, linux/amd64 and linux/arm/v7 and pushes it to dockerhub
41+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-chunkserver:$(MOOSEFS_VERSION) -f Dockerfile.chunkserver .
42+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-chunkserver:latest -f Dockerfile.chunkserver .
43+
make local_chunkserver
44+
45+
local_master: ## Makes a moosefs-master docker image for only the architecture we're running on. Does not push to dockerhub.
46+
docker buildx build --load -t ${HUB_USER}/moosefs-master -f Dockerfile.master .
47+
48+
multiarch_master: ## Makes a moosefs-master multi-architecture docker image for linux/arm64, linux/amd64 and linux/arm/v7 and pushes it to dockerhub
49+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-master:$(MOOSEFS_VERSION) -f Dockerfile.master .
50+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-master:latest -f Dockerfile.master .
51+
make local_master
52+
53+
local_metalogger: ## Makes a moosefs-metalogger docker image for only the architecture we're running on. Does not push to dockerhub.
54+
docker buildx build --load -t ${HUB_USER}/moosefs-metalogger -f Dockerfile.metalogger .
55+
56+
multiarch_metalogger: ## Makes a moosefs-metalogger multi-architecture docker image for linux/arm64, linux/amd64 and linux/arm/v7 and pushes it to dockerhub
57+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-metalogger:$(MOOSEFS_VERSION) -f Dockerfile.metalogger .
58+
docker buildx build --build-arg application_version=${MOOSEFS_VERSION} --platform ${PLATFORMS} --push -t ${HUB_USER}/moosefs-metalogger:latest -f Dockerfile.metalogger .
59+
make local_metalogger
60+
61+
local: local_cgiserver \ ## Make images for whatever architecture you're running on, but does not push to docker hub
62+
local_chunkserver \
63+
local_master \
64+
local_metalogger
65+
66+
multiarch_images: ## Builds multi-architecture docker images for all the services and pushes them to docker hub
67+
multiarch: multiarch_cgiserver \
68+
multiarch_chunkserver \
69+
multiarch_master \
70+
multiarch_metalogger

0 commit comments

Comments
 (0)