Skip to content

Commit

Permalink
[CI/CD][Added][KiCad 8] dev images creation
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Mar 26, 2024
1 parent 9b0e208 commit 697585e
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/dev_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
push_to_registry:
strategy:
matrix:
ki_release: [dev_image_k5, dev_image_k6, dev_image_k7, dev_image_k5f, dev_image_k6f, dev_image_k7f]
ki_release: [dev_image_k5, dev_image_k6, dev_image_k7, dev_image_k8, dev_image_k5f, dev_image_k6f, dev_image_k7f, dev_image_k8f]

name: Docker ${{ matrix.ki_release }}
runs-on: ubuntu-latest
Expand All @@ -21,16 +21,16 @@ jobs:

steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
33 changes: 33 additions & 0 deletions tools/dev_image_k8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM ghcr.io/inti-cmnb/kicad_auto:ki8
MAINTAINER Salvador E. Tropea <[email protected]>
LABEL Description="KiCad 7 with KiBot and other automation scripts"

RUN dpkg --remove kicost kibot && \
apt-get update && \
apt-get -y install --no-install-recommends curl unzip python3-pip && \
curl https://codeload.github.com/INTI-CMNB/KiBot/zip/refs/heads/dev --output pp.zip && \
unzip pp.zip && \
pip3 install --break-system-packages --no-compile KiBot-dev/ && \
rm -rf KiBot-dev pp.zip && \
curl https://codeload.github.com/hildogjr/KiCost/zip/refs/heads/master --output pp.zip && \
unzip pp.zip && \
pip3 install --break-system-packages KiCost-master/ && \
apt-get -y remove curl unzip python3-pip && \
rm -rf KiCost-master pp.zip && \
rm -rf /var/lib/apt/lists/*

# kidiff depends on KiAuto
# dpkg --remove kiauto && \
# curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \
# unzip pp.zip && \
# pip3 install --break-system-packages KiAuto-master/ && \
# rm -rf KiAuto-master/ pp.zip && \

ARG repo_hash
ENV KIBOT_REPO_HASH=$repo_hash

RUN kibot --version | sed 's/.* \([0-9]\+\.[0-9]\+\.[0-9]\+\) .*/\1/' | tr -d '\n' > /etc/kiauto_tag && \
echo -n -${KIBOT_REPO_HASH}_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
14 changes: 14 additions & 0 deletions tools/dev_image_k8/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
set -e
HASH=`git log --pretty=format:%h -1 | tr -d '\n'`
docker build -f Dockerfile --build-arg repo_hash=${HASH} -t ghcr.io/inti-cmnb/kicad8_auto:dev .
TG1=`docker run --rm ghcr.io/inti-cmnb/kicad8_auto:dev 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:dev kicad_version.py`
TG3=d_sid
docker tag ghcr.io/inti-cmnb/kicad8_auto:dev ghcr.io/inti-cmnb/kicad8_auto:dev_${TG1}-${HASH}_${TG2}_${TG3}
docker tag ghcr.io/inti-cmnb/kicad8_auto:dev ghcr.io/inti-cmnb/kicad_auto:dev_k8_${TG1}-${HASH}_${TG2}_${TG3}
docker tag ghcr.io/inti-cmnb/kicad8_auto:dev ghcr.io/inti-cmnb/kicad_auto:dev_k8
docker push ghcr.io/inti-cmnb/kicad8_auto:dev_${TG1}-${HASH}_${TG2}_${TG3}
docker push ghcr.io/inti-cmnb/kicad_auto:dev_k8_${TG1}-${HASH}_${TG2}_${TG3}
docker push ghcr.io/inti-cmnb/kicad_auto:dev_k8
docker push ghcr.io/inti-cmnb/kicad8_auto:dev
34 changes: 34 additions & 0 deletions tools/dev_image_k8f/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM ghcr.io/inti-cmnb/kicad_auto_test:ki8
MAINTAINER Salvador E. Tropea <[email protected]>
LABEL Description="KiCad 8 with KiBot and other automation scripts"

RUN dpkg --remove kicost kibot && \
apt-get update && \
curl https://codeload.github.com/INTI-CMNB/KiBot/zip/refs/heads/dev --output pp.zip && \
unzip pp.zip && \
pip3 install --break-system-packages --no-compile KiBot-dev/ && \
rm -rf KiBot-dev pp.zip && \
curl https://codeload.github.com/hildogjr/KiCost/zip/refs/heads/master --output pp.zip && \
unzip pp.zip && \
pip3 install --break-system-packages KiCost-master/ && \
rm -rf KiCost-master pp.zip && \
rm -rf /var/lib/apt/lists/*

# kidiff depends on KiAuto
# dpkg --remove kiauto && \
# curl https://codeload.github.com/INTI-CMNB/KiAuto/zip/refs/heads/master --output pp.zip && \
# unzip pp.zip && \
# pip3 install --break-system-packages KiAuto-master/ && \
# rm -rf KiAuto-master/ pp.zip && \

ARG repo_hash
ENV KIBOT_REPO_HASH=$repo_hash
ENV KICAD_AUTO_FULL=1

RUN kibot --version | sed 's/.* \([0-9]\+\.[0-9]\+\.[0-9]\+\) .*/\1/' | tr -d '\n' > /etc/kiauto_tag && \
echo -n -${KIBOT_REPO_HASH}_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 && \
echo -n _b >> /etc/kiauto_tag && \
blender --version | head -n 1 | tr -d 'Blender ' >> /etc/kiauto_tag
15 changes: 15 additions & 0 deletions tools/dev_image_k8f/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
set -e
export HASH=`git log --pretty=format:%h -1 | tr -d '\n'`
docker build -f Dockerfile --build-arg repo_hash=${HASH} -t ghcr.io/inti-cmnb/kicad8_auto_full:dev .
TG1=`docker run --rm ghcr.io/inti-cmnb/kicad8_auto_full:dev 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_full:dev kicad_version.py`
TG3=d_sid
TG4=b`docker run --rm ghcr.io/inti-cmnb/kicad8_auto_full:dev /bin/bash -c "blender --version | head -n 1 | tr -d 'Blender '"`
docker tag ghcr.io/inti-cmnb/kicad8_auto_full:dev ghcr.io/inti-cmnb/kicad8_auto_full:dev_${TG1}-${HASH}_${TG2}_${TG3}_${TG4}
docker tag ghcr.io/inti-cmnb/kicad8_auto_full:dev ghcr.io/inti-cmnb/kicad_auto_full:dev_k8_${TG1}-${HASH}_${TG2}_${TG3}_${TG4}
docker tag ghcr.io/inti-cmnb/kicad8_auto_full:dev ghcr.io/inti-cmnb/kicad_auto_full:dev_k8
docker push ghcr.io/inti-cmnb/kicad8_auto_full:dev_${TG1}-${HASH}_${TG2}_${TG3}_${TG4}
docker push ghcr.io/inti-cmnb/kicad_auto_full:dev_k8_${TG1}-${HASH}_${TG2}_${TG3}_${TG4}
docker push ghcr.io/inti-cmnb/kicad_auto_full:dev_k8
docker push ghcr.io/inti-cmnb/kicad8_auto_full:dev

0 comments on commit 697585e

Please sign in to comment.