-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
68 lines (58 loc) · 2.31 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
#!/usr/bin/make
SHELL = /bin/sh
USER_ID := $(shell id -u)
GROUP_ID := $(shell id -g)
PWD := $(shell pwd)
MYSLOCAL := $(shell cd ./hardware/lib; pwd)
IMAGE_NAME := setsoft/kicad_auto:ki6
DATADIR := /data
WORKDIR := /data
VERSION := $(shell git describe --tags --match "v*" HEAD | sed -E 's/^(v[0-9]+\.[0-9]+)\.[0-9]+(.*)$$/\1\2/' )
export USER_ID, GROUP_ID, PWD, MYSLOCAL
all: documentation production case
documentation:
docker run --rm \
--env USER_ID=${USER_ID} \
--env GROUP_ID=${GROUP_ID} \
--env WORKDIR="${WORKDIR}" \
--env DATADIR="${DATADIR}" \
--workdir="${WORKDIR}" \
--volume=${PWD}:${DATADIR} \
${IMAGE_NAME} /bin/bash \
-c "${DATADIR}/.kibot/docker_setup.sh && runuser -u me -- kibot -c ${WORKDIR}/.kibot/documentation.kibot.yaml -d ${DATADIR}/hardware -e ${WORKDIR}/hardware/soil-moisture-sensor.kicad_sch -b ${WORKDIR}/hardware/soil-moisture-sensor.kicad_pcb"
production:
docker run --rm \
--env USER_ID=${USER_ID} \
--env GROUP_ID=${GROUP_ID} \
--env WORKDIR="${WORKDIR}" \
--env DATADIR="${DATADIR}" \
--workdir="${WORKDIR}" \
--volume=${PWD}:${DATADIR} \
${IMAGE_NAME} /bin/bash \
-c "${DATADIR}/.kibot/docker_setup.sh && runuser -u me -- kibot -c ${WORKDIR}/.kibot/production.kibot.yaml -d ${DATADIR}/hardware -e ${WORKDIR}/hardware/soil-moisture-sensor.kicad_sch -b ${WORKDIR}/hardware/soil-moisture-sensor.kicad_pcb"
test:
docker run --rm \
--env USER_ID=${USER_ID} \
--env GROUP_ID=${GROUP_ID} \
--env WORKDIR="${WORKDIR}" \
--env DATADIR="${DATADIR}" \
--workdir="${WORKDIR}" \
--volume=${PWD}:${DATADIR} \
${IMAGE_NAME} /bin/bash \
-c "${DATADIR}/.kibot/docker_setup.sh && runuser -u me -- kibot -c ${WORKDIR}/.kibot/test.kibot.yaml -d ${DATADIR}/hardware -e ${WORKDIR}/hardware/soil-moisture-sensor.kicad_sch -b ${WORKDIR}/hardware/soil-moisture-sensor.kicad_pcb"
interactive:
docker run -it --rm \
--workdir="${WORKDIR}" \
--env USER_ID=${USER_ID} \
--env GROUP_ID=${GROUP_ID} \
--env WORKDIR="${WORKDIR}" \
--volume=${PWD}:${WORKDIR} \
${IMAGE_NAME} /bin/bash
case:
openscad hardware/case/case.scad -o hardware/case/base-${VERSION}.stl -D 'part="base"'
openscad hardware/case/case.scad -o hardware/case/shell-${VERSION}.stl -D 'part="shell"'
clean:
rm -rf hardware/Documentation
rm -rf hardware/Gerbers
rm -rf hardware/PickAndPlace
rm -f hardware/case/*.stl