travis-build.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. # Aerospike C Client SDK 4.0.7, Debian 9.6 is not supported
  16. # https://github.com/aerospike/aerospike-client-php5/issues/145
  17. sed -i -- 's/PHP_FPM_INSTALL_AEROSPIKE=true/PHP_FPM_INSTALL_AEROSPIKE=false/g' .env
  18. fi
  19. if [ "${PHP_VERSION}" == "7.3" ]; then
  20. # V8JS extension does not yet support PHP 7.3.
  21. sed -i -- 's/WORKSPACE_INSTALL_V8JS=true/WORKSPACE_INSTALL_V8JS=false/g' .env
  22. # This ssh2 extension does not yet support PHP 7.3.
  23. sed -i -- 's/PHP_FPM_INSTALL_SSH2=true/PHP_FPM_INSTALL_SSH2=false/g' .env
  24. # xdebug extension does not yet support PHP 7.3.
  25. sed -i -- 's/PHP_FPM_INSTALL_XDEBUG=true/PHP_FPM_INSTALL_XDEBUG=false/g' .env
  26. # memcached extension does not yet support PHP 7.3.
  27. sed -i -- 's/PHP_FPM_INSTALL_MEMCACHED=true/PHP_FPM_INSTALL_MEMCACHED=false/g' .env
  28. fi
  29. cat .env
  30. docker-compose build ${BUILD_SERVICE}
  31. docker images
  32. fi
  33. #### Generate the Laradock Documentation site using Hugo
  34. if [ -n "${HUGO_VERSION}" ]; then
  35. HUGO_PACKAGE=hugo_${HUGO_VERSION}_Linux-64bit
  36. HUGO_BIN=hugo_${HUGO_VERSION}_linux_amd64
  37. # Download hugo binary
  38. curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz
  39. mkdir -p $HOME/bin
  40. mv ./${HUGO_BIN}/${HUGO_BIN} $HOME/bin/hugo
  41. # Remove existing docs
  42. if [ -d "./docs" ]; then
  43. rm -r ./docs
  44. fi
  45. # Build docs
  46. cd DOCUMENTATION
  47. hugo
  48. fi