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 missing releases #139

Merged
merged 2 commits into from Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -6,9 +6,9 @@ env:
BASE=5.5-apache
- VERSION=1.5.6.3
BASE=5.6-apache
- VERSION=1.6.1.19
- VERSION=1.6.1.22
BASE=7.0-apache
- VERSION=1.7.4.2
- VERSION=1.7.4.3
BASE=apache

- VERSION=1.7-5.5-apache
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -5,8 +5,8 @@
## Supported tags

### Image by PrestaShop version
* `1.7`, `1.7.4.2`, `latest`
* `1.6`, `1.6.1.19`
* `1.7`, `1.7.4.3`, `latest`
* `1.6`, `1.6.1.22`
* `1.5`, `1.5.6.3`
* `1.4`, `1.4.11.1`
* `nightly` (Latest but unstable release from git)
Expand Down
50 changes: 50 additions & 0 deletions base/images/5.3-apache/Dockerfile
@@ -0,0 +1,50 @@
FROM alterway/php:5.3-apache
LABEL maintainer="Thomas Nabord <thomas.nabord@prestashop.com>"

ENV PS_DOMAIN="<to be defined>" \
DB_SERVER="<to be defined>" \
DB_PORT=3306 \
DB_NAME=prestashop \
DB_USER=root \
DB_PASSWD=admin \
DB_PREFIX=ps_ \
ADMIN_MAIL=demo@prestashop.com \
ADMIN_PASSWD=prestashop_demo \
PS_LANGUAGE=en \
PS_COUNTRY=GB \
PS_INSTALL_AUTO=0 \
PS_ERASE_DB=0 \
PS_DEV_MODE=0 \
PS_HOST_MODE=0 \
PS_HANDLE_DYNAMIC_DOMAIN=0 \
PS_FOLDER_ADMIN=admin \
PS_FOLDER_INSTALL=install

RUN apt-get update \
&& apt-get install -y libmcrypt-dev \
libpcre3-dev \
libpng-dev \
libfreetype6-dev \
libxml2-dev \
libicu-dev \
mysql-client \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install iconv intl pdo_mysql mbstring soap gd zip mysql mcrypt

# Prepare install and CMD script
COPY config_files/ps-extractor.sh config_files/docker_run.sh /tmp/

# If handle dynamic domain
COPY config_files/docker_updt_ps_domains.php /tmp/

# Apache configuration
RUN if [ -x "$(command -v apache2-foreground)" ]; then a2enmod rewrite; fi

# PHP configuration
COPY config_files/php.ini /usr/local/etc/php/

# Run
CMD ["/tmp/docker_run.sh"]
82 changes: 82 additions & 0 deletions base/images/5.3-apache/config_files/docker_run.sh
@@ -0,0 +1,82 @@
#!/bin/sh

if [ "$DB_SERVER" = "<to be defined>" -a $PS_INSTALL_AUTO = 1 ]; then
echo >&2 'error: You requested automatic PrestaShop installation but MySQL server address is not provided '
echo >&2 ' You need to specify DB_SERVER in order to proceed'
exit 1
fi

if [ ! -f ./config/settings.inc.php ]; then
echo "\n* Reapplying PrestaShop files for enabled volumes ...";

# init if empty
cp -n -R -p /tmp/data-ps/prestashop/* /var/www/html

if [ $PS_DEV_MODE -ne 0 ]; then
echo "\n* Enabling DEV mode ...";
sed -ie "s/define('_PS_MODE_DEV_', false);/define('_PS_MODE_DEV_',\ true);/g" /var/www/html/config/defines.inc.php
fi

if [ $PS_HOST_MODE -ne 0 ]; then
echo "\n* Enabling HOST mode ...";
echo "define('_PS_HOST_MODE_', true);" >> /var/www/html/config/defines.inc.php
fi

if [ $PS_FOLDER_INSTALL != "install" ]; then
echo "\n* Renaming install folder as $PS_FOLDER_INSTALL ...";
mv /var/www/html/install /var/www/html/$PS_FOLDER_INSTALL/
fi

if [ $PS_FOLDER_ADMIN != "admin" ]; then
echo "\n* Renaming admin folder as $PS_FOLDER_ADMIN ...";
mv /var/www/html/admin /var/www/html/$PS_FOLDER_ADMIN/
fi

if [ $PS_HANDLE_DYNAMIC_DOMAIN = 1 ]; then
cp /tmp/docker_updt_ps_domains.php /var/www/html
sed -ie "s/DirectoryIndex\ index.php\ index.html/DirectoryIndex\ docker_updt_ps_domains.php\ index.php\ index.html/g" $APACHE_CONFDIR/conf-available/docker-php.conf
fi

if [ $PS_INSTALL_AUTO = 1 ]; then
RET=1
while [ $RET -ne 0 ]; do
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

echo "\n* Installing PrestaShop, this may take a while ...";
if [ $PS_ERASE_DB = 1 ]; then
echo "\n* Drop & recreate mysql database...";
if [ $DB_PASSWD = "" ]; then
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER drop $DB_NAME --force 2> /dev/null;
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER create $DB_NAME --force 2> /dev/null;
else
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD drop $DB_NAME --force 2> /dev/null;
mysqladmin -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD create $DB_NAME --force 2> /dev/null;
fi
fi

if [ "$PS_DOMAIN" = "<to be defined>" ]; then
export PS_DOMAIN=$(hostname -i)
fi

runuser -g www-data -u www-data -- php /var/www/html/$PS_FOLDER_INSTALL/index_cli.php \
--domain="$PS_DOMAIN" --db_server=$DB_SERVER:$DB_PORT --db_name="$DB_NAME" --db_user=$DB_USER \
--db_password=$DB_PASSWD --prefix="$DB_PREFIX" --firstname="John" --lastname="Doe" \
--password=$ADMIN_PASSWD --email="$ADMIN_MAIL" --language=$PS_LANGUAGE --country=$PS_COUNTRY \
--newsletter=0 --send_email=0

if [ $? -ne 0 ]; then
echo 'warning: PrestaShop installation failed.'
fi
fi
else
echo "\n* Pretashop Core already installed...";
fi

echo "\n* Almost ! Starting web server now\n";
exec apache2-foreground
57 changes: 57 additions & 0 deletions base/images/5.3-apache/config_files/docker_updt_ps_domains.php
@@ -0,0 +1,57 @@
<?php
/**
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2016 PrestaShop SA
* @version Release: $Revision: 14390 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/

// Workaround for redirection on init
$_POST['id_shop'] = 1;

require_once 'config/config.inc.php';

if (!defined('_PS_VERSION_'))
exit;

// First, we get the URL used to reach this page.
$domain = Tools::getHttpHost();
$old_domain = Configuration::get('PS_SHOP_DOMAIN');

if (version_compare(_PS_VERSION_, '1.5', '>=') && $domain != $old_domain && !Shop::isFeatureActive())
{
$url = ShopUrl::getShopUrls(Configuration::get('PS_SHOP_DEFAULT'))->where('main', '=', 1)->getFirst();
if ($url)
{
$url->domain = $domain;
$url->domain_ssl = $domain;
$url->save();

// Then, we update the configuration table
Configuration::updateValue('PS_SHOP_DOMAIN', $domain);
Configuration::updateValue('PS_SHOP_DOMAIN_SSL', $domain);
}
}

//unlink(__FILE__);
Tools::redirect("index.php");
die();