diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d02882b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM setsoft/kicad_debian:latest +MAINTAINER Salvador E. Tropea +LABEL Description="KiCad with KiPlot and other automation scripts" + +COPY *.deb / +RUN apt-get update && \ + apt -y install --no-install-recommends ./*.deb && \ + apt-get -y autoremove && \ + rm /*.deb && \ + rm -rf /var/lib/apt/lists/* + diff --git a/README.md b/README.md index cd91a24..4760f31 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,37 @@ # kicad_auto + Docker image for KiCad automation scripts suitable for CI/CD + +The images are uploaded to [Docker Hub](https://hub.docker.com/repository/docker/setsoft/kicad_auto). + +This image is based on [setsoft/kicad_debian](https://github.com/INTI-CMNB/kicad_debian) and adds some automation tools to it: + +* [Kiplot](https://github.com/INTI-CMNB/kiplot) generate gerbers, drill and position files +* [kicad-automation-scripts](https://github.com/INTI-CMNB/kicad-automation-scripts) runs DRC/ERC, prints schematics and PCB +* [KiBoM](https://github.com/INTI-CMNB/KiBoM) generates HTML and CSV BoMs +* [InteractiveHtmlBom](https://github.com/INTI-CMNB/InteractiveHtmlBom) generates interactive HTML BoMs + +The available tags are: + +* **10.3-5.1.5** is KiCad 5.1.5 on Debian 10.3 with Kiplot 0.2.2, kicad-automation-scripts 1.1.5, KiBoM 1.6.1 and interactivehtmlbom 2.3 + +You can run it using a script like this: + +``` +export USER_ID=$(id -u) +export GROUP_ID=$(id -g) +export WORKDIR=RELATIVE_PATH_TO_KICAD_PROJECTS +export SUBDIR=SUBDIR_INSIDE_WORKDIR +docker run --rm -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY \ + -v $(pwd)/$WORKDIR:/home/$USER/workdir \ + --user $USER_ID:$GROUP_ID \ + --env NO_AT_BRIDGE=1 \ + --workdir="/home/$USER" \ + --volume="/etc/group:/etc/group:ro" \ + --volume="/home/$USER/.config/kicad:/home/$USER/.config/kicad:rw" \ + --volume="/home/$USER/.cache/kicad:/home/$USER/.cache/kicad:rw" \ + --volume="/etc/passwd:/etc/passwd:ro" \ + --volume="/etc/shadow:/etc/shadow:ro" \ + setsoft/kicad_auto:10.3-5.1.5 /bin/bash -c "cd workdir/$SUBDIR; kiplot" +``` + diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..fb4c4c3 --- /dev/null +++ b/build.sh @@ -0,0 +1 @@ +docker build -f Dockerfile -t setsoft/kicad_auto:10.3-5.1.5 . diff --git a/interactivehtmlbom.inti-cmnb_2.3-1_all.deb b/interactivehtmlbom.inti-cmnb_2.3-1_all.deb new file mode 100644 index 0000000..de3b978 Binary files /dev/null and b/interactivehtmlbom.inti-cmnb_2.3-1_all.deb differ diff --git a/kibom.inti-cmnb_1.6.1-1_all.deb b/kibom.inti-cmnb_1.6.1-1_all.deb new file mode 100644 index 0000000..7ad5a61 Binary files /dev/null and b/kibom.inti-cmnb_1.6.1-1_all.deb differ diff --git a/kicad-automation-scripts.inti-cmnb_1.1.5-1_all.deb b/kicad-automation-scripts.inti-cmnb_1.1.5-1_all.deb new file mode 100644 index 0000000..72e851d Binary files /dev/null and b/kicad-automation-scripts.inti-cmnb_1.1.5-1_all.deb differ diff --git a/kiplot.inti-cmnb_0.2.2-1_all.deb b/kiplot.inti-cmnb_0.2.2-1_all.deb new file mode 100644 index 0000000..f8af25b Binary files /dev/null and b/kiplot.inti-cmnb_0.2.2-1_all.deb differ diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..1124c6c --- /dev/null +++ b/run.sh @@ -0,0 +1,15 @@ +export USER_ID=$(id -u) +export GROUP_ID=$(id -g) +WORKDIR=../hard +SUBDIR=Conjunto +docker run --rm -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY \ + -v $(pwd)/$WORKDIR:/home/$USER/workdir \ + --user $USER_ID:$GROUP_ID \ + --env NO_AT_BRIDGE=1 \ + --workdir="/home/$USER" \ + --volume="/etc/group:/etc/group:ro" \ + --volume="/home/$USER/.config/kicad:/home/$USER/.config/kicad:rw" \ + --volume="/home/$USER/.cache/kicad:/home/$USER/.cache/kicad:rw" \ + --volume="/etc/passwd:/etc/passwd:ro" \ + --volume="/etc/shadow:/etc/shadow:ro" \ + setsoft/kicad_auto:10.3-5.1.5 /bin/bash -c "cd workdir/$SUBDIR; kiplot"