This repository has been archived by the owner on Mar 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
51 lines (41 loc) · 1.57 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
DVOLUMES = --volume="$$PWD:/home/${USER}/workdir:rw" \
--volume="/etc/group:/etc/group:ro" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix" \
--volume="/home/${USER}/.config/kicad:/home/${USER}/.config/kicad:rw" \
--volume="/home/${USER}/.cache/kicad:/home/${USER}/.cache/kicad:rw"
DWORKDIR = --workdir="/home/${USER}/workdir"
DUSER = --user $$(id -u):$$(id -g)
DENV = --env NO_AT_BRIDGE=1
build:
docker build -t kicad-exports \
--build-arg BUILD_DATE=`date -u +"%Y-%m-%d"` \
--build-arg BUILD_COMMIT=`git describe --exact-match --tags 2> /dev/null || git rev-parse --abbrev-ref HEAD` \
. > build.log
install:
echo 'docker run $(DVOLUMES) $(DWORKDIR) $(DUSER) kicad-exports $$@' > kicad-exports
chmod +x kicad-exports
cp -f kicad-exports ~/.local/bin/kicad-exports
install-ci:
echo 'docker run $(DVOLUMES) $(DWORKDIR) kicad-exports $$@' > kicad-exports
chmod +x kicad-exports
kicad:
docker run -it $(DVOLUMES) $(DWORKDIR) $(DUSER) $(DENV) --entrypoint kicad -e DISPLAY=${DISPLAY} kicad-exports
shell:
docker run -it $(DVOLUMES) $(DWORKDIR) $(DUSER) --entrypoint bash kicad-exports
update:
docker pull setsoft/kicad_auto:latest
git submodule foreach git pull
clean: clean-test
docker image rm -f kicad-exports
git clean -f -x
rm -r -f kicad-exports build.log
rm -r -f .config .cache .fontconfig .local
clean-test:
rm -r -f test_data/output/*
rm -f tests/log/*.log
test: clean-test build install
./tests/run.sh || exit $$?
test-ci: clean-test build install-ci
./tests/run.sh || exit $$?