2023-02-12 12:53:42 +00:00
|
|
|
SHELL := bash
|
|
|
|
CPU_CORES := $(shell N=$$(nproc); echo $$(( $$N > 4 ? 4 : $$N )))
|
|
|
|
|
|
|
|
BAKE_FILES = \
|
|
|
|
docker-bake.json \
|
|
|
|
docker-bake.api.json \
|
|
|
|
docker-bake.front.json
|
|
|
|
|
|
|
|
docker-bake.%.json:
|
|
|
|
./scripts/build_metadata.py --format bake --bake-target $* --bake-image docker.io/funkwhale/$* > $@
|
|
|
|
|
2023-06-13 10:40:38 +00:00
|
|
|
docker-metadata: $(BAKE_FILES)
|
|
|
|
|
|
|
|
docker-build: docker-metadata
|
2023-02-12 12:53:42 +00:00
|
|
|
docker buildx bake $(foreach FILE,$(BAKE_FILES), --file $(FILE)) --print $(BUILD_ARGS)
|
|
|
|
docker buildx bake $(foreach FILE,$(BAKE_FILES), --file $(FILE)) $(BUILD_ARGS)
|
2023-06-13 10:40:38 +00:00
|
|
|
|
|
|
|
build-metadata:
|
|
|
|
./scripts/build_metadata.py --format env | tee build_metadata.env
|
2023-02-13 11:53:33 +00:00
|
|
|
|
|
|
|
BUILD_DIR = dist
|
2024-01-05 11:19:18 +00:00
|
|
|
package:
|
2023-02-13 11:53:33 +00:00
|
|
|
rm -Rf $(BUILD_DIR)
|
|
|
|
mkdir -p $(BUILD_DIR)
|
2024-01-05 11:39:33 +00:00
|
|
|
tar --create --gunzip --file='$(BUILD_DIR)/funkwhale-api.tar.gz' \
|
2023-02-13 11:53:33 +00:00
|
|
|
--owner='root' \
|
|
|
|
--group='root' \
|
|
|
|
--exclude-vcs \
|
|
|
|
api/config \
|
|
|
|
api/funkwhale_api \
|
|
|
|
api/install_os_dependencies.sh \
|
|
|
|
api/manage.py \
|
|
|
|
api/poetry.lock \
|
|
|
|
api/pyproject.toml \
|
|
|
|
api/Readme.md
|
|
|
|
|
|
|
|
cd '$(BUILD_DIR)' && \
|
2024-01-05 11:39:33 +00:00
|
|
|
tar --extract --gunzip --file='funkwhale-api.tar.gz' && \
|
|
|
|
zip -q 'funkwhale-api.zip' -r api && \
|
2023-02-13 11:53:33 +00:00
|
|
|
rm -Rf api
|
|
|
|
|
2024-01-05 11:39:33 +00:00
|
|
|
tar --create --gunzip --file='$(BUILD_DIR)/funkwhale-front.tar.gz' \
|
2023-02-13 11:53:33 +00:00
|
|
|
--owner='root' \
|
|
|
|
--group='root' \
|
|
|
|
--exclude-vcs \
|
|
|
|
--transform='s/^front\/dist/front/' \
|
|
|
|
front/dist
|
|
|
|
|
|
|
|
cd '$(BUILD_DIR)' && \
|
2024-01-05 11:39:33 +00:00
|
|
|
tar --extract --gunzip --file='funkwhale-front.tar.gz' && \
|
|
|
|
zip -q 'funkwhale-front.zip' -r front && \
|
2023-02-13 11:53:33 +00:00
|
|
|
rm -Rf front
|
|
|
|
|
|
|
|
cd '$(BUILD_DIR)' && sha256sum * > SHA256SUMS
|