-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (28 loc) · 1.15 KB
/
Makefile
File metadata and controls
37 lines (28 loc) · 1.15 KB
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
.PHONY: build build-no-cache build-multiarch cleanup run test test-ci-setup test-ci
DOCKER_IMAGE?=rlespinasse/drawio-export:local
build:
@docker build -t ${DOCKER_IMAGE} .
build-no-cache:
@docker build --no-cache --progress plain -t ${DOCKER_IMAGE} .
build-multiarch:
@docker buildx build --platform linux/amd64,linux/arm64 -t ${DOCKER_IMAGE} .
cleanup:
@rm -rf tests/output
@find tests -name "export" | xargs -I {} rm -r "{}"
@find tests -name "test-*" | xargs -I {} rm -r "{}"
RUN_ARGS?=
DOCKER_OPTIONS?=
run:
@docker run -t $(DOCKER_OPTIONS) -w /data -v $(PWD):/data ${DOCKER_IMAGE} ${RUN_ARGS}
test: cleanup build test-ci
test-ci-setup:
@npm install bats
@sudo apt-get update
@sudo apt-get install -y libxml2-utils
test-ci:
@mkdir -p tests/output
@DOCKER_IMAGE=$(DOCKER_IMAGE) npx bats --verbose-run -r tests
autoupdate-drawio-exporter:
@$(eval DRAWIO_EXPORTER_RELEASE := $(shell gh release list --repo rlespinasse/drawio-exporter | grep "Latest" | cut -f1 | sed 's/^v//'))
@sed -i "s/version.*/version $(DRAWIO_EXPORTER_RELEASE)/" Dockerfile
@test -z "${GITHUB_OUTPUT}" || echo "release_version=$(DRAWIO_DESKTOP_RELEASE)" >> "${GITHUB_OUTPUT}"