feat: improved build script
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
old_pwd=$(pwd)
|
||||
cd $2
|
||||
|
||||
echo "Build will be tagged with $1"
|
||||
echo "Build directory is $(pwd)"
|
||||
|
||||
OLD_IMG=$(docker image ls -q "$1")
|
||||
docker buildx build . -t "$1"
|
||||
|
||||
echo "Build complete, starting upload..."
|
||||
docker push "$1"
|
||||
|
||||
if [ -n "$OLD_IMG" ]; then
|
||||
if [ "$OLD_IMG" != "$(docker image ls -q "$1")" ]; then
|
||||
echo "New build uploaded, removing old image, id: $OLD_IMG"
|
||||
docker image rmi -f "$OLD_IMG" || true
|
||||
echo "Exit status: $?"
|
||||
fi
|
||||
fi
|
||||
|
||||
cd $old_pwd
|
||||
@@ -3,29 +3,24 @@
|
||||
echo "
|
||||
Building base container
|
||||
"
|
||||
cd base
|
||||
docker buildx build . -t git.janishutz.com/registry/dev-container-base
|
||||
./build-helper.sh git.janishutz.com/registry/dev-container-base base
|
||||
|
||||
echo "
|
||||
Building npm container
|
||||
"
|
||||
cd ../npm
|
||||
docker buildx build . -t git.janishutz.com/registry/dev-container-npm
|
||||
./build-helper.sh git.janishutz.com/registry/dev-container-npm npm
|
||||
|
||||
echo "
|
||||
Building Vue container
|
||||
"
|
||||
cd ../vue
|
||||
docker buildx build . -t git.janishutz.com/registry/dev-container-vue
|
||||
./build-helper.sh git.janishutz.com/registry/dev-container-vue vue
|
||||
#
|
||||
# echo "
|
||||
# Building Python container
|
||||
# "
|
||||
# cd ../python
|
||||
# docker buildx build . -t git.janishutz.com/registry/dev-container-python
|
||||
# ./build-helper.sh git.janishutz.com/registry/dev-container-python python
|
||||
#
|
||||
# echo "
|
||||
# Building php container
|
||||
# "
|
||||
# cd ../php
|
||||
# docker buildx build . -t git.janishutz.com/registry/dev-container-php
|
||||
# ./build-helper.sh git.janishutz.com/registry/dev-container-php php
|
||||
|
||||
Reference in New Issue
Block a user