travis-build.sh 943 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. cat .env
  14. docker-compose build ${BUILD_SERVICE}
  15. docker images
  16. fi
  17. #### Generate the Laradock Documentation site using Hugo
  18. if [ -n "${HUGO_VERSION}" ]; then
  19. HUGO_PACKAGE=hugo_${HUGO_VERSION}_Linux-64bit
  20. HUGO_BIN=hugo_${HUGO_VERSION}_linux_amd64
  21. # Download hugo binary
  22. curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz
  23. mkdir $HOME/bin
  24. mv ./${HUGO_BIN}/${HUGO_BIN} $HOME/bin/hugo
  25. # Remove existing docs
  26. if [ -d "./docs" ]; then
  27. rm -r ./docs
  28. fi
  29. # Build docs
  30. cd DOCUMENTATION
  31. hugo
  32. fi