Permalink
Browse files

Persistent Rails assets

  • Loading branch information...
1 parent 034af96 commit 6d06a0bc9002446013033ac20701f48cf6c30b31 Fotios Lindiakos committed Jan 25, 2013
Showing with 22 additions and 0 deletions.
  1. +16 −0 .openshift/action_hooks/pre_build
  2. +2 −0 Gemfile
  3. +4 −0 Gemfile.lock
@@ -4,3 +4,19 @@
# 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
View
@@ -19,6 +19,8 @@ group :assets do
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
+
+ gem 'turbo-sprockets-rails3'
end
gem 'jquery-rails'
View
@@ -97,6 +97,9 @@ GEM
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
+ turbo-sprockets-rails3 (0.3.6)
+ railties (> 3.2.8, < 4.0.0)
+ sprockets (>= 2.0.0)
tzinfo (0.3.35)
uglifier (1.3.0)
execjs (>= 0.3.0)
@@ -114,4 +117,5 @@ DEPENDENCIES
sass-rails (~> 3.2.3)
sqlite3
thor (= 0.14.6)
+ turbo-sprockets-rails3
uglifier (>= 1.0.3)

0 comments on commit 6d06a0b

Please sign in to comment.