pre_build 784B

1234567891011121314151617181920212223
  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. STORED_ASSETS="${OPENSHIFT_DATA_DIR}/assets"
  7. LIVE_ASSETS="${OPENSHIFT_REPO_DIR}/public/assets"
  8. # Ensure our stored assets directory exists
  9. if [ ! -d "${STORED_ASSETS}" ]; then
  10. echo " Creating permanent assets directory"
  11. mkdir "${STORED_ASSETS}"
  12. fi
  13. # Create symlink to stored assets unless we're uploading our own assets
  14. if [ -d "${LIVE_ASSETS}" ]; then
  15. echo " WARNING: Assets included in git repository, not using stored assets"
  16. else
  17. echo " Restoring stored assets"
  18. ln -s "${STORED_ASSETS}" "${LIVE_ASSETS}"
  19. fi