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

Adding multi install lock #184

Merged
merged 3 commits into from Oct 9, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -7,7 +7,11 @@ if [ "$DB_SERVER" = "<to be defined>" -a $PS_INSTALL_AUTO = 1 ]; then
exit 1
fi

if [ ! -f ./config/settings.inc.php ]; then
if [ ! -f ./config/settings.inc.php ] && [ ! -f ./install.lock ]; then

echo "\n* Setting up install lock file..."
touch ./install.lock

echo "\n* Reapplying PrestaShop files for enabled volumes ...";

# init if empty
@@ -57,7 +61,7 @@ if [ ! -f ./config/settings.inc.php ]; then
if [ $PS_ERASE_DB = 1 ]; then
echo "\n* Drop & recreate mysql database...";
if [ $DB_PASSWD = "" ]; then
echo "\n* Dropping existing database $DB_NAME..."
echo "\n* Dropping existing database $DB_NAME..."
mysql -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD -e "drop database if exists $DB_NAME;"
echo "\n* Creating database $DB_NAME..."
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER create $DB_NAME -p$DB_PASSWD --force;
@@ -95,6 +99,21 @@ if [ ! -f ./config/settings.inc.php ]; then
echo "\n* No post-install script found, let's continue..."
fi

echo "\n* Setup completed, removing lock file..."
rm ./install.lock

elif [ ! -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Another setup is currently running..."
sleep 10
exit 42

elif [ -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Shop seems setup but remaining install lock still present..."
sleep 10
exit 42

else
echo "\n* Pretashop Core already installed...";
fi
@@ -32,7 +32,7 @@ RUN apt-get update \
libxml2-dev \
libicu-dev \
libzip-dev \
mysql-client \
default-mysql-client \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/* \
@@ -7,7 +7,11 @@ if [ "$DB_SERVER" = "<to be defined>" -a $PS_INSTALL_AUTO = 1 ]; then
exit 1
fi

if [ ! -f ./config/settings.inc.php ]; then
if [ ! -f ./config/settings.inc.php ] && [ ! -f ./install.lock ]; then

echo "\n* Setting up install lock file..."
touch ./install.lock

echo "\n* Reapplying PrestaShop files for enabled volumes ...";

# init if empty
@@ -57,7 +61,7 @@ if [ ! -f ./config/settings.inc.php ]; then
if [ $PS_ERASE_DB = 1 ]; then
echo "\n* Drop & recreate mysql database...";
if [ $DB_PASSWD = "" ]; then
echo "\n* Dropping existing database $DB_NAME..."
echo "\n* Dropping existing database $DB_NAME..."
mysql -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD -e "drop database if exists $DB_NAME;"
echo "\n* Creating database $DB_NAME..."
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER create $DB_NAME -p$DB_PASSWD --force;
@@ -95,6 +99,21 @@ if [ ! -f ./config/settings.inc.php ]; then
echo "\n* No post-install script found, let's continue..."
fi

echo "\n* Setup completed, removing lock file..."
rm ./install.lock

elif [ ! -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Another setup is currently running..."
sleep 10
exit 42

elif [ -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Shop seems setup but remaining install lock still present..."
sleep 10
exit 42

else
echo "\n* Pretashop Core already installed...";
fi
@@ -32,7 +32,7 @@ RUN apt-get update \
libxml2-dev \
libicu-dev \
libzip-dev \
mysql-client \
default-mysql-client \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/* \
@@ -7,7 +7,11 @@ if [ "$DB_SERVER" = "<to be defined>" -a $PS_INSTALL_AUTO = 1 ]; then
exit 1
fi

if [ ! -f ./config/settings.inc.php ]; then
if [ ! -f ./config/settings.inc.php ] && [ ! -f ./install.lock ]; then

echo "\n* Setting up install lock file..."
touch ./install.lock

echo "\n* Reapplying PrestaShop files for enabled volumes ...";

# init if empty
@@ -57,7 +61,7 @@ if [ ! -f ./config/settings.inc.php ]; then
if [ $PS_ERASE_DB = 1 ]; then
echo "\n* Drop & recreate mysql database...";
if [ $DB_PASSWD = "" ]; then
echo "\n* Dropping existing database $DB_NAME..."
echo "\n* Dropping existing database $DB_NAME..."
mysql -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD -e "drop database if exists $DB_NAME;"
echo "\n* Creating database $DB_NAME..."
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER create $DB_NAME -p$DB_PASSWD --force;
@@ -95,6 +99,21 @@ if [ ! -f ./config/settings.inc.php ]; then
echo "\n* No post-install script found, let's continue..."
fi

echo "\n* Setup completed, removing lock file..."
rm ./install.lock

elif [ ! -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Another setup is currently running..."
sleep 10
exit 42

elif [ -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Shop seems setup but remaining install lock still present..."
sleep 10
exit 42

else
echo "\n* Pretashop Core already installed...";
fi
@@ -32,7 +32,7 @@ RUN apt-get update \
libxml2-dev \
libicu-dev \
libzip-dev \
mysql-client \
default-mysql-client \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/* \
@@ -7,7 +7,11 @@ if [ "$DB_SERVER" = "<to be defined>" -a $PS_INSTALL_AUTO = 1 ]; then
exit 1
fi

if [ ! -f ./config/settings.inc.php ]; then
if [ ! -f ./config/settings.inc.php ] && [ ! -f ./install.lock ]; then

echo "\n* Setting up install lock file..."
touch ./install.lock

echo "\n* Reapplying PrestaShop files for enabled volumes ...";

# init if empty
@@ -57,7 +61,7 @@ if [ ! -f ./config/settings.inc.php ]; then
if [ $PS_ERASE_DB = 1 ]; then
echo "\n* Drop & recreate mysql database...";
if [ $DB_PASSWD = "" ]; then
echo "\n* Dropping existing database $DB_NAME..."
echo "\n* Dropping existing database $DB_NAME..."
mysql -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD -e "drop database if exists $DB_NAME;"
echo "\n* Creating database $DB_NAME..."
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER create $DB_NAME -p$DB_PASSWD --force;
@@ -95,6 +99,21 @@ if [ ! -f ./config/settings.inc.php ]; then
echo "\n* No post-install script found, let's continue..."
fi

echo "\n* Setup completed, removing lock file..."
rm ./install.lock

elif [ ! -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Another setup is currently running..."
sleep 10
exit 42

elif [ -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Shop seems setup but remaining install lock still present..."
sleep 10
exit 42

else
echo "\n* Pretashop Core already installed...";
fi
@@ -32,7 +32,7 @@ RUN apt-get update \
libxml2-dev \
libicu-dev \
libzip-dev \
mysql-client \
default-mysql-client \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/* \
@@ -7,7 +7,11 @@ if [ "$DB_SERVER" = "<to be defined>" -a $PS_INSTALL_AUTO = 1 ]; then
exit 1
fi

if [ ! -f ./config/settings.inc.php ]; then
if [ ! -f ./config/settings.inc.php ] && [ ! -f ./install.lock ]; then

echo "\n* Setting up install lock file..."
touch ./install.lock

echo "\n* Reapplying PrestaShop files for enabled volumes ...";

# init if empty
@@ -57,7 +61,7 @@ if [ ! -f ./config/settings.inc.php ]; then
if [ $PS_ERASE_DB = 1 ]; then
echo "\n* Drop & recreate mysql database...";
if [ $DB_PASSWD = "" ]; then
echo "\n* Dropping existing database $DB_NAME..."
echo "\n* Dropping existing database $DB_NAME..."
mysql -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD -e "drop database if exists $DB_NAME;"
echo "\n* Creating database $DB_NAME..."
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER create $DB_NAME -p$DB_PASSWD --force;
@@ -95,6 +99,21 @@ if [ ! -f ./config/settings.inc.php ]; then
echo "\n* No post-install script found, let's continue..."
fi

echo "\n* Setup completed, removing lock file..."
rm ./install.lock

elif [ ! -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Another setup is currently running..."
sleep 10
exit 42

elif [ -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Shop seems setup but remaining install lock still present..."
sleep 10
exit 42

else
echo "\n* Pretashop Core already installed...";
fi
@@ -7,7 +7,11 @@ if [ "$DB_SERVER" = "<to be defined>" -a $PS_INSTALL_AUTO = 1 ]; then
exit 1
fi

if [ ! -f ./config/settings.inc.php ]; then
if [ ! -f ./config/settings.inc.php ] && [ ! -f ./install.lock ]; then

echo "\n* Setting up install lock file..."
touch ./install.lock

echo "\n* Reapplying PrestaShop files for enabled volumes ...";

# init if empty
@@ -57,7 +61,7 @@ if [ ! -f ./config/settings.inc.php ]; then
if [ $PS_ERASE_DB = 1 ]; then
echo "\n* Drop & recreate mysql database...";
if [ $DB_PASSWD = "" ]; then
echo "\n* Dropping existing database $DB_NAME..."
echo "\n* Dropping existing database $DB_NAME..."
mysql -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD -e "drop database if exists $DB_NAME;"
echo "\n* Creating database $DB_NAME..."
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER create $DB_NAME -p$DB_PASSWD --force;
@@ -95,6 +99,21 @@ if [ ! -f ./config/settings.inc.php ]; then
echo "\n* No post-install script found, let's continue..."
fi

echo "\n* Setup completed, removing lock file..."
rm ./install.lock

elif [ ! -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Another setup is currently running..."
sleep 10
exit 42

elif [ -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Shop seems setup but remaining install lock still present..."
sleep 10
exit 42

else
echo "\n* Pretashop Core already installed...";
fi
@@ -7,7 +7,11 @@ if [ "$DB_SERVER" = "<to be defined>" -a $PS_INSTALL_AUTO = 1 ]; then
exit 1
fi

if [ ! -f ./config/settings.inc.php ]; then
if [ ! -f ./config/settings.inc.php ] && [ ! -f ./install.lock ]; then

echo "\n* Setting up install lock file..."
touch ./install.lock

echo "\n* Reapplying PrestaShop files for enabled volumes ...";

# init if empty
@@ -57,7 +61,7 @@ if [ ! -f ./config/settings.inc.php ]; then
if [ $PS_ERASE_DB = 1 ]; then
echo "\n* Drop & recreate mysql database...";
if [ $DB_PASSWD = "" ]; then
echo "\n* Dropping existing database $DB_NAME..."
echo "\n* Dropping existing database $DB_NAME..."
mysql -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD -e "drop database if exists $DB_NAME;"
echo "\n* Creating database $DB_NAME..."
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER create $DB_NAME -p$DB_PASSWD --force;
@@ -95,6 +99,21 @@ if [ ! -f ./config/settings.inc.php ]; then
echo "\n* No post-install script found, let's continue..."
fi

echo "\n* Setup completed, removing lock file..."
rm ./install.lock

elif [ ! -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Another setup is currently running..."
sleep 10
exit 42

elif [ -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Shop seems setup but remaining install lock still present..."
sleep 10
exit 42

else
echo "\n* Pretashop Core already installed...";
fi
@@ -7,7 +7,11 @@ if [ "$DB_SERVER" = "<to be defined>" -a $PS_INSTALL_AUTO = 1 ]; then
exit 1
fi

if [ ! -f ./config/settings.inc.php ]; then
if [ ! -f ./config/settings.inc.php ] && [ ! -f ./install.lock ]; then

echo "\n* Setting up install lock file..."
touch ./install.lock

echo "\n* Reapplying PrestaShop files for enabled volumes ...";

# init if empty
@@ -57,7 +61,7 @@ if [ ! -f ./config/settings.inc.php ]; then
if [ $PS_ERASE_DB = 1 ]; then
echo "\n* Drop & recreate mysql database...";
if [ $DB_PASSWD = "" ]; then
echo "\n* Dropping existing database $DB_NAME..."
echo "\n* Dropping existing database $DB_NAME..."
mysql -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD -e "drop database if exists $DB_NAME;"
echo "\n* Creating database $DB_NAME..."
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER create $DB_NAME -p$DB_PASSWD --force;
@@ -95,6 +99,21 @@ if [ ! -f ./config/settings.inc.php ]; then
echo "\n* No post-install script found, let's continue..."
fi

echo "\n* Setup completed, removing lock file..."
rm ./install.lock

elif [ ! -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Another setup is currently running..."
sleep 10
exit 42

elif [ -f ./config/settings.inc.php ] && [ -f ./install.lock ]; then

echo "\n* Shop seems setup but remaining install lock still present..."
sleep 10
exit 42

else
echo "\n* Pretashop Core already installed...";
fi
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.