capistrano-webserver 0.1.4 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ pkg
2
+ doc
3
+ Manifest
4
+ nbproject/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-webserver.gemspec
4
+ gemspec
@@ -0,0 +1,29 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ capistrano-webserver (0.2.1)
5
+ capistrano (~> 2.13.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ capistrano (2.13.5)
11
+ highline
12
+ net-scp (>= 1.0.0)
13
+ net-sftp (>= 2.0.0)
14
+ net-ssh (>= 2.0.14)
15
+ net-ssh-gateway (>= 1.1.0)
16
+ highline (1.6.16)
17
+ net-scp (1.1.0)
18
+ net-ssh (>= 2.6.5)
19
+ net-sftp (2.0.5)
20
+ net-ssh (>= 2.0.9)
21
+ net-ssh (2.6.5)
22
+ net-ssh-gateway (1.1.0)
23
+ net-ssh (>= 1.99.1)
24
+
25
+ PLATFORMS
26
+ ruby
27
+
28
+ DEPENDENCIES
29
+ capistrano-webserver!
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Shawn Catanzarite
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,29 @@
1
+ # Capistrano::Webserver
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'capistrano-webserver'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install capistrano-webserver
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile CHANGED
@@ -1,15 +1,51 @@
1
- require 'rubygems'
2
- require 'rake'
3
- require 'echoe'
4
-
5
- Echoe.new('capistrano-webserver', '0.1.4') do |p|
6
- p.description = "Common way to manage webserver (apache) configuration using capistrano"
7
- p.summary = "Common way to manage webserver configuration using capistrano. Only apache is currently supported."
8
- p.url = "http://github.com/dashonet/capistrano-webserver"
9
- p.author = "Shawn Catanzarite"
10
- p.email = "shawn@dasho.net"
11
- p.ignore_pattern = ["tmp/*", "script/*","nbproject/**","nbproject/private/*"]
12
- p.development_dependencies = ["capistrano"]
13
- end
14
-
15
- Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
1
+ require "bundler/gem_tasks"
2
+
3
+ def changelog(last=nil, single=false)
4
+ command="git --no-pager log --format='%an::::%h::::%s'"
5
+
6
+ list = `git tag`
7
+
8
+ puts "# Changelog"
9
+ puts
10
+
11
+ ordered = list.lines.sort_by {|e| (a,b,c) = e.gsub(/^v/,"").split("."); "%3d%3d%3d" % [a, b, c]}
12
+
13
+ ordered.reject{|e| (a,b,c,d) = e.split("."); !d.nil?}.reverse_each do |t|
14
+ tag = t.chomp
15
+
16
+ if last
17
+ check = { }
18
+ out = []
19
+ log = `#{command} #{last}...#{tag}`
20
+ log.lines.each do |line|
21
+ (who, hash, msg) = line.split('::::')
22
+ unless check[msg]
23
+ unless msg =~ /^Merge branch/ || msg =~ /CHANGELOG/ || msg =~ /^(v|version|changes for|preparing|ready for release|ready to release|bump version)*\s*(v|version)*\d+\.\d+\.\d+/
24
+ msg.gsub(" *", "\n*").gsub(/^\*\*/, " *").lines.each do |l|
25
+ line = l =~ /^(\s+)*\*/ ? l : "* #{l}"
26
+ out << line
27
+ end
28
+ check[msg] = hash
29
+ end
30
+ end
31
+ end
32
+ puts "## #{last}:"
33
+ out.each { |e| puts e }
34
+ #puts log
35
+ puts
36
+ end
37
+
38
+ last = tag
39
+ exit if single
40
+ end
41
+ end
42
+
43
+ desc "generate changelog output"
44
+ task :changelog do
45
+ changelog
46
+ end
47
+
48
+ desc "show current changes (changelog output from HEAD to most recent tag)"
49
+ task :current do
50
+ changelog("HEAD",true)
51
+ end
@@ -1,32 +1,21 @@
1
1
  # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano/webserver/version'
2
5
 
3
- Gem::Specification.new do |s|
4
- s.name = %q{capistrano-webserver}
5
- s.version = "0.1.4"
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "capistrano-webserver"
8
+ gem.version = Capistrano::Webserver::VERSION
9
+ gem.authors = ["Shawn Catanzarite"]
10
+ gem.email = ["me@shawncatz.com"]
11
+ gem.description = %q{Common way to manage webserver (apache) configuration using capistrano}
12
+ gem.summary = %q{Common way to manage webserver (apache) configuration using capistrano}
13
+ gem.homepage = "http://github.com/shawncatz/capistrano-webserver"
6
14
 
7
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Shawn Catanzarite"]
9
- s.date = %q{2011-05-17}
10
- s.description = %q{Common way to manage webserver (apache) configuration using capistrano}
11
- s.email = %q{shawn@dasho.net}
12
- s.extra_rdoc_files = ["README.rdoc", "lib/webserver/apache.rb"]
13
- s.files = ["README.rdoc", "Rakefile", "capistrano-webserver.gemspec", "lib/webserver/apache.rb", "Manifest"]
14
- s.homepage = %q{http://github.com/dashonet/capistrano-webserver}
15
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Capistrano-webserver", "--main", "README.rdoc"]
16
- s.require_paths = ["lib"]
17
- s.rubyforge_project = %q{capistrano-webserver}
18
- s.rubygems_version = %q{1.6.2}
19
- s.summary = %q{Common way to manage webserver configuration using capistrano. Only apache is currently supported.}
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
20
19
 
21
- if s.respond_to? :specification_version then
22
- s.specification_version = 3
23
-
24
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
- s.add_development_dependency(%q<capistrano>, [">= 0"])
26
- else
27
- s.add_dependency(%q<capistrano>, [">= 0"])
28
- end
29
- else
30
- s.add_dependency(%q<capistrano>, [">= 0"])
31
- end
20
+ gem.add_dependency "capistrano", "~> 2.13.0"
32
21
  end
@@ -0,0 +1,2 @@
1
+ require "capistrano/webserver"
2
+
@@ -0,0 +1 @@
1
+ require "capistrano/webserver/version"
@@ -1,8 +1,8 @@
1
1
  Capistrano::Configuration.instance(true).load do
2
-
3
2
  ## common variables
4
3
  set :webserver_link, true
5
4
  set :webserver_config, "config/webserver/webserver.conf"
5
+ set :webserver_application, application
6
6
  set :webserver_restart, true
7
7
 
8
8
  ## apache specific variables
@@ -34,16 +34,16 @@ Capistrano::Configuration.instance(true).load do
34
34
  DESC
35
35
  task :configuration, :roles => :web do
36
36
  # upload the file
37
- upload "#{webserver_config}", "#{shared_path}/webserver/#{application}"
38
-
37
+ upload "#{webserver_config}", "#{shared_path}/webserver/#{webserver_application}"
38
+
39
39
  # remove the old file / link
40
- run "sudo rm -f #{webserver_dir}/#{application}"
41
-
40
+ run "sudo rm -f #{webserver_dir}/#{webserver_application}"
41
+
42
42
  # link or copy file from shared to webserver directory
43
43
  if webserver_link == true
44
- run "sudo ln -sf #{shared_path}/webserver/#{application} #{webserver_dir}/#{application}"
44
+ run "sudo ln -sf #{shared_path}/webserver/#{webserver_application} #{webserver_dir}/#{webserver_application}"
45
45
  else
46
- run "sudo cp #{shared_path}/webserver/#{application} #{webserver_dir}/#{application}"
46
+ run "sudo cp #{shared_path}/webserver/#{webserver_application} #{webserver_dir}/#{webserver_application}"
47
47
  end
48
48
 
49
49
  # restart the webserver
@@ -68,4 +68,4 @@ Capistrano::Configuration.instance(true).load do
68
68
  end
69
69
 
70
70
  end
71
- end
71
+ end
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module Webserver
3
+ VERSION = "0.2.1"
4
+ end
5
+ end
metadata CHANGED
@@ -1,91 +1,72 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: capistrano-webserver
3
- version: !ruby/object:Gem::Version
4
- hash: 19
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 4
10
- version: 0.1.4
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Shawn Catanzarite
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-05-17 00:00:00 -07:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2013-04-02 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: capistrano
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 2.13.0
22
+ type: :runtime
23
23
  prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
33
- type: :development
34
- version_requirements: *id001
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 2.13.0
35
30
  description: Common way to manage webserver (apache) configuration using capistrano
36
- email: shawn@dasho.net
31
+ email:
32
+ - me@shawncatz.com
37
33
  executables: []
38
-
39
34
  extensions: []
40
-
41
- extra_rdoc_files:
42
- - README.rdoc
43
- - lib/webserver/apache.rb
44
- files:
45
- - README.rdoc
35
+ extra_rdoc_files: []
36
+ files:
37
+ - .gitignore
38
+ - Gemfile
39
+ - Gemfile.lock
40
+ - LICENSE.txt
41
+ - README.md
46
42
  - Rakefile
47
43
  - capistrano-webserver.gemspec
48
- - lib/webserver/apache.rb
49
- - Manifest
50
- has_rdoc: true
51
- homepage: http://github.com/dashonet/capistrano-webserver
44
+ - lib/capistrano-webserver.rb
45
+ - lib/capistrano/webserver.rb
46
+ - lib/capistrano/webserver/apache.rb
47
+ - lib/capistrano/webserver/version.rb
48
+ homepage: http://github.com/shawncatz/capistrano-webserver
52
49
  licenses: []
53
-
54
50
  post_install_message:
55
- rdoc_options:
56
- - --line-numbers
57
- - --inline-source
58
- - --title
59
- - Capistrano-webserver
60
- - --main
61
- - README.rdoc
62
- require_paths:
51
+ rdoc_options: []
52
+ require_paths:
63
53
  - lib
64
- required_ruby_version: !ruby/object:Gem::Requirement
54
+ required_ruby_version: !ruby/object:Gem::Requirement
65
55
  none: false
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- hash: 3
70
- segments:
71
- - 0
72
- version: "0"
73
- required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
61
  none: false
75
- requirements:
76
- - - ">="
77
- - !ruby/object:Gem::Version
78
- hash: 11
79
- segments:
80
- - 1
81
- - 2
82
- version: "1.2"
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
83
66
  requirements: []
84
-
85
- rubyforge_project: capistrano-webserver
86
- rubygems_version: 1.6.2
67
+ rubyforge_project:
68
+ rubygems_version: 1.8.24
87
69
  signing_key:
88
70
  specification_version: 3
89
- summary: Common way to manage webserver configuration using capistrano. Only apache is currently supported.
71
+ summary: Common way to manage webserver (apache) configuration using capistrano
90
72
  test_files: []
91
-
data/Manifest DELETED
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- Rakefile
3
- capistrano-webserver.gemspec
4
- lib/webserver/apache.rb
5
- Manifest
@@ -1,63 +0,0 @@
1
- = Capistrano WebServer
2
-
3
- The purpose of this gem is to provide a common interface to handling webserver related functions within capistrano deploy scripts.
4
- The contents of this file are still a bit of a work in progress.
5
-
6
- = Server Support
7
-
8
- Currently, only apache is supported.
9
-
10
- = Configuration
11
-
12
- == Common variables
13
-
14
- [webserver_config] <b>default: config/webserver/webserver.conf</b>
15
- the file to use for webserver configuration. For apache, this might be the file
16
- containing the VirtualHost block of the site in which the project
17
- will be running.
18
- [webserver_link] <b>default: true</b>
19
- Use a symlink from the webserver configuration directory to the project configuration file.
20
- If this is set to false, the file will be copied to the webserver configuration directory.
21
- [webserver_restart] <b>default: true</b>
22
- Should the webserver be restarted after configuration is updated.
23
-
24
- == Module variables
25
-
26
- [webserver_dir] This is defined by the capistrano_webserver modules. For apache, this would generally point to
27
- sites-enabled directory under the ServerRoot. (eg: /etc/apache2/sites-enabled)
28
-
29
- = Tasks
30
-
31
- Each webserver library will implement the following capistrano tasks. These tasks will only run on servers with the :web role.
32
-
33
- == webserver:configuration
34
-
35
- This task will handle linking or copying the configuration file from the project directory to the webserver directory.
36
-
37
- == webserver:restart
38
-
39
- This task will restart the webserver.
40
-
41
- == webserver:stop
42
-
43
- This task will stop the webserver.
44
-
45
- == webserver:start
46
-
47
- This task will start the webserver.
48
-
49
- = Usage
50
-
51
- Install the gem:
52
-
53
- gem install capistrano-webserver
54
-
55
- Put the following code into your capistrano deploy.rb (or other) file. For now, only apache is supported. Later, support for other webservers will be added.
56
-
57
- require 'webserver/apache'
58
-
59
- If your configuration or webserver requires a restart after code deploy, simply add the following hook. This will work by default, careful of overriding the variable 'webserver_restart'.
60
-
61
- after 'deploy:update_code', 'webserver:configuration'
62
-
63
- In the case of Apache, you do not need this. You should not need to restart the Apache server after every deploy.