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 "
|
echo "
|
||||||
Building base container
|
Building base container
|
||||||
"
|
"
|
||||||
cd base
|
./build-helper.sh git.janishutz.com/registry/dev-container-base base
|
||||||
docker buildx build . -t git.janishutz.com/registry/dev-container-base
|
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
Building npm container
|
Building npm container
|
||||||
"
|
"
|
||||||
cd ../npm
|
./build-helper.sh git.janishutz.com/registry/dev-container-npm npm
|
||||||
docker buildx build . -t git.janishutz.com/registry/dev-container-npm
|
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
Building Vue container
|
Building Vue container
|
||||||
"
|
"
|
||||||
cd ../vue
|
./build-helper.sh git.janishutz.com/registry/dev-container-vue vue
|
||||||
docker buildx build . -t git.janishutz.com/registry/dev-container-vue
|
|
||||||
#
|
#
|
||||||
# echo "
|
# echo "
|
||||||
# Building Python container
|
# Building Python container
|
||||||
# "
|
# "
|
||||||
# cd ../python
|
# ./build-helper.sh git.janishutz.com/registry/dev-container-python python
|
||||||
# docker buildx build . -t git.janishutz.com/registry/dev-container-python
|
|
||||||
#
|
#
|
||||||
# echo "
|
# echo "
|
||||||
# Building php container
|
# Building php container
|
||||||
# "
|
# "
|
||||||
# cd ../php
|
# ./build-helper.sh git.janishutz.com/registry/dev-container-php php
|
||||||
# docker buildx build . -t git.janishutz.com/registry/dev-container-php
|
|
||||||
|
|||||||
Reference in New Issue
Block a user