-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
81 lines (69 loc) · 2.35 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
## DOCKER BUILD VARS
BASE_IMAGE=python
BASE_IMAGE_TAG=3.13.0-slim-bookworm
IMAGE_NAME=homeylab/bookstack-file-exporter
# keep this start sequence unique (IMAGE_TAG=)
# github actions will use this to create a tag
IMAGE_TAG=main
DOCKER_WORK_DIR=/export
DOCKER_CONFIG_DIR=/export/config
DOCKER_EXPORT_DIR=/export/dump
pip_build:
python -m pip install .
pip_local_dev:
python -m pip install -e .
build:
python -m pip install --upgrade build
python -m build
lint:
pylint bookstack_file_exporter
upload_testpypi:
python -m pip install --upgrade twine
python -m twine upload --repository testpypi dist/*
# extra-url is for dependencies using real pypi
download_testpypi:
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple bookstack-file-exporter
docker_build_simple:
docker build \
--build-arg BASE_IMAGE=${BASE_IMAGE} \
--build-arg BASE_IMAGE_TAG=${BASE_IMAGE_TAG} \
--build-arg DOCKER_WORK_DIR=${DOCKER_WORK_DIR} \
--build-arg DOCKER_CONFIG_DIR=${DOCKER_CONFIG_DIR} \
--build-arg DOCKER_EXPORT_DIR=${DOCKER_EXPORT_DIR} \
-t ${IMAGE_NAME}:${IMAGE_TAG} \
--no-cache .
docker_build:
docker buildx build \
--platform linux/amd64,linux/arm64 \
--output "type=image,push=false" \
--build-arg BASE_IMAGE=${BASE_IMAGE} \
--build-arg BASE_IMAGE_TAG=${BASE_IMAGE_TAG} \
--build-arg DOCKER_WORK_DIR=${DOCKER_WORK_DIR} \
--build-arg DOCKER_CONFIG_DIR=${DOCKER_CONFIG_DIR} \
--build-arg DOCKER_EXPORT_DIR=${DOCKER_EXPORT_DIR} \
-t ${IMAGE_NAME}:${IMAGE_TAG} \
--no-cache .
docker_build_latest:
docker buildx build \
--platform linux/amd64,linux/arm64 \
--output "type=image,push=true" \
--build-arg BASE_IMAGE=${BASE_IMAGE} \
--build-arg BASE_IMAGE_TAG=${BASE_IMAGE_TAG} \
--build-arg DOCKER_WORK_DIR=${DOCKER_WORK_DIR} \
--build-arg DOCKER_CONFIG_DIR=${DOCKER_CONFIG_DIR} \
--build-arg DOCKER_EXPORT_DIR=${DOCKER_EXPORT_DIR} \
-t ${IMAGE_NAME}:${IMAGE_TAG} \
-t ${IMAGE_NAME}:latest \
--no-cache .
docker_push:
docker push ${IMAGE_NAME}:${IMAGE_TAG}
docker_push_latest:
docker push ${IMAGE_NAME} --all-tags
# add -i option due to bug in rancher desktop: https://github.com/rancher-sandbox/rancher-desktop/issues/3239
docker_test:
docker run -i \
-e LOG_LEVEL='debug' \
--user 1000:1000 \
-v ${CURDIR}/local/config.yml:/export/config/config.yml:ro \
-v ${CURDIR}/bkps:/export/dump \
${IMAGE_NAME}:${IMAGE_TAG}