Skip to content

Commit

Permalink
Move asset logic from pre_build to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
BanzaiMan committed May 8, 2013
1 parent ee5bd40 commit cf6040b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
19 changes: 19 additions & 0 deletions .openshift/action_hooks/deploy
Expand Up @@ -6,6 +6,25 @@

set -e


STORED_ASSETS="${OPENSHIFT_DATA_DIR}/assets"
LIVE_ASSETS="${OPENSHIFT_REPO_DIR}/public/assets"

# Ensure our stored assets directory exists
if [ ! -d "${STORED_ASSETS}" ]; then
echo " Creating permanent assets directory"
mkdir "${STORED_ASSETS}"
fi

# Create symlink to stored assets unless we're uploading our own assets
if [ -d "${LIVE_ASSETS}" ]; then
echo " WARNING: Assets included in git repository, not using stored assets"
else
echo " Restoring stored assets"
ln -sf "${STORED_ASSETS}" "${LIVE_ASSETS}"
fi


if [ -z "$OPENSHIFT_MYSQL_DB_HOST" ]
then
echo 1>&2
Expand Down
17 changes: 0 additions & 17 deletions .openshift/action_hooks/pre_build
Expand Up @@ -3,20 +3,3 @@
# available. Otherwise it will execute while your application is stopped
# before the build step. This script gets executed directly, so it
# could be python, php, ruby, etc.

STORED_ASSETS="${OPENSHIFT_DATA_DIR}/assets"
LIVE_ASSETS="${OPENSHIFT_REPO_DIR}/public/assets"

# Ensure our stored assets directory exists
if [ ! -d "${STORED_ASSETS}" ]; then
echo " Creating permanent assets directory"
mkdir "${STORED_ASSETS}"
fi

# Create symlink to stored assets unless we're uploading our own assets
if [ -d "${LIVE_ASSETS}" ]; then
echo " WARNING: Assets included in git repository, not using stored assets"
else
echo " Restoring stored assets"
ln -s "${STORED_ASSETS}" "${LIVE_ASSETS}"
fi

0 comments on commit cf6040b

Please sign in to comment.