From 016c2a29a05b04fd1e6afb7a94eea9d87563b4f5 Mon Sep 17 00:00:00 2001 From: andreika-git Date: Sat, 21 May 2022 19:04:24 +0300 Subject: [PATCH] step2 & step3 automation --- bin/step2_copy_with_docker.sh | 23 +++++++++++++++++++++++ bin/step3_create_board_with_docker.sh | 14 ++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 bin/step2_copy_with_docker.sh create mode 100644 bin/step3_create_board_with_docker.sh diff --git a/bin/step2_copy_with_docker.sh b/bin/step2_copy_with_docker.sh new file mode 100644 index 0000000..d778653 --- /dev/null +++ b/bin/step2_copy_with_docker.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [ ! -f hellen-one/git_scripts ]; then + echo "No submodules?" + git submodule update --init --recursive +fi + + +# This command is me trying to be fancy +# '--entrypoint python3' skips the normal container CMD and starts python3 instead +# using the parameters specified after 'hellen-one' +# +# -v "$(pwd)":/${PWD##*/} simply mounts the current working directory +# at / +# +# '/${PWD##*/}' is doing the $pwd basename thing again + +source revision.txt +echo "BOARD_REVISION=[${BOARD_REVISION}]" + +docker run --rm -t --user $(id -u):$(id -g) --entrypoint python3 -v "$(pwd)":/${PWD##*/} hellen-one ./bin/copy_from_Kicad.py "frames:${BOARD_PREFIX}" "/${PWD##*/}" "../../gerber" "${BOARD_SUFFIX}" "${BOARD_REVISION}" + +echo "Done!" diff --git a/bin/step3_create_board_with_docker.sh b/bin/step3_create_board_with_docker.sh new file mode 100644 index 0000000..ca62d1f --- /dev/null +++ b/bin/step3_create_board_with_docker.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +if [ ! -f hellen-one/git_scripts ]; then + echo "No submodules?" + git submodule update --init --recursive +fi + +# See step2_copy_with_docker.sh for explanation of the following command + +source revision.txt +echo "BOARD_REVISION=[${BOARD_REVISION}]" + +docker run --rm -t --user $(id -u):$(id -g) --entrypoint bash -v "$(pwd)":/${PWD##*/} hellen-one ./bin/create_board_with_prefix.sh "${BOARD_PREFIX}" "/${PWD##*/}" "${BOARD_SUFFIX}" "${BOARD_REVISION}" "bom_replace_${BOARD_PREFIX}${BOARD_SUFFIX}-${BOARD_REVISION}.csv " "${BOARD_PCB_OFFSET}" +