Update shell scripts
This commit is contained in:
parent
649c152b05
commit
5736188d4c
29
build.sh
29
build.sh
|
@ -1,26 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
usage() {
|
||||
printf "$0 usage: \n -b: build all\n -v Postgres version\n" $0
|
||||
printf "$0 usage: \n -b: force build all\n -v Postgres version\n" $0
|
||||
exit 0
|
||||
}
|
||||
|
||||
build=N
|
||||
forceBuild=N
|
||||
|
||||
while getopts ":hd:bv:" arg; do
|
||||
case $arg in
|
||||
b) build=Y ;;
|
||||
b) forceBuild=Y ;;
|
||||
v) version=${OPTARG} ;;
|
||||
h | *) usage ;;
|
||||
esac
|
||||
done
|
||||
|
||||
[ "$build" = 'N' ] && exit 0
|
||||
|
||||
export API=data/sample-api-users
|
||||
docker build $API -f $API/Dockerfile.prod -t api:prod
|
||||
export CLIENT=data/sample-client-users
|
||||
docker build $CLIENT -f $CLIENT/Dockerfile -t client:prod
|
||||
export DB=data/db
|
||||
version="${version-13.3}"
|
||||
docker build $DB -f $DB/Dockerfile --build-arg "VERSION=${version}" -t "db:${version}"
|
||||
|
||||
if [ -z "$(docker images -q api:prod)" ] || [ "$forceBuild" = 'Y' ]; then
|
||||
export API=data/sample-api-users
|
||||
docker build $API -f $API/Dockerfile.prod -t api:prod
|
||||
fi
|
||||
|
||||
if [ -z "$(docker images -q client:prod)" ] || [ "$forceBuild" = 'Y' ]; then
|
||||
export CLIENT=data/sample-client-users
|
||||
docker build $CLIENT -f $CLIENT/Dockerfile -t client:prod
|
||||
fi
|
||||
|
||||
if [ -z "$(docker images -q db:${version})" ] || [ "$forceBuild" = 'Y' ]; then
|
||||
export DB=data/db
|
||||
docker build $DB -f $DB/Dockerfile --build-arg "VERSION=${version}" -t "db:${version}"
|
||||
fi
|
||||
|
|
4
run.sh
4
run.sh
|
@ -39,7 +39,7 @@ if [ "$interactive" == true ]; then
|
|||
fi
|
||||
|
||||
if [ -n "$postgres_version" ]; then
|
||||
./build.sh -b -v "${postgres_version}"
|
||||
./build.sh -v "${postgres_version}"
|
||||
sed -ni "/repository: db/ {
|
||||
p;
|
||||
n;
|
||||
|
@ -51,7 +51,7 @@ if [ -n "$postgres_version" ]; then
|
|||
}
|
||||
p;" helm/values.yaml
|
||||
else
|
||||
./build.sh -b
|
||||
./build.sh
|
||||
fi
|
||||
|
||||
if [ -n "$enable_ssl" ]; then
|
||||
|
|
Loading…
Reference in New Issue