2017-04-14 19:15:10 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-04-30 15:52:22 +02:00
|
|
|
#### halt script on error
|
2017-05-19 13:47:57 +02:00
|
|
|
set -xe
|
2017-04-30 15:52:22 +02:00
|
|
|
|
2017-05-04 10:15:28 +02:00
|
|
|
echo '##### Print docker version'
|
|
|
|
docker --version
|
|
|
|
|
|
|
|
echo '##### Print environment'
|
|
|
|
env | sort
|
|
|
|
|
2017-04-14 20:54:47 +02:00
|
|
|
#### Build the Docker Images
|
2017-04-14 19:31:09 +02:00
|
|
|
if [ -n "${PHP_VERSION}" ]; then
|
2017-04-14 19:15:10 +02:00
|
|
|
cp env-example .env
|
2017-05-03 12:56:01 +02:00
|
|
|
sed -i -- "s/PHP_VERSION=.*/PHP_VERSION=${PHP_VERSION}/g" .env
|
2017-04-18 09:07:27 +02:00
|
|
|
sed -i -- 's/=false/=true/g' .env
|
2018-07-29 06:00:13 +02:00
|
|
|
sed -i -- 's/PHPDBG=true/PHPDBG=false/g' .env
|
2018-07-31 16:38:02 +02:00
|
|
|
if [ "${PHP_VERSION}" == "5.6" ]; then
|
|
|
|
sed -i -- 's/^AEROSPIKE_PHP_REPOSITORY=/##AEROSPIKE_PHP_REPOSITORY=/g' .env
|
|
|
|
sed -i -- 's/^# AEROSPIKE_PHP_REPOSITORY=/AEROSPIKE_PHP_REPOSITORY=/g' .env
|
|
|
|
fi
|
2017-04-18 09:07:27 +02:00
|
|
|
cat .env
|
2017-05-06 09:13:18 +02:00
|
|
|
docker-compose build ${BUILD_SERVICE}
|
2017-04-14 19:15:10 +02:00
|
|
|
docker images
|
|
|
|
fi
|
|
|
|
|
2017-04-14 20:54:47 +02:00
|
|
|
#### Generate the Laradock Documentation site using Hugo
|
2017-04-14 19:31:09 +02:00
|
|
|
if [ -n "${HUGO_VERSION}" ]; then
|
2017-04-14 19:15:10 +02:00
|
|
|
HUGO_PACKAGE=hugo_${HUGO_VERSION}_Linux-64bit
|
|
|
|
HUGO_BIN=hugo_${HUGO_VERSION}_linux_amd64
|
|
|
|
|
|
|
|
# Download hugo binary
|
|
|
|
curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz
|
2017-07-27 17:45:18 +02:00
|
|
|
mkdir -p $HOME/bin
|
2017-04-14 19:15:10 +02:00
|
|
|
mv ./${HUGO_BIN}/${HUGO_BIN} $HOME/bin/hugo
|
|
|
|
|
|
|
|
# Remove existing docs
|
2017-05-07 18:00:19 +02:00
|
|
|
if [ -d "./docs" ]; then
|
|
|
|
rm -r ./docs
|
|
|
|
fi
|
2017-04-14 19:15:10 +02:00
|
|
|
|
|
|
|
# Build docs
|
2017-04-14 20:52:54 +02:00
|
|
|
cd DOCUMENTATION
|
2017-04-14 19:15:10 +02:00
|
|
|
hugo
|
|
|
|
fi
|