Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix API container connection check to DB #370

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions docker/api/exec-pre-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,19 @@ else
touch "/tmp/pre-exec.lock"
fi

set -e

cp /etc/cnaas-nms/repository.yml /tmp/repository.yml.original
sed -e "s|^\(templates_remote: \).\+$|\1 $GITREPO_TEMPLATES|" \
-e "s|^\(settings_remote: \).\+$|\1 $GITREPO_SETTINGS|" \
< /tmp/repository.yml.original > /tmp/repository.yml.new \
&& cat /tmp/repository.yml.new > /etc/cnaas-nms/repository.yml

#if [ -e "/opt/cnaas/settings" ]; then
# rm -rf /opt/cnaas/settings
#fi
#if [ -e "/opt/cnaas/templates" ]; then
# rm -rf /opt/cnaas/templates
#fi
#git clone $GITREPO_SETTINGS /opt/cnaas/settings
#git clone $GITREPO_TEMPLATES /opt/cnaas/templates
set -e

# Wait for postgres to start
echo ">> Waiting for postgres to start"
WAIT=0
while ! nc -z cnaas_postgres 5432; do
DB_HOSTNAME=`cat /etc/cnaas-nms/db_config.yml | awk '/^hostname/ {print $2}'`
while ! nc -z $DB_HOSTNAME 5432; do
sleep 1
WAIT=$(($WAIT + 1))
if [ "$WAIT" -gt 15 ]; then
Expand Down
Loading