kapluni
11/14/2013 - 12:58 AM

Precompile assets on codeship

Precompile assets on codeship

# .cloud66/manifest.yml
development:
  rails:
    configuration:
      use_asset_pipeline: false
qa:
  rails:
    configuration:
      use_asset_pipeline: false
staging:
  rails:
    configuration:
      use_asset_pipeline: false
production:
  rails:
    configuration:
      use_asset_pipeline: false
# Assuming that you have followed all the instructions from https://github.com/rumblelabs/asset_sync
# Put this in your deployment script

# Choose any environment here the important part is that your environment is using the same bucket for all environments 
# than you only need to precompile assets once
RAILS_ENV=staging bundle exec rake assets:precompile
# You need to set git credentials otherwise it won't be able to commit
git config --global user.email "codeship@codeship.com"
git config --global user.name "Codeship Server"
# Add your manifest file so that rails can find digested version of files
git add --force public/assets/manifest*.json
# Commit with special --skip-ci command which indicates to codeship to ignore this commit. To avoid infinite build.
git commit -m "Update assets --skip-ci"
# Because it's in detached head a bit funky syntax required to push changes back to your master
git push git@github.com:<owner/name_of_your_repo>.git HEAD:master