[docker_test.sh] Use testing URLs only after build, to avoid them in final image

parent ff805498
......@@ -75,14 +75,6 @@ cd "$1"
create_dumb_secrets
# Except for registry URL, useful to push to production registry after build
echo -e "\n==== Replace production URL with testing URL in all files ===="
for f in $(grep -l -r ".picasoft.net" .); do
echo -e "\tFound in" ${f}
sed -i "s/.picasoft.net/.test.picasoft.net/g" ${f}
sed -i "s/registry.test.picasoft.net/registry.picasoft.net/g" ${f}
done
echo -e "\n==== Remove and re-create named external volumes ===="
for v in $(docker-compose config --volumes); do
res=$(grep $v -A 1 docker-compose.yml | grep 'external' || true)
......@@ -103,6 +95,14 @@ docker-compose build
echo -e "\n==== Pull new versions of external images ===="
docker-compose pull
# Except for registry URL, useful to push to production registry after build
echo -e "\n==== Replace production URL with testing URL in all files ===="
for f in $(grep -l -r ".picasoft.net" .); do
echo -e "\tFound in" ${f}
sed -i "s/.picasoft.net/.test.picasoft.net/g" ${f}
sed -i "s/registry.test.picasoft.net/registry.picasoft.net/g" ${f}
done
echo -e "\n==== Lauch $1 ===="
docker-compose up -d
......
......@@ -5,7 +5,7 @@ ENV APP_HOME=/lufi
# Install dependencies
RUN apt-get update \
&& apt-get -yq install build-essential libssl-dev libio-socket-ssl-perl liblwp-protocol-https-perl libpq-dev zlib1g-dev wget unzip \
&& apt-get -yq install build-essential libssl-dev libio-socket-ssl-perl liblwp-protocol-https-perl libpq-dev zlib1g-dev postgresql-client wget unzip \
&& apt-get clean && cpan Carton
# Install Supercronic to run cron jobs
......
......@@ -28,6 +28,11 @@ echo "0 0 * * * carton exec $APP_HOME/script/lufi cron cleanbdd --mode productio
# Delete files which availability delay is over
echo "0 0 * * * carton exec $APP_HOME/script/lufi cron cleanfiles --mode production" > /crontab.conf
# Wait database to be ready
while ! PGPASSWORD="${POSTGRES_PASSWORD}" psql -h"lufidb" -U"${POSTGRES_USER}" -d"${POSTGRES_DB}" -c "SELECT 1" &>/dev/null; do
echo "Database server not ready yet, re-trying in 5 seconds..."
sleep 5
done
echo "Start Lufi..."
$@ &
......
......@@ -139,12 +139,12 @@
mail => {
# Valid values are 'sendmail' and 'smtp'
how => 'smtp',
howargs => ['mail.picasoft.net:587', AuthUser => 'drop@picasoft.net', AuthPass => $ENV{'EMAIL_PASSWORD'}]
owargs => { host => 'mail.picasoft.net', ssl => 'starttls', sasl_username => 'drop', sasl_password => $ENV{'EMAIL_PASSWORD'}, helo => 'drop.test.picasoft.net'}
},
# Email sender address
# optional, default to no-reply@lufi.io
mail_sender => 'picasoft@assos.utc.fr',
mail_sender => 'drop@picasoft.net'
#############
# DB settings
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment