Skip to content

Commit

Permalink
minor tweaks (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
NyakudyaA authored Dec 20, 2022
1 parent 904607b commit e7fd886
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .example.env
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ LANGS="en_US.UTF-8,id_ID.UTF-8"
POSTGRES_MAJOR_VERSION=15
POSTGIS_MAJOR_VERSION=3
POSTGIS_MINOR_RELEASE=3
BUILD_TIMESCALE=true
BUILD_TIMESCALE=false
24 changes: 14 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ if [[ ! -f .env ]]; then
echo "Default build arguments don't exists. Creating one from default value."
cp .example.env .env
fi
source .env

if [[ $(dpkg -l | grep "docker-compose") > /dev/null ]];then
docker-compose -f docker-compose.build.yml build postgis-prod
else
docker compose -f docker-compose.build.yml build postgis-prod
fi
if [[ ${BUILD_TIMESCALE} =~ [Ff][Aa][Ll][Ss][Ee] ]];then
if [[ $(dpkg -l | grep "docker-compose") > /dev/null ]];then
docker-compose -f docker-compose.build.yml build postgis-prod
else
docker compose -f docker-compose.build.yml build postgis-prod
fi

#if [[ $(dpkg -l | grep "docker-compose") > /dev/null ]];then
#docker-compose -f docker-compose.build-timescale.yml build postgis-prod
#else
#docker compose -f docker-compose.build-timescale.yml build postgis-prod
#fi
else
if [[ $(dpkg -l | grep "docker-compose") > /dev/null ]];then
docker-compose -f docker-compose.build-timescale.yml build postgis-prod
else
docker compose -f docker-compose.build-timescale.yml build postgis-prod
fi
fi
2 changes: 1 addition & 1 deletion scripts/env-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fi

function generate_random_string() {
STRING_LENGTH=$1
random_pass_string=$(openssl rand -base64 ${STRING_LENGTH})
random_pass_string=$(cat /dev/urandom | tr -dc '[:alnum:]' | head -c "${STRING_LENGTH}")
if [[ ! -f /scripts/.pass_${STRING_LENGTH}.txt ]]; then
echo ${random_pass_string} > /scripts/.pass_${STRING_LENGTH}.txt
fi
Expand Down

0 comments on commit e7fd886

Please sign in to comment.