22 lines
572 B
Bash
Executable File
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 |