Files
docker-stm32/CubeMx/build_and_publish.sh
marc afe409f9d2 new cube clt and mx version
new docker registry
2025-05-26 23:05:40 +02:00

22 lines
572 B
Bash
Executable File

#!/bin/bash
script_dir=$(dirname "$(readlink -f "$0")")
push=false
# Process oprions
while getopts "pt:" opt; do
case $opt in
p) push=true;;
t) tag=$OPTARG;;
\?) echo "Invalid option: -$OPTARG" >&2 ;;
:) echo "Option -$OPTARG requires an argument." >&2 ;;
esac
done
docker build -t docker.springblast.de/stm32/cubemx:$tag $script_dir/.
docker build -t docker.springblast.de/stm32/cubemx:latest $script_dir/.
if [ "$push" = true ]; then
docker push docker.springblast.de/stm32/cubemx:$tag
docker push docker.springblast.de/stm32/cubemx:latest
fi