laradock/travis-build.sh

41 lines
946 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2017-04-30 21:52:22 +08:00
#### halt script on error
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
#### Build the Docker Images
if [ -n "${PHP_VERSION}" ]; then
cp env-example .env
sed -i -- "s/PHP_VERSION=.*/PHP_VERSION=${PHP_VERSION}/g" .env
2018-02-17 16:50:16 +08:00
sed -i -- 's/=false/=true/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}
docker images
fi
#### Generate the Laradock Documentation site using Hugo
if [ -n "${HUGO_VERSION}" ]; then
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
mkdir -p $HOME/bin
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
# Build docs
2017-04-15 02:52:54 +08:00
cd DOCUMENTATION
hugo
fi