nsweb_deployment 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,34 @@
1
+ .autotest
2
+ .rspec
3
+ autotest/*
4
+ config/environment.rb
5
+ railties/**/.autotest
6
+ railties/**/.rspec
7
+ railties/**/autotest/*
8
+ .bundle
9
+ config/database.yml
10
+ config/*.sphinx.conf
11
+ db/schema.rb
12
+ *~
13
+ *.cache
14
+ *.log
15
+ *.pid
16
+ tmp/**/*
17
+ tmp/*
18
+ railties/**/tmp/*
19
+ railties/**/db/schema.rb
20
+ railties/**/db/*.sqlite3
21
+ railties/**/coverage/*
22
+ .DS_Store
23
+ db/*.sqlite3
24
+ coverage/*
25
+ doc/*
26
+ *.sw?
27
+ *.gem
28
+ .yardoc
29
+ Gemfile.lock
30
+ spec/**/app/views/nsweb
31
+ spec/**/public/images/nsweb
32
+ spec/**/public/javascripts/nsweb
33
+ spec/**/public/stylesheets/nsweb
34
+ tags
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use 1.9.2@nsweb
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in nsweb_deployment.gemspec
4
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ desc 'Push the nsweb_deployment gem'
5
+ task :push do
6
+ inst = Bundler::GemHelper.new(Dir.pwd, 'nsweb_deployment')
7
+ version = inst.gemspec.version.to_s
8
+ system "gem inabox --host http://gems.nssecuretesting.org pkg/nsweb_deployment-#{version}.gem"
9
+ end
@@ -0,0 +1,85 @@
1
+ require 'capistrano'
2
+ require 'capistrano/cli'
3
+
4
+ require 'delayed/recipes'
5
+
6
+ configuration = Capistrano::Configuration.respond_to?(:instance) ?
7
+ Capistrano::Configuration.instance(:must_exist) :
8
+ Capistrano.configuration(:must_exist)
9
+
10
+
11
+ configuration.load do
12
+ set(:scm, :git)
13
+ _cset(:use_sudo, false)
14
+ _cset(:user, 'deployer')
15
+ _cset(:git_user, 'gitosis')
16
+ _cset(:git_host, 'inet-custqa.eastwood.net')
17
+ set(:deploy_via, :remote_cache)
18
+ set(:normalize_asset_timestamps, false)
19
+ _cset(:customer_qa_host, 'inet-custqa.eastwood.net')
20
+ _cset(:production_host, 'inet-prod01.eastwood.net')
21
+
22
+ task :customer_qa do
23
+ server fetch(:customer_qa_host), :app, :web, :db, :primary => true
24
+ set :rails_env, 'customer_qa'
25
+ set :deploy_to, "/var/www/#{fetch(:application)}"
26
+ set :unicorn_config, "#{current_path}/config/unicorn.rb"
27
+ set :unicorn_pid, "#{shared_path}/pids/unicorn.pid"
28
+ end
29
+
30
+ task :production do
31
+ server fetch(:production_host), :app, :web, :db, :primary => true
32
+ set :deploy_to, "/var/www/#{fetch(:application)}"
33
+ set :unicorn_config, "#{current_path}/config/unicorn.rb"
34
+ set :unicorn_pid, "#{shared_path}/pids/unicorn.pid"
35
+ end
36
+
37
+ namespace :deploy do
38
+ task :start, :roles => :app, :except => { :no_release => true } do
39
+ run "cd #{current_path} && bundle exec unicorn -c #{unicorn_config} -E #{rails_env} -D"
40
+ end
41
+
42
+ task :stop, :roles => :app, :except => { :no_release => true } do
43
+ run "kill `cat #{unicorn_pid}`"
44
+ end
45
+
46
+ task :graceful_stop, :roles => :app, :except => { :no_release => true } do
47
+ run "kill -s QUIT `cat #{unicorn_pid}`"
48
+ end
49
+
50
+ task :reload, :roles => :app, :except => { :no_release => true } do
51
+ run "kill -s USR2 `cat #{unicorn_pid}`"
52
+ end
53
+
54
+ task :restart, :roles => :app, :except => { :no_release => true } do
55
+ stop
56
+ start
57
+ end
58
+
59
+ desc 'Update the vhost file on the web server'
60
+ task :update_vhost, :roles => :web do
61
+ run "cp #{File.join(current_path, 'config', 'vhosts', "#{rails_env}.vhost")} #{File.join(shared_path, 'system', "#{fetch(:application)}.vhost")}"
62
+ end
63
+ end
64
+
65
+ namespace :nsweb do
66
+ task :init_environment do
67
+ unless exists?(:demo_env) && fetch(:demo_env)
68
+ set :repository, "#{fetch(:git_user)}@#{fetch(:git_host)}:customers/#{fetch(:application)}.git"
69
+ end
70
+ end
71
+
72
+ task :update, :roles => :app do
73
+ run "cd #{release_path} && bundle exec rails g nsweb:update"
74
+ end
75
+ end
76
+
77
+ before 'customer_qa', 'nsweb:init_environment'
78
+ before 'production', 'nsweb:init_environment'
79
+ #before 'deploy:restart', 'delayed_job:stop'
80
+ #after 'deploy:restart', 'delayed_job:start'
81
+ #after 'deploy:stop', 'delayed_job:stop'
82
+ #after 'deploy:start', 'delayed_job:start'
83
+ #after 'deploy:symlink', 'nsweb:update'
84
+ after 'deploy:symlink', 'deploy:cleanup'
85
+ end
@@ -0,0 +1,3 @@
1
+ module NswebDeployment
2
+ VERSION = "2.0.0"
3
+ end
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "nsweb_deployment/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "nsweb_deployment"
7
+ s.version = NswebDeployment::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Josh Williams"]
10
+ s.email = ["jwilliams@shareone.com"]
11
+ s.summary = %q{Deployment tools for Nsweb}
12
+ s.description = %q{Mainly Capistrano recipes extracted to a gem}
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
+ s.require_paths = ["lib"]
18
+
19
+ s.add_runtime_dependency 'capistrano', '~> 2.9.0'
20
+ s.add_dependency 'delayed_job', '~> 3.0.0'
21
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nsweb_deployment
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 2.0.0
6
+ platform: ruby
7
+ authors:
8
+ - Josh Williams
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2012-03-06 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: capistrano
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: 2.9.0
24
+ type: :runtime
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: delayed_job
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: 3.0.0
35
+ type: :runtime
36
+ version_requirements: *id002
37
+ description: Mainly Capistrano recipes extracted to a gem
38
+ email:
39
+ - jwilliams@shareone.com
40
+ executables: []
41
+
42
+ extensions: []
43
+
44
+ extra_rdoc_files: []
45
+
46
+ files:
47
+ - .gitignore
48
+ - .rvmrc
49
+ - Gemfile
50
+ - Rakefile
51
+ - lib/nsweb_deployment.rb
52
+ - lib/nsweb_deployment/version.rb
53
+ - nsweb_deployment.gemspec
54
+ homepage:
55
+ licenses: []
56
+
57
+ post_install_message:
58
+ rdoc_options: []
59
+
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
+ requirements: []
75
+
76
+ rubyforge_project:
77
+ rubygems_version: 1.8.17
78
+ signing_key:
79
+ specification_version: 3
80
+ summary: Deployment tools for Nsweb
81
+ test_files: []
82
+