pre_build 810 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. # This is a simple script and will be executed on your CI system if
  3. # available. Otherwise it will execute while your application is stopped
  4. # before the build step. This script gets executed directly, so it
  5. # could be python, php, ruby, etc.
  6. echo "-> Pre-build step"
  7. STORED_ASSETS="${OPENSHIFT_DATA_DIR}/assets"
  8. LIVE_ASSETS="${OPENSHIFT_REPO_DIR}/public/assets"
  9. # Ensure our stored assets directory exists
  10. if [ ! -d "${STORED_ASSETS}" ]; then
  11. echo " Creating permanent assets directory"
  12. mkdir "${STORED_ASSETS}"
  13. fi
  14. # Create symlink to stored assets unless we're uploading our own assets
  15. if [ -d "${LIVE_ASSETS}" ]; then
  16. echo " WARNING: Assets included in git repository, not using stored assets"
  17. else
  18. echo " Restoring stored assets"
  19. ln -s "${STORED_ASSETS}" "${LIVE_ASSETS}"
  20. fi