Added KiCad 8 images

This commit is contained in:
Salvador E. Tropea 2024-03-21 12:55:35 -03:00
parent 554bc21904
commit 37f20da5b1
11 changed files with 179 additions and 0 deletions

38
.github/workflows/docker_hub_ki8.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: KiBot (KiCad 8) Docker image
on:
push:
tags:
- ki8_*
repository_dispatch:
types: [build_k8]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
run: |
cd ki8
./build.sh

View File

@ -0,0 +1,42 @@
name: KiBot (KiCad 8 deps) Docker image
on:
push:
tags:
- ki8p_*
repository_dispatch:
types: [build_k8p]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
run: |
cd ki8_pre
./build.sh
- name: Trigger KiCad-Auto image build
run: |
curl -X POST -u "${{secrets.PAT_USERNAME}}:${{secrets.PAT_TOKEN}}" -H "Accept: application/vnd.github.v3+json" -H "Content-Type: application/json" https://api.github.com/repos/INTI-CMNB/kicad_auto/dispatches --data '{"event_type": "build_k8"}'

View File

@ -12,6 +12,12 @@ docker tag ghcr.io/inti-cmnb/kicad_auto:ki7 setsoft/kicad_auto:ki7
docker tag ghcr.io/inti-cmnb/kicad_auto:ki7 ghcr.io/inti-cmnb/kicad7_auto:latest docker tag ghcr.io/inti-cmnb/kicad_auto:ki7 ghcr.io/inti-cmnb/kicad7_auto:latest
docker push setsoft/kicad_auto:ki7 docker push setsoft/kicad_auto:ki7
docker push ghcr.io/inti-cmnb/kicad7_auto:latest docker push ghcr.io/inti-cmnb/kicad7_auto:latest
# KiCad 8
docker pull ghcr.io/inti-cmnb/kicad_auto:ki8
docker tag ghcr.io/inti-cmnb/kicad_auto:ki8 setsoft/kicad_auto:ki8
docker tag ghcr.io/inti-cmnb/kicad_auto:ki8 ghcr.io/inti-cmnb/kicad8_auto:latest
docker push setsoft/kicad_auto:ki8
docker push ghcr.io/inti-cmnb/kicad8_auto:latest
# KiCad 5 # KiCad 5
docker pull ghcr.io/inti-cmnb/kicad_auto:ki5 docker pull ghcr.io/inti-cmnb/kicad_auto:ki5
docker tag ghcr.io/inti-cmnb/kicad_auto:ki5 setsoft/kicad_auto:latest docker tag ghcr.io/inti-cmnb/kicad_auto:ki5 setsoft/kicad_auto:latest

30
ki8/Dockerfile Normal file
View File

@ -0,0 +1,30 @@
FROM ghcr.io/inti-cmnb/kicad8_auto:latest_deps
MAINTAINER Salvador E. Tropea <set@ieee.org>
LABEL Description="KiCad 8 w/KiBot and other automation scripts"
LABEL org.opencontainers.image.description "KiCad 8 w/KiBot and other automation scripts"
# Install all the tools, dependencies are already installed
RUN apt-get update && \
dl_deb.py INTI-CMNB/KiBoM && \
dl_deb.py INTI-CMNB/kicad-git-filters && \
dl_deb.py set-soft/kicost-digikey-api-v3 && \
dl_deb.py hildogjr/KiCost && \
dl_deb.py INTI-CMNB/InteractiveHtmlBom && \
dl_deb.py set-soft/pcbnewTransition && \
dl_deb.py INTI-CMNB/KiKit --skip kikit-doc && \
dl_deb.py INTI-CMNB/KiAuto && \
dl_deb.py INTI-CMNB/kidiff && \
dl_deb.py INTI-CMNB/KiBot && \
apt -y install --no-install-recommends ./*.deb && \
apt-get -y autoremove && \
rm /*.deb && \
rm -rf /var/lib/apt/lists/* /var/cache/debconf/templates.dat-old /var/lib/dpkg/status-old
ARG iteration
ENV KIBOT_ITERATION=$iteration
RUN kibot --version | sed 's/.* \([0-9]\+\.[0-9]\+\.[0-9]\+\) .*/\1/' | tr -d '\n' > /etc/kiauto_tag && \
echo -n -${KIBOT_ITERATION}_k >> /etc/kiauto_tag && \
kicad_version.py >> /etc/kiauto_tag && \
echo -n _d >> /etc/kiauto_tag && \
cat /etc/debian_version | tr -d '\n' >> /etc/kiauto_tag

18
ki8/build.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
set -e
. ../iteration.sh
docker build -f Dockerfile --build-arg iteration=${IT} -t ghcr.io/inti-cmnb/kicad8_auto:latest .
TG1=`docker run --rm ghcr.io/inti-cmnb/kicad8_auto:latest kibot --version | sed 's/.* \([0-9]\+\.[0-9]\+\.[0-9]\+\) .*/\1/' | tr -d '\n'`
TG2=k`docker run --rm ghcr.io/inti-cmnb/kicad8_auto:latest kicad_version.py`
TG3=d_sid
docker tag ghcr.io/inti-cmnb/kicad8_auto:latest ghcr.io/inti-cmnb/kicad8_auto:${TG1}-${IT}_${TG2}_${TG3}
docker tag ghcr.io/inti-cmnb/kicad8_auto:latest ghcr.io/inti-cmnb/kicad8_auto:${TG1}
docker tag ghcr.io/inti-cmnb/kicad8_auto:latest ghcr.io/inti-cmnb/kicad_auto:ki8
docker push ghcr.io/inti-cmnb/kicad8_auto:${TG1}-${IT}_${TG2}_${TG3}
docker push ghcr.io/inti-cmnb/kicad8_auto:${TG1}
docker push ghcr.io/inti-cmnb/kicad_auto:ki8
# Leave the following for the deploy:
#docker tag ghcr.io/inti-cmnb/kicad8_auto:latest setsoft/kicad_auto:ki8
#docker push ghcr.io/inti-cmnb/kicad8_auto:latest
#docker push setsoft/kicad_auto:ki8

2
ki8/run_shell.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
docker run --rm -it ghcr.io/inti-cmnb/kicad_auto:ki8 /bin/bash

13
ki8/run_shell_same_user.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
docker run --rm -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY \
--user $USER_ID:$GROUP_ID \
--env NO_AT_BRIDGE=1 \
--workdir="/home/$USER" \
--volume="/etc/group:/etc/group:ro" \
--volume="/home/$USER:/home/$USER:rw" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
--volume="/home/$USER:/home/$USER:rw" \
ghcr.io/inti-cmnb/kicad_auto:ki8 /bin/bash

5
ki8_pre/Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM ghcr.io/inti-cmnb/kicad8_debian:latest
MAINTAINER Salvador E. Tropea <set@ieee.org>
LABEL Description="Layer used for new dependencies"
LABEL org.opencontainers.image.description "Layer used for new dependencies"

10
ki8_pre/build.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
set -e
cp ../dl_deb.py .
docker build -f Dockerfile -t ghcr.io/inti-cmnb/kicad8_auto:latest_deps .
TG1=`docker run --rm ghcr.io/inti-cmnb/kicad8_auto:latest_deps kicad_version.py`
TG2=d_sid
docker tag ghcr.io/inti-cmnb/kicad8_auto:latest_deps ghcr.io/inti-cmnb/kicad8_auto:${TG1}_${TG2}_deps
docker push ghcr.io/inti-cmnb/kicad8_auto:${TG1}_${TG2}_deps
docker push ghcr.io/inti-cmnb/kicad8_auto:latest_deps

2
ki8_pre/run_shell.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
docker run --rm -it ghcr.io/inti-cmnb/kicad8_auto:latest_deps /bin/bash

13
ki8_pre/run_shell_same_user.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
export USER_ID=$(id -u)
export GROUP_ID=$(id -g)
docker run --rm -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY \
--user $USER_ID:$GROUP_ID \
--env NO_AT_BRIDGE=1 \
--workdir="/home/$USER" \
--volume="/etc/group:/etc/group:ro" \
--volume="/home/$USER:/home/$USER:rw" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
--volume="/home/$USER:/home/$USER:rw" \
ghcr.io/inti-cmnb/kicad8_auto:latest_deps /bin/bash