2017-04-15 01:15:10 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-04-30 21:52:22 +08:00
|
|
|
#### halt script on error
|
2017-05-19 19:47:57 +08:00
|
|
|
set -xe
|
2017-04-30 21:52:22 +08:00
|
|
|
|
2017-05-04 16:15:28 +08:00
|
|
|
echo '##### Print docker version'
|
|
|
|
docker --version
|
|
|
|
|
|
|
|
echo '##### Print environment'
|
|
|
|
env | sort
|
|
|
|
|
2017-04-15 02:54:47 +08:00
|
|
|
#### Build the Docker Images
|
2017-04-15 01:31:09 +08:00
|
|
|
if [ -n "${PHP_VERSION}" ]; then
|
2017-04-15 01:15:10 +08:00
|
|
|
cp env-example .env
|
2017-05-03 18:56:01 +08:00
|
|
|
sed -i -- "s/PHP_VERSION=.*/PHP_VERSION=${PHP_VERSION}/g" .env
|
2017-04-18 15:07:27 +08:00
|
|
|
sed -i -- 's/=false/=true/g' .env
|
2021-03-17 12:26:37 +08:00
|
|
|
sed -i -- 's/CHANGE_SOURCE=true/CHANGE_SOURCE=false/g' .env
|
2018-07-29 12:00:13 +08:00
|
|
|
sed -i -- 's/PHPDBG=true/PHPDBG=false/g' .env
|
2021-03-17 13:33:35 +08:00
|
|
|
sed -i -- 's/CASSANDRA=true/CASSANDRA=false/g' .env
|
|
|
|
sed -i -- 's/GEARMAN=true/GEARMAN=false/g' .env
|
|
|
|
sed -i -- 's/AEROSPIKE=true/AEROSPIKE=false/g' .env
|
|
|
|
sed -i -- 's/PHALCON=true/PHALCON=false/g' .env
|
|
|
|
sed -i -- 's/RDKAFKA=true/RDKAFKA=false/g' .env
|
|
|
|
sed -i -- 's/MAILPARSE=true/MAILPARSE=false/g' .env
|
2019-03-01 11:02:13 +08:00
|
|
|
if [ "${PHP_VERSION}" == "5.6" ]; then
|
|
|
|
# Aerospike C Client SDK 4.0.7, Debian 9.6 is not supported
|
|
|
|
# https://github.com/aerospike/aerospike-client-php5/issues/145
|
2021-03-15 00:03:57 +08:00
|
|
|
sed -i -- 's/WORKSPACE_INSTALL_AEROSPIKE=true/WORKSPACE_INSTALL_AEROSPIKE=false/g' .env
|
2019-03-01 11:02:13 +08:00
|
|
|
sed -i -- 's/PHP_FPM_INSTALL_AEROSPIKE=true/PHP_FPM_INSTALL_AEROSPIKE=false/g' .env
|
|
|
|
fi
|
2019-03-01 18:24:14 +08:00
|
|
|
if [ "${PHP_VERSION}" == "7.3" ]; then
|
|
|
|
# V8JS extension does not yet support PHP 7.3.
|
|
|
|
sed -i -- 's/WORKSPACE_INSTALL_V8JS=true/WORKSPACE_INSTALL_V8JS=false/g' .env
|
|
|
|
# This ssh2 extension does not yet support PHP 7.3.
|
|
|
|
sed -i -- 's/PHP_FPM_INSTALL_SSH2=true/PHP_FPM_INSTALL_SSH2=false/g' .env
|
|
|
|
# xdebug extension does not yet support PHP 7.3.
|
|
|
|
sed -i -- 's/PHP_FPM_INSTALL_XDEBUG=true/PHP_FPM_INSTALL_XDEBUG=false/g' .env
|
|
|
|
# memcached extension does not yet support PHP 7.3.
|
|
|
|
sed -i -- 's/PHP_FPM_INSTALL_MEMCACHED=true/PHP_FPM_INSTALL_MEMCACHED=false/g' .env
|
|
|
|
fi
|
2019-06-06 12:25:25 +08:00
|
|
|
|
|
|
|
sed -i -- 's/CHANGE_SOURCE=true/CHANGE_SOURCE=false/g' .env
|
|
|
|
|
2017-04-18 15:07:27 +08:00
|
|
|
cat .env
|
2017-05-06 15:13:18 +08:00
|
|
|
docker-compose build ${BUILD_SERVICE}
|
2017-04-15 01:15:10 +08:00
|
|
|
docker images
|
|
|
|
fi
|
|
|
|
|
2017-04-15 02:54:47 +08:00
|
|
|
#### Generate the Laradock Documentation site using Hugo
|
2017-04-15 01:31:09 +08:00
|
|
|
if [ -n "${HUGO_VERSION}" ]; then
|
2017-04-15 01:15:10 +08: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 23:45:18 +08:00
|
|
|
mkdir -p $HOME/bin
|
2017-04-15 01:15:10 +08:00
|
|
|
mv ./${HUGO_BIN}/${HUGO_BIN} $HOME/bin/hugo
|
|
|
|
|
|
|
|
# Remove existing docs
|
2017-05-08 00:00:19 +08:00
|
|
|
if [ -d "./docs" ]; then
|
|
|
|
rm -r ./docs
|
|
|
|
fi
|
2017-04-15 01:15:10 +08:00
|
|
|
|
|
|
|
# Build docs
|
2017-04-15 02:52:54 +08:00
|
|
|
cd DOCUMENTATION
|
2017-04-15 01:15:10 +08:00
|
|
|
hugo
|
|
|
|
fi
|