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

Add db check #187

Merged
merged 4 commits into from Oct 14, 2019

Conversation

@djodjo3
Copy link
Contributor

djodjo3 commented Oct 14, 2019

Adding a DB check at the start of entrypoint script if PS_INSTALL_AUTO=1 is configured.
There is no reason to reapply files or perform any other operation if DB is not available, it won't work in the end.
This way, container will restart until DB is available, avoiding non idempotent operations to run.

Claude-Arnaud Perrot added 2 commits Oct 14, 2019
@Quetzacoalt91

This comment has been minimized.

Copy link
Member

Quetzacoalt91 commented Oct 14, 2019

Don't you want to delete the same code found later in the file?

RET=1
while [ $RET -ne 0 ]; do
echo "\n* Checking if $DB_SERVER is available..."
mysql -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD -e "status" > /dev/null 2>&1
RET=$?
if [ $RET -ne 0 ]; then
echo "\n* Waiting for confirmation of MySQL service startup";
sleep 5
fi
done

Claude-Arnaud Perrot added 2 commits Oct 14, 2019
@djodjo3

This comment has been minimized.

Copy link
Contributor Author

djodjo3 commented Oct 14, 2019

Good catch @Quetzacoalt91 !
I did not check thoroughly and you're absolutely correct : this part is now redundant.
Just removed it and it works fine without it 👍

@Quetzacoalt91 Quetzacoalt91 merged commit 3ce53e4 into PrestaShop:master Oct 14, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.