Skip to content

Commit

Permalink
Replace wait-for-it with pg_isready within setup_suite.sh (#879)
Browse files Browse the repository at this point in the history
## Before

```
 # Wait for postgis
    wait-for-it -h ${G3WSUITE_POSTGRES_HOST:-postgis} -p ${G3WSUITE_POSTGRES_PORT:-5432} -t 60
```

## After

```
# Wait for postgis

until pg_isready -h ${G3WSUITE_POSTGRES_HOST:-postgis} -p ${G3WSUITE_POSTGRES_PORT:-5432}; do
  echo "wait 30s until is ready"
  sleep 30;
done
```
  • Loading branch information
Raruto authored Jun 18, 2024
1 parent 2ab92d0 commit 2979275
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ci_scripts/setup_suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ if [ ! -e ${SETUP_DONE_FILE} ]; then
ls ${PROJECTS_DIR} || mkdir ${PROJECTS_DIR}
ls ${DATASOURCE_PATH} || mkdir ${DATASOURCE_PATH}

wait-for-it -h ${G3WSUITE_POSTGRES_HOST:-postgis} -p ${G3WSUITE_POSTGRES_PORT:-5432} -t 60

until pg_isready -h ${G3WSUITE_POSTGRES_HOST:-postgis} -p ${G3WSUITE_POSTGRES_PORT:-5432}; do
echo "wait 30s until is ready"
sleep 30;
done

pushd .
cd ${DJANGO_DIRECTORY}/core/static
rm -rf bower_components
Expand Down Expand Up @@ -81,7 +84,10 @@ if [ ! -e ${SETUP_DONE_FILE} ]; then
else
echo "Setup was already done, skipping ..."
# Wait for postgis
wait-for-it -h ${G3WSUITE_POSTGRES_HOST:-postgis} -p ${G3WSUITE_POSTGRES_PORT:-5432} -t 60
until pg_isready -h ${G3WSUITE_POSTGRES_HOST:-postgis} -p ${G3WSUITE_POSTGRES_PORT:-5432}; do
echo "wait 30s until is ready"
sleep 30;
done

# Restore on restart ln -s for bower_component
cd ${DJANGO_DIRECTORY}/core/static
Expand Down

0 comments on commit 2979275

Please sign in to comment.