aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-01-04 15:13:42 +0100
committerHarald Eilertsen <haraldei@anduin.net>2015-01-04 15:13:42 +0100
commitbc03878a8cab83ca030cf8cc9e8e36552223de91 (patch)
tree11e1c1af724ff3643a45d202346e300751bd8c0a
parent13ad1c8516e30c2b90e83332eb2e92a0b66f822e (diff)
downloadcapistrano-refinerycms-bc03878a8cab83ca030cf8cc9e8e36552223de91.tar.gz
capistrano-refinerycms-bc03878a8cab83ca030cf8cc9e8e36552223de91.tar.bz2
capistrano-refinerycms-bc03878a8cab83ca030cf8cc9e8e36552223de91.zip
Add refinerycms capistrano tasks.
-rw-r--r--lib/capistrano/tasks/refinerycms.rake60
1 files changed, 60 insertions, 0 deletions
diff --git a/lib/capistrano/tasks/refinerycms.rake b/lib/capistrano/tasks/refinerycms.rake
new file mode 100644
index 0000000..29f4bd4
--- /dev/null
+++ b/lib/capistrano/tasks/refinerycms.rake
@@ -0,0 +1,60 @@
+require 'capistrano/refinerycms/helpers'
+require 'securerandom'
+require 'active_support/inflector'
+
+include Capistrano::RefineryCMS::Helpers
+
+namespace :load do
+
+ task :defaults do
+
+ # Settings for config/initializers/refinery/core.rb
+ set :refinerycms_site_name, 'RefineryCMS'
+ set :refinerycms_force_ssl, false
+ set :refinerycms_dragonfly_custom_backend_class, ''
+ set :refinerycms_dragonfly_custom_backend_opts, []
+ set :refinerycms_base_cache_key, -> { ActiveSupport::Inflector::parameterize(fetch(:refinerycms_site_name), '_') }
+ set :refinerycms_google_analytics_page_code, 'UA-xxxxxx-x'
+ set :refinerycms_authenticity_token_on_frontend, true
+ set :refinerycms_dragonfly_secret, -> { SecureRandom.hex(24) }
+ set :refinerycms_wymeditor_whitelist_tags, []
+ set :refinerycms_extra_javascript, ''
+ set :refinerycms_extra_stylesheet, ''
+ set :refinerycms_backend_route, '/refinery'
+
+ # Settings affecting the gem operation
+ set :refinerycms_template_path, -> { File.join('config', 'deploy', 'templates') }
+
+ end
+
+end
+
+
+namespace :deploy do
+ namespace :refinerycms do
+
+ desc 'Initialize refinery config for new deployments.'
+ task :configure do
+ output_file = File.join(shared_path, "config", "initializers", "refinery", "core.rb")
+ on roles(:app) do
+ unless test "[ -f #{output_file} ]"
+ core = refinerycms_template('config_initializers_refinery_core.rb.erb')
+ upload!(core, output_file)
+ end
+ end
+ end
+
+ desc 'Seed the database'
+ task :seed do
+ on roles(:db) do
+ within release_path do
+ execute :rake, 'db:seed', "RAILS_ENV=#{fetch(:rails_env)}"
+ end
+ end
+ end
+
+ end
+
+ before 'deploy:check:linked_files', 'deploy:refinerycms:configure'
+ after 'deploy:migrate', 'deploy:refinerycms:seed'
+end