travis-build.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env bash
  2. #### halt script on error
  3. set -xe
  4. echo '##### Print docker version'
  5. docker --version
  6. echo '##### Print environment'
  7. env | sort
  8. #### Build the Docker Images
  9. if [ -n "${PHP_VERSION}" ]; then
  10. cp env-example .env
  11. sed -i -- "s/PHP_VERSION=.*/PHP_VERSION=${PHP_VERSION}/g" .env
  12. sed -i -- 's/=false/=true/g' .env
  13. sed -i -- 's/PHPDBG=true/PHPDBG=false/g' .env
  14. if [ "${PHP_VERSION}" == "5.6" ]; then
  15. sed -i -- 's/^AEROSPIKE_PHP_REPOSITORY=/##AEROSPIKE_PHP_REPOSITORY=/g' .env
  16. sed -i -- 's/^# AEROSPIKE_PHP_REPOSITORY=/AEROSPIKE_PHP_REPOSITORY=/g' .env
  17. fi
  18. cat .env
  19. docker-compose build ${BUILD_SERVICE}
  20. docker images
  21. fi
  22. #### Generate the Laradock Documentation site using Hugo
  23. if [ -n "${HUGO_VERSION}" ]; then
  24. HUGO_PACKAGE=hugo_${HUGO_VERSION}_Linux-64bit
  25. HUGO_BIN=hugo_${HUGO_VERSION}_linux_amd64
  26. # Download hugo binary
  27. curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz
  28. mkdir -p $HOME/bin
  29. mv ./${HUGO_BIN}/${HUGO_BIN} $HOME/bin/hugo
  30. # Remove existing docs
  31. if [ -d "./docs" ]; then
  32. rm -r ./docs
  33. fi
  34. # Build docs
  35. cd DOCUMENTATION
  36. hugo
  37. fi