From 5058ef3e041e9e1b8ed1c5cf74b0441cf5d3c9cd Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Fri, 20 Jun 2014 19:56:29 +0200 Subject: Remove old capistrano config. --- config/deploy.rb.example | 42 ----------- config/deploy/database.rb | 158 ---------------------------------------- config/deploy/database.yml.erb | 44 ----------- config/deploy/refinery_setup.rb | 53 -------------- config/deploy/secret_token.rb | 36 --------- 5 files changed, 333 deletions(-) delete mode 100644 config/deploy.rb.example delete mode 100644 config/deploy/database.rb delete mode 100644 config/deploy/database.yml.erb delete mode 100644 config/deploy/refinery_setup.rb delete mode 100644 config/deploy/secret_token.rb (limited to 'config') diff --git a/config/deploy.rb.example b/config/deploy.rb.example deleted file mode 100644 index 8d1303d..0000000 --- a/config/deploy.rb.example +++ /dev/null @@ -1,42 +0,0 @@ -require 'bundler/capistrano' -Dir.glob(File.join(File.dirname(__FILE__), 'deploy', '*.rb')) do |f| - require f -end - -set :application, "set your application name here" -set :repository, "set your repository location here" - -set :scm, :git -set :branch, 'master' unless exists?(:branch) - -set :deploy_to, "path on server" -set :user, "username on server" - -# On FreeBSD uncomment the following lines -#set :use_sudo, false -#default_environment['RB_USER_INSTALL'] = '/usr/bin/install -c' - -#set :rvm_ruby_string, ENV['GEM_HOME'].gsub(/.*\//,"") -set :rvm_ruby_string, '1.9.3-p286' -set :rvm_type, :system -require "rvm/capistrano" - -role :web, "your web-server here" # Your HTTP server, Apache/etc -role :app, "your app-server here" # This may be the same as your `Web` server -role :db, "your primary db-server here", :primary => true # This is where Rails migrations will run -role :db, "your slave db-server here" - -# if you want to clean up old releases on each deploy uncomment this: -# after "deploy:restart", "deploy:cleanup" - -# if you're still using the script/reaper helper you will need -# these http://github.com/rails/irs_process_scripts - -# If you are using Passenger mod_rails uncomment this: -# namespace :deploy do -# task :start do ; end -# task :stop do ; end -# task :restart, :roles => :app, :except => { :no_release => true } do -# run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" -# end -# end \ No newline at end of file diff --git a/config/deploy/database.rb b/config/deploy/database.rb deleted file mode 100644 index a42e6e6..0000000 --- a/config/deploy/database.rb +++ /dev/null @@ -1,158 +0,0 @@ -# -# = Capistrano database.yml task -# -# Provides a couple of tasks for creating the database.yml -# configuration file dynamically when deploy:setup is run. -# -# Category:: Capistrano -# Package:: Database -# Author:: Simone Carletti -# Copyright:: 2007-2010 The Authors -# License:: MIT License -# Link:: http://www.simonecarletti.com/ -# Source:: http://gist.github.com/2769 -# -# -# == Requirements -# -# This extension requires the original config/database.yml to be excluded -# from source code checkout. You can easily accomplish this by renaming -# the file (for example to database.example.yml) and appending database.yml -# value to your SCM ignore list. -# -# # Example for Subversion -# -# $ svn mv config/database.yml config/database.example.yml -# $ svn propset svn:ignore 'database.yml' config -# -# # Example for Git -# -# $ git mv config/database.yml config/database.example.yml -# $ echo 'config/database.yml' >> .gitignore -# -# -# == Usage -# -# Include this file in your deploy.rb configuration file. -# Assuming you saved this recipe as capistrano_database_yml.rb: -# -# require "capistrano_database_yml" -# -# Now, when deploy:setup is called, this script will automatically -# create the database.yml file in the shared folder. -# Each time you run a deploy, this script will also create a symlink -# from your application config/database.yml pointing to the shared configuration file. -# -# == Custom template -# -# By default, this script creates an exact copy of the default -# database.yml file shipped with a new Rails 2.x application. -# If you want to overwrite the default template, simply create a custom Erb template -# called database.yml.erb and save it into config/deploy folder. -# -# Although the name of the file can't be changed, you can customize the directory -# where it is stored defining a variable called :template_dir. -# -# # store your custom template at foo/bar/database.yml.erb -# set :template_dir, "foo/bar" -# -# # example of database template -# -# base: &base -# adapter: sqlite3 -# timeout: 5000 -# development: -# database: #{shared_path}/db/development.sqlite3 -# <<: *base -# test: -# database: #{shared_path}/db/test.sqlite3 -# <<: *base -# production: -# adapter: mysql -# database: #{application}_production -# username: #{user} -# password: #{Capistrano::CLI.ui.ask("Enter MySQL database password: ")} -# encoding: utf8 -# timeout: 5000 -# -# Because this is an Erb template, you can place variables and Ruby scripts -# within the file. -# For instance, the template above takes advantage of Capistrano CLI -# to ask for a MySQL database password instead of hard coding it into the template. -# -# === Password prompt -# -# For security reasons, in the example below the password is not -# hard coded (or stored in a variable) but asked on setup. -# I don't like to store passwords in files under version control -# because they will live forever in your history. -# This is why I use the Capistrano::CLI utility. -# - -unless Capistrano::Configuration.respond_to?(:instance) - abort "This extension requires Capistrano 2" -end - -Capistrano::Configuration.instance.load do - - namespace :deploy do - - namespace :db do - - desc <<-DESC - Creates the database.yml configuration file in shared path. - - By default, this task uses a template unless a template \ - called database.yml.erb is found either is :template_dir \ - or /config/deploy folders. The default template matches \ - the template for config/database.yml file shipped with Rails. - - When this recipe is loaded, db:setup is automatically configured \ - to be invoked after deploy:setup. You can skip this task setting \ - the variable :skip_db_setup to true. This is especially useful \ - if you are using this recipe in combination with \ - capistrano-ext/multistaging to avoid multiple db:setup calls \ - when running deploy:setup for all stages one by one. - DESC - task :setup, :except => { :no_release => true } do - - default_template = <<-EOF - base: &base - adapter: sqlite3 - timeout: 5000 - development: - database: #{shared_path}/db/development.sqlite3 - <<: *base - test: - database: #{shared_path}/db/test.sqlite3 - <<: *base - production: - database: #{shared_path}/db/production.sqlite3 - <<: *base - EOF - - location = fetch(:template_dir, "config/deploy") + '/database.yml.erb' - template = File.file?(location) ? File.read(location) : default_template - - config = ERB.new(template) - - run "mkdir -p #{shared_path}/db" - run "mkdir -p #{shared_path}/config" - put config.result(binding), "#{shared_path}/config/database.yml" - end - - desc <<-DESC - [internal] Updates the symlink for database.yml file to the just deployed release. - DESC - task :symlink, :except => { :no_release => true } do - run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml" - end - - end - - after "deploy:setup", "deploy:db:setup" unless fetch(:skip_db_setup, false) - after "deploy:finalize_update", "deploy:db:symlink" - - end - -end diff --git a/config/deploy/database.yml.erb b/config/deploy/database.yml.erb deleted file mode 100644 index 372b0d4..0000000 --- a/config/deploy/database.yml.erb +++ /dev/null @@ -1,44 +0,0 @@ -development: - adapter: postgresql - encoding: unicode - database: - pool: 5 - username: - password: - min_messages: warning - - # Connect on a TCP socket. Omitted by default since the client uses a - # domain socket that doesn't need configuration. Windows does not have - # domain sockets, so uncomment these lines. - #host: localhost - #port: 5432 - - # Schema search path. The server defaults to $user,public - #schema_search_path: myapp,sharedapp,public - - # Minimum log levels, in increasing order: - # debug5, debug4, debug3, debug2, debug1, - # log, notice, warning, error, fatal, and panic - # The server defaults to notice. - #min_messages: warning - -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: - adapter: postgresql - encoding: unicode - database: - pool: 5 - username: - password: - min_messages: warning - -production: - adapter: postgresql - encoding: unicode - database: hmno_main - pool: 5 - username: <%= Capistrano::CLI.ui.ask("Enter Database username: ") %> - password: <%= Capistrano::CLI.ui.ask("Enter Database password: ") %> - min_messages: warning diff --git a/config/deploy/refinery_setup.rb b/config/deploy/refinery_setup.rb deleted file mode 100644 index 69c75b4..0000000 --- a/config/deploy/refinery_setup.rb +++ /dev/null @@ -1,53 +0,0 @@ -require 'securerandom' -require 'active_support/inflector' - -unless Capistrano::Configuration.respond_to?(:instance) - abort "This extension requires Capistrano 2" -end - -Capistrano::Configuration.instance.load do - - namespace :deploy do - namespace :refinery do - - desc <<-DESC - Creates the refinery core config for the application. - DESC - task :setup, :except => { :no_release => true } do - - # Change this to your app name - site_name = "Heavymetal.no"; - - default_template = <<-EOF - # encoding: utf-8 - Refinery::Core.configure do |config| - config.rescue_not_found = Rails.env.production? - config.s3_backend = !(ENV['S3_KEY'].nil? || ENV['S3_SECRET'].nil?) - config.site_name = "#{site_name}" - config.base_cache_key = "#{ActiveSupport::Inflector::parameterize(site_name, '_')}" - config.authenticity_token_on_frontend = true - config.dragonfly_secret = "#{SecureRandom.hex(24)}" - config.ie6_upgrade_message_enabled = true - config.show_internet_explorer_upgrade_message = false - config.menu_hide_children = true - end - EOF - - run "mkdir -p #{shared_path}/config/refinery" - put default_template, "#{shared_path}/config/refinery/core.rb" - end - - desc <<-DESC - [internal] Updates the symlink for secret_token.rb file to the just deployed release. - DESC - task :symlink, :except => { :no_release => true } do - run "ln -nfs #{shared_path}/config/refinery/core.rb #{release_path}/config/initializers/refinery/core.rb" - end - - end - - after "deploy:setup", "deploy:refinery:setup" unless fetch(:skip_refinery_setup, false) - after "deploy:finalize_update", "deploy:refinery:symlink" - end - -end diff --git a/config/deploy/secret_token.rb b/config/deploy/secret_token.rb deleted file mode 100644 index dc2e19a..0000000 --- a/config/deploy/secret_token.rb +++ /dev/null @@ -1,36 +0,0 @@ -unless Capistrano::Configuration.respond_to?(:instance) - abort "This extension requires Capistrano 2" -end - -Capistrano::Configuration.instance.load do - - namespace :deploy do - namespace :token do - - desc <<-DESC - Creates the secret token for the application. - DESC - task :setup, :except => { :no_release => true } do - - default_template = <<-EOF - BetaWebApp::Application.config.secret_token = '#{`bundle exec rake secret`}' - EOF - - run "mkdir -p #{shared_path}/config" - put default_template, "#{shared_path}/config/secret_token.rb" - end - - desc <<-DESC - [internal] Updates the symlink for secret_token.rb file to the just deployed release. - DESC - task :symlink, :except => { :no_release => true } do - run "ln -nfs #{shared_path}/config/secret_token.rb #{release_path}/config/secret_token.rb" - end - - end - - after "deploy:setup", "deploy:token:setup" unless fetch(:skip_token_setup, false) - after "deploy:finalize_update", "deploy:token:symlink" - end - -end -- cgit v1.2.3