summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2013-10-24 22:13:04 -0600
committermo khan <mo@mokhan.ca>2013-10-24 22:13:04 -0600
commit0648fa48042f78ac1c6621f613107e86ca29b294 (patch)
tree01a2944254b2a2651a5999f0bfe81c41a82624ab
parent7080febdc42ac8a8046314ed15781e9a5caa18bc (diff)
remove dead code.
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock5
-rw-r--r--README.md1
-rw-r--r--Rakefile1
-rw-r--r--config/database.production.yml.example25
-rw-r--r--config/nginx.conf80
-rw-r--r--config/recipes/environments.rb1
-rw-r--r--config/recipes/templates/monit/delayed_job.erb1
-rw-r--r--config/setup_load_paths.rb14
-rw-r--r--lib/tasks/ci.rake7
-rw-r--r--lib/tasks/database.rake2
-rw-r--r--lib/tasks/deployment.rake13
-rwxr-xr-xscript/test35
13 files changed, 6 insertions, 180 deletions
diff --git a/Gemfile b/Gemfile
index c5daa510..da25a4d6 100644
--- a/Gemfile
+++ b/Gemfile
@@ -33,7 +33,6 @@ group :development do
gem 'capistrano'
gem 'capistrano-ext'
gem 'rvm-capistrano'
- gem 'capistrano-gitflow'
gem 'bullet'
gem 'better_errors'
gem 'lol_dba'
diff --git a/Gemfile.lock b/Gemfile.lock
index b60ffe63..c7e03e28 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -53,9 +53,6 @@ GEM
net-ssh-gateway (>= 1.1.0)
capistrano-ext (1.2.1)
capistrano (>= 1.0.0)
- capistrano-gitflow (1.4.3)
- capistrano
- stringex
capybara (2.1.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
@@ -245,7 +242,6 @@ GEM
activesupport (>= 3.0)
sprockets (~> 2.8)
sqlite3 (1.3.7)
- stringex (2.0.6)
teaspoon (0.7.4)
phantomjs (>= 1.8.1.1)
railties (>= 3.2.5, < 5)
@@ -283,7 +279,6 @@ DEPENDENCIES
bullet
capistrano
capistrano-ext
- capistrano-gitflow
capybara
carrierwave
carrierwave_backgrounder
diff --git a/README.md b/README.md
index 25172ef9..a5f3f3be 100644
--- a/README.md
+++ b/README.md
@@ -43,4 +43,3 @@ Start server
$ cap deploy:update
{% endhighlight %}
-
diff --git a/Rakefile b/Rakefile
index 6a33650c..ab57b972 100644
--- a/Rakefile
+++ b/Rakefile
@@ -2,7 +2,6 @@
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
-#require 'rake'
require 'dotenv/tasks'
Cake::Application.load_tasks
diff --git a/config/database.production.yml.example b/config/database.production.yml.example
deleted file mode 100644
index aa99bcc8..00000000
--- a/config/database.production.yml.example
+++ /dev/null
@@ -1,25 +0,0 @@
-staging:
- #adapter: postgresql
- #encoding: unicode
- #host: localhost
- #database: cakeside_production
- #pool: 5
- #username: cakeside
- #password: password
- adapter: postgresql
- encoding: unicode
- pool: 5
- database: d1t8g3ceb67l55
- username: padomwgzfzlkyp
- password: HhEs5xtpF34dwRMTDSA2CWRGnu
- host: ec2-23-21-130-189.compute-1.amazonaws.com
- port: 5432
-
-production:
- adapter: postgresql
- encoding: unicode
- host: localhost
- database: cakeside_production
- pool: 5
- username: cakeside
- password: password
diff --git a/config/nginx.conf b/config/nginx.conf
deleted file mode 100644
index adee1f0d..00000000
--- a/config/nginx.conf
+++ /dev/null
@@ -1,80 +0,0 @@
-worker_processes 4;
-
-events {
- worker_connections 1024;
-}
-
-http {
- passenger_root /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.5;
- passenger_ruby /usr/local/rvm/wrappers/ruby-2.0.0-p247/ruby;
-
- include mime.types;
- default_type application/octet-stream;
-
- client_body_buffer_size 8K;
- client_header_buffer_size 1k;
- client_max_body_size 10M;
-
- sendfile on;
-
- client_body_timeout 10;
- client_header_timeout 10;
- keepalive_timeout 15;
- send_timeout 10;
-
- gzip on;
- gzip_comp_level 2;
- gzip_min_length 1000;
- gzip_proxied expired no-cache no-store private auth;
- gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
- gzip_disable "MSIE [1-6]\.";
-
- server {
- listen 80;
- server_name localhost;
-
- location / {
- root html;
- index index.html index.htm;
- }
-
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
- server {
- listen 80;
- server_name staging.cakeside.com;
- root /home/cakeside/apps/www.cakeside.com/current/public;
- passenger_enabled on;
- rails_env staging;
- error_log /var/log/nginx/cakeside.error.log;
- access_log off;
-
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
-
- server {
- listen 443;
- ssl on;
- ssl_certificate /home/cakeside/apps/www.cakeside.com/current/config/staging.crt;
- ssl_certificate_key /home/cakeside/apps/www.cakeside.com/current/config/staging.key;
- server_name staging.cakeside.com;
- root /home/cakeside/apps/www.cakeside.com/current/public;
- passenger_enabled on;
- rails_env staging;
- error_log /var/log/nginx/cakeside.error.log;
- access_log off;
-
- proxy_set_header X_FORWARDED_PROTO https;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $http_host;
- proxy_set_header X-Url-Scheme $scheme;
- proxy_redirect off;
- proxy_max_temp_file_size 0;
- }
-}
diff --git a/config/recipes/environments.rb b/config/recipes/environments.rb
index 52dc2939..b9e5e773 100644
--- a/config/recipes/environments.rb
+++ b/config/recipes/environments.rb
@@ -1,4 +1,3 @@
set :stages, %w(production staging)
set :default_stage, "staging"
require 'capistrano/ext/multistage'
-#require 'capistrano/gitflow'
diff --git a/config/recipes/templates/monit/delayed_job.erb b/config/recipes/templates/monit/delayed_job.erb
index e49ff9c7..76e14ad3 100644
--- a/config/recipes/templates/monit/delayed_job.erb
+++ b/config/recipes/templates/monit/delayed_job.erb
@@ -1,4 +1,3 @@
check process delayed_job with pidfile <%= delayed_job_pid %>
start program = "/etc/init.d/delayed_job_<%= application %> start"
stop program = "/etc/init.d/delayed_job_<%= application %> stop"
- if uptime > 3 minutes then restart
diff --git a/config/setup_load_paths.rb b/config/setup_load_paths.rb
deleted file mode 100644
index ef471539..00000000
--- a/config/setup_load_paths.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-#if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
- #begin
- #gems_path = ENV['MY_RUBY_HOME'].split(/@/)[0].sub(/rubies/,'gems')
- #ENV['GEM_PATH'] = "#{gems_path}:#{gems_path}@global"
- #require 'rvm'
- #RVM.use_from_path! File.dirname(File.dirname(__FILE__))
- #rescue LoadError
- #raise "RVM gem is currently unavailable."
- #end
-#end
-
-## If you're not using Bundler at all, remove lines bellow
-#ENV['BUNDLE_GEMFILE'] = File.expand_path('../Gemfile', File.dirname(__FILE__))
-#require 'bundler/setup'
diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake
index a65f7ed1..b6f6dc90 100644
--- a/lib/tasks/ci.rake
+++ b/lib/tasks/ci.rake
@@ -2,12 +2,7 @@ task :ci => ['db:migrate', 'db:test:prepare', 'spec', 'teaspoon']
namespace :ci do
namespace :deploy do
- task :staging do
- now = Time.now
- sh "git tag -a 'staging-#{now.strftime('%Y-%m-%d')}-#{now.to_i}-jenkins-continuous-deployment' -m 'just push it'"
- sh "git push --tags"
- Rake::Task['deploy:staging'].invoke
- end
+ task :staging => ['deploy:staging']
task :production => ['deploy:production']
end
end
diff --git a/lib/tasks/database.rake b/lib/tasks/database.rake
index 16038fb3..61c3914c 100644
--- a/lib/tasks/database.rake
+++ b/lib/tasks/database.rake
@@ -7,10 +7,12 @@ namespace :db do
sh "psql #{destination_db} < #{dumpfile}"
#sh "pg_restore --verbose --clean --no-acl --no-owner -h localhost -U #{config[Rails.env]["username"]} -d #{destination_db} #{dumpfile}"
end
+
task :backup do
sh "cap production postgresql:backup"
sh "rm -f latest && ln -s db/backups/`ls -rt db/backups/ | tail -n1` latest"
end
+
task :restore_to_staging => :backup do
sh "cap staging postgresql:restore"
end
diff --git a/lib/tasks/deployment.rake b/lib/tasks/deployment.rake
index 266d9147..7e91c748 100644
--- a/lib/tasks/deployment.rake
+++ b/lib/tasks/deployment.rake
@@ -1,21 +1,14 @@
namespace :deploy do
-
desc "deploy to staging server"
task :staging do
sh "cap staging deploy:migrations"
- sh "cap staging deploy:cleanup"
sh "curl http://staging.cakeside.com/ > /dev/null"
end
desc "deploy to production server"
- task :production, :tag do |t, args|
- tag_to_deploy = args.tag
- if tag_to_deploy.blank?
- sh "cap production deploy:migrations"
- else
- sh "cap production deploy:migrations -s tag=#{tag_to_deploy}"
- end
- sh "curl http://cakeside.com/ > /dev/null"
+ task :production do
+ sh "cap production deploy:migrations"
+ sh "curl http://www.cakeside.com/ > /dev/null"
end
end
diff --git a/script/test b/script/test
deleted file mode 100755
index 7f7a13e8..00000000
--- a/script/test
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-#
-# From Destroy All Software screencast #10, at:
-# http://destroyallsoftware.com/screencasts/catalog/fast-tests-with-and-without-rails
-#
-# Put this in the script/ directory of your Rails app, then run it with a spec
-# filename. If the spec uses spec_helper, it'll be run inside Bundler.
-# Otherwise, it'll be run directly with whatever `rspec` executable is on the
-# path.
-
-set -e
-
-need_rails=1
-
-if [ $# -gt 0 ]; then # we have args
- filename=$1
- # Remove trailing line numbers from filename, e.g. spec/my_spec.rb:33
- grep_filename=`echo $1 | sed 's/:.*$//g'`
-
- (set +e; grep -r '\bspec_helper\b' $grep_filename) > /dev/null
- if [ $? -eq 1 ]; then # no match; we have a stand-alone spec
- need_rails=''
- fi
-else # we have no args
- filename='spec'
-fi
-
-command='rspec'
-
-if [ $need_rails ]; then
- command="ruby -S bundle exec $command"
-fi
-
-RAILS_ENV=test $command $filename
-