Main repository for Devuan's www.devuan.org.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

36 lines
919 B

  1. #!/bin/sh
  2. DEVUAN_DIR="/devuan-www/src"
  3. # Only clone main repo if directory does not exist
  4. if [ ! -f "${DEVUAN_DIR}/Gemfile" ]; then
  5. git clone --single-branch --branch "${DEVUAN_WWW_BRANCH}" "${DEVUAN_WWW_REPO}" "${DEVUAN_DIR}"
  6. fi
  7. cd "${DEVUAN_DIR}"
  8. if [ ! -d "${DEVUAN_DIR}/.bundle" ]; then
  9. mkdir "${DEVUAN_DIR}/.bundle"
  10. fi
  11. tee "${DEVUAN_DIR}/.bundle/config" << EOF
  12. ---
  13. BUNDLE_PATH: "${DEVUAN_DIR}/../vendor/bundle"
  14. BUNDLE_DISABLE_SHARED_GEMS: "true"
  15. EOF
  16. if [ ! -f "${DEVUAN_DIR}/config.rb" ]; then
  17. cp "${DEVUAN_DIR}/config.rb.dist" "${DEVUAN_DIR}/config.rb"
  18. fi
  19. # Create output dir if needed
  20. mkdir -p "${DEVUAN_DIR_OUT}"||true
  21. # Remove old files if needed
  22. if [ -d "${DEVUAN_DIR_OUT}/public" ]; then
  23. rm -r "${DEVUAN_DIR_OUT}/public"
  24. fi
  25. # Build and pipe log to output dir
  26. bundle exec middleman build --verbose 2>&1 | tee "${DEVUAN_DIR_OUT}/build.log"
  27. # Place result in output dir
  28. mv public "${DEVUAN_DIR_OUT}"