deploy-recipes 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -0
- data/README.md +33 -2
- data/Rakefile +2 -0
- data/deploy-recipes.gemspec +7 -1
- data/lib/common.rb +17 -0
- data/lib/deploy-recipes.rb +4 -6
- data/lib/deploy-recipes/aws-ec2.rb +50 -0
- data/lib/deploy-recipes/base.rb +38 -0
- data/lib/deploy-recipes/database.rb +168 -0
- data/lib/deploy-recipes/deploy-automation.rb +115 -0
- data/lib/{deploy-recipes/version.rb → version.rb} +1 -1
- metadata +96 -4
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use 1.9.3-p194
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Deploy::Recipes
|
2
2
|
|
3
|
-
|
3
|
+
This Gem provides deployment helpers and task used by [The Beans Group][1].
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -17,8 +17,37 @@ Or install it yourself as:
|
|
17
17
|
$ gem install deploy-recipes
|
18
18
|
|
19
19
|
## Usage
|
20
|
+
Some tasks and helpers require extra configuration. At the moment the only way of providing the extra configuration options is to set those in the `deploy.rb` sript.
|
21
|
+
The way of setting them is as follows:
|
20
22
|
|
21
|
-
|
23
|
+
set :option_name, option_value
|
24
|
+
|
25
|
+
## Capistrano Helper Usage
|
26
|
+
This Gem contains some helpers that can be used with capistrano. Helpers generally need to be loaded at the top of the `deploy.rb` script, if not otherwise stated.
|
27
|
+
|
28
|
+
### AWS EC2
|
29
|
+
The AWS EC2 task is used to dynamically set the web, app and db server valiables in your deploy.rb file.
|
30
|
+
For this helper to work properly you need to set the following vaiables in your `deploy.rb` file:
|
31
|
+
|
32
|
+
* `access_key_id` (required) - Your AWS access key id
|
33
|
+
* `secret_access_key` (required) - You AWS secret access key
|
34
|
+
|
35
|
+
## Capistrano Tasks Usage
|
36
|
+
This section describes the tasks made available by this Gem. Tasks are generally (if not otherwise stated) loaded at the end of the `deploy.rb` script.
|
37
|
+
|
38
|
+
### Database
|
39
|
+
This task can be used to generate the database configuration file for a project. During the execution of this taks it will ask you to enter the password of the database.
|
40
|
+
This tasks will be executed once required in the `deploy.rb` file. For more information when this task will be run please look towards the end of this taks.
|
41
|
+
|
42
|
+
### Deploy Automation
|
43
|
+
The deploy automation task can be used with Pivotal Tracker and Git to make deployment and managing deploys easier.
|
44
|
+
For this task to work properly you need to set the following vaiables in your `deploy.rb` file:
|
45
|
+
|
46
|
+
* `pivotal_tracker_token` (required) - This is the API token needed to interact with your PT account
|
47
|
+
* `changelog_location` (optional) - Define the location at which you would like the changelog to be stored. At the moment this has to be within
|
48
|
+
the scope of the Git repository because this task expects to be able to commit the changelog and push it to the remote branch.
|
49
|
+
|
50
|
+
This tasks will be executed after the `deploy:cleanup` task, once required in the `deploy.rb` file.
|
22
51
|
|
23
52
|
## Contributing
|
24
53
|
|
@@ -27,3 +56,5 @@ TODO: Write usage instructions here
|
|
27
56
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
28
57
|
4. Push to the branch (`git push origin my-new-feature`)
|
29
58
|
5. Create new Pull Request
|
59
|
+
|
60
|
+
[1]: http://www.thebeansgroup.com "The Beans Group"
|
data/Rakefile
CHANGED
data/deploy-recipes.gemspec
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
require File.expand_path('../lib/
|
2
|
+
require File.expand_path('../lib/version', __FILE__)
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["Vincent Siebert"]
|
@@ -14,4 +14,10 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.name = "deploy-recipes"
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = Deploy::Recipes::VERSION
|
17
|
+
|
18
|
+
gem.add_dependency "capistrano", ">= 2.5.9"
|
19
|
+
gem.add_dependency "pivotal-tracker", ">= 0.5.4"
|
20
|
+
gem.add_dependency "grit", ">= 2.5.0"
|
21
|
+
gem.add_dependency "tinder", ">= 1.8.0"
|
22
|
+
gem.add_dependency "aws-sdk", ">= 1.5.3"
|
17
23
|
end
|
data/lib/common.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
def _cset(name, *args, &block)
|
2
|
+
unless exists?(name)
|
3
|
+
set(name, *args, &block)
|
4
|
+
end
|
5
|
+
end
|
6
|
+
|
7
|
+
def _cdefault_run_options(key, value)
|
8
|
+
unless default_run_options.has_key? key
|
9
|
+
default_run_options[key] = value
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def _cssh_options(key, value)
|
14
|
+
unless ssh_options.has_key? key
|
15
|
+
ssh_options[key] = value
|
16
|
+
end
|
17
|
+
end
|
data/lib/deploy-recipes.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
require
|
1
|
+
require 'capistrano'
|
2
|
+
require 'capistrano/cli'
|
3
|
+
require 'common'
|
2
4
|
|
3
|
-
|
4
|
-
module Recipes
|
5
|
-
# Your code goes here...
|
6
|
-
end
|
7
|
-
end
|
5
|
+
Dir.glob(File.join(File.dirname(__FILE__), '/deploy-recipes/*.rb')).sort.each { |f| load f }
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# load the libraries
|
2
|
+
require 'aws'
|
3
|
+
# # log requests using the default rails logger
|
4
|
+
# AWS.config(:logger => Rails.logger)
|
5
|
+
|
6
|
+
def aws_ec2_role(which, *args, &block)
|
7
|
+
|
8
|
+
options = args.last.is_a?(Hash) ? args.pop : {}
|
9
|
+
|
10
|
+
# validate EC2 settings
|
11
|
+
_cset(:access_key_id) { Capistrano::CLI.ui.ask("Enter your AWS access key ID: ") }
|
12
|
+
_cset(:secret_access_key) { Capistrano::CLI.ui.ask("Enter your AWS secret key: ") }
|
13
|
+
|
14
|
+
AWS.config :access_key_id => access_key_id, :secret_access_key => secret_access_key
|
15
|
+
|
16
|
+
ec2 = AWS::EC2.new
|
17
|
+
# optionally switch to a non-default region
|
18
|
+
if region = options[:region]
|
19
|
+
region = ec2.regions[region]
|
20
|
+
unless region.exists?
|
21
|
+
raise "Requested region '#{region.name}' does not exist. Valid regions: \n #{ec2.regions.map(&:name).join("\n ")}"
|
22
|
+
end
|
23
|
+
# a region acts like the main EC2 interface
|
24
|
+
ec2 = region
|
25
|
+
end
|
26
|
+
|
27
|
+
query = {}
|
28
|
+
|
29
|
+
instances = AWS.memoize do
|
30
|
+
query = {}
|
31
|
+
# Filter by tags
|
32
|
+
if tags = options[:tags]
|
33
|
+
args.delete :tags
|
34
|
+
ec2.instances.select do |i|
|
35
|
+
r = false
|
36
|
+
tags.each do |key, value|
|
37
|
+
if value
|
38
|
+
r = i.tags.to_h[key.to_s] == value
|
39
|
+
else
|
40
|
+
r = i.tags.to_h.has_key? key.to_s
|
41
|
+
end
|
42
|
+
end
|
43
|
+
r
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
# @TODO we need to make sure we merge the dns names with the other args
|
48
|
+
args = instances.map {|i| i.dns_name}
|
49
|
+
role which, *args
|
50
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
unless Capistrano::Configuration.respond_to?(:instance)
|
2
|
+
abort "capistrano/tbg/deploy requires Capistrano 2"
|
3
|
+
end
|
4
|
+
|
5
|
+
Capistrano::Configuration.instance.load do
|
6
|
+
# User details
|
7
|
+
_cset :user, "deploy"
|
8
|
+
_cset(:group) { user }
|
9
|
+
|
10
|
+
# @TODO utilise a deployment config file outside the project to be able to DRY the deploy config system
|
11
|
+
_cset :config_file, "~/.deployment-configs.yml"
|
12
|
+
|
13
|
+
# Application details
|
14
|
+
_cset(:application) { abort "Please specify the short name of your application, set :application, 'foo'" }
|
15
|
+
_cset :use_sudo, false
|
16
|
+
|
17
|
+
# SCM settings
|
18
|
+
_cset(:deploy_to) { "/var/www/apps/#{application}" }
|
19
|
+
_cset :scm, "git"
|
20
|
+
_cset :branch, "master"
|
21
|
+
_cset :deploy_via, "remote_cache"
|
22
|
+
|
23
|
+
# Git settings for Capistrano
|
24
|
+
_cdefault_run_options :pty, true # needed for git password prompts
|
25
|
+
_cssh_options :forward_agent, true # use the keys for the person running the cap command to check out the append
|
26
|
+
_cssh_options :auth_methods, ["publickey"]
|
27
|
+
_cssh_options :keys, [File.join(ENV["HOME"], ".ssh", user)]
|
28
|
+
|
29
|
+
# If you are using Passenger mod_rails uncomment this:
|
30
|
+
namespace :deploy do
|
31
|
+
task :start do ; end
|
32
|
+
task :stop do ; end
|
33
|
+
task :restart, :roles => :app, :except => { :no_release => true } do
|
34
|
+
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,168 @@
|
|
1
|
+
#
|
2
|
+
# = Capistrano database.yml task
|
3
|
+
#
|
4
|
+
# Provides a couple of tasks for creating the database.yml
|
5
|
+
# configuration file dynamically when deploy:setup is run.
|
6
|
+
#
|
7
|
+
# Category:: Capistrano
|
8
|
+
# Package:: Database
|
9
|
+
# Author:: Simone Carletti <weppos@weppos.net>
|
10
|
+
# Copyright:: 2007-2010 The Authors
|
11
|
+
# License:: MIT License
|
12
|
+
# Link:: http://www.simonecarletti.com/
|
13
|
+
# Source:: http://gist.github.com/2769
|
14
|
+
#
|
15
|
+
#
|
16
|
+
# == Requirements
|
17
|
+
#
|
18
|
+
# This extension requires the original <tt>config/database.yml</tt> to be excluded
|
19
|
+
# from source code checkout. You can easily accomplish this by renaming
|
20
|
+
# the file (for example to database.example.yml) and appending <tt>database.yml</tt>
|
21
|
+
# value to your SCM ignore list.
|
22
|
+
#
|
23
|
+
# # Example for Subversion
|
24
|
+
#
|
25
|
+
# $ svn mv config/database.yml config/database.example.yml
|
26
|
+
# $ svn propset svn:ignore 'database.yml' config
|
27
|
+
#
|
28
|
+
# # Example for Git
|
29
|
+
#
|
30
|
+
# $ git mv config/database.yml config/database.example.yml
|
31
|
+
# $ echo 'config/database.yml' >> .gitignore
|
32
|
+
#
|
33
|
+
#
|
34
|
+
# == Usage
|
35
|
+
#
|
36
|
+
# Include this file in your <tt>deploy.rb</tt> configuration file.
|
37
|
+
# Assuming you saved this recipe as capistrano_database_yml.rb:
|
38
|
+
#
|
39
|
+
# require "capistrano_database_yml"
|
40
|
+
#
|
41
|
+
# Now, when <tt>deploy:setup</tt> is called, this script will automatically
|
42
|
+
# create the <tt>database.yml</tt> file in the shared folder.
|
43
|
+
# Each time you run a deploy, this script will also create a symlink
|
44
|
+
# from your application <tt>config/database.yml</tt> pointing to the shared configuration file.
|
45
|
+
#
|
46
|
+
# == Custom template
|
47
|
+
#
|
48
|
+
# By default, this script creates an exact copy of the default
|
49
|
+
# <tt>database.yml</tt> file shipped with a new Rails 2.x application.
|
50
|
+
# If you want to overwrite the default template, simply create a custom Erb template
|
51
|
+
# called <tt>database.yml.erb</tt> and save it into <tt>config/deploy</tt> folder.
|
52
|
+
#
|
53
|
+
# Although the name of the file can't be changed, you can customize the directory
|
54
|
+
# where it is stored defining a variable called <tt>:template_dir</tt>.
|
55
|
+
#
|
56
|
+
# # store your custom template at foo/bar/database.yml.erb
|
57
|
+
# set :template_dir, "foo/bar"
|
58
|
+
#
|
59
|
+
# # example of database template
|
60
|
+
#
|
61
|
+
# base: &base
|
62
|
+
# adapter: sqlite3
|
63
|
+
# timeout: 5000
|
64
|
+
# development:
|
65
|
+
# database: #{shared_path}/db/development.sqlite3
|
66
|
+
# <<: *base
|
67
|
+
# test:
|
68
|
+
# database: #{shared_path}/db/test.sqlite3
|
69
|
+
# <<: *base
|
70
|
+
# production:
|
71
|
+
# adapter: mysql
|
72
|
+
# database: #{application}_production
|
73
|
+
# username: #{user}
|
74
|
+
# password: #{Capistrano::CLI.ui.ask("Enter MySQL database password: ")}
|
75
|
+
# encoding: utf8
|
76
|
+
# timeout: 5000
|
77
|
+
#
|
78
|
+
# Because this is an Erb template, you can place variables and Ruby scripts
|
79
|
+
# within the file.
|
80
|
+
# For instance, the template above takes advantage of Capistrano CLI
|
81
|
+
# to ask for a MySQL database password instead of hard coding it into the template.
|
82
|
+
#
|
83
|
+
# === Password prompt
|
84
|
+
#
|
85
|
+
# For security reasons, in the example below the password is not
|
86
|
+
# hard coded (or stored in a variable) but asked on setup.
|
87
|
+
# I don't like to store passwords in files under version control
|
88
|
+
# because they will live forever in your history.
|
89
|
+
# This is why I use the Capistrano::CLI utility.
|
90
|
+
#
|
91
|
+
|
92
|
+
unless Capistrano::Configuration.respond_to?(:instance)
|
93
|
+
abort "This extension requires Capistrano 2"
|
94
|
+
end
|
95
|
+
|
96
|
+
Capistrano::Configuration.instance.load do
|
97
|
+
|
98
|
+
namespace :deploy do
|
99
|
+
|
100
|
+
namespace :db do
|
101
|
+
|
102
|
+
desc <<-DESC
|
103
|
+
Creates the database.yml configuration file in shared path.
|
104
|
+
|
105
|
+
By default, this task uses a template unless a template \
|
106
|
+
called database.yml.erb is found either is :template_dir \
|
107
|
+
or /config/deploy folders. The default template matches \
|
108
|
+
the template for config/database.yml file shipped with Rails.
|
109
|
+
|
110
|
+
When this recipe is loaded, db:setup is automatically configured \
|
111
|
+
to be invoked after deploy:setup. You can skip this task setting \
|
112
|
+
the variable :skip_db_setup to true. This is especially useful \
|
113
|
+
if you are using this recipe in combination with \
|
114
|
+
capistrano-ext/multistaging to avoid multiple db:setup calls \
|
115
|
+
when running deploy:setup for all stages one by one.
|
116
|
+
DESC
|
117
|
+
task :setup, :except => { :no_release => true } do
|
118
|
+
default_template = <<-EOF
|
119
|
+
# store your custom template at foo/bar/database.yml.erb
|
120
|
+
#set :template_dir, "foo/bar"
|
121
|
+
#
|
122
|
+
# example of database template
|
123
|
+
production:
|
124
|
+
adapter: mysql2
|
125
|
+
encoding: utf8
|
126
|
+
timeout: 5000
|
127
|
+
database: #{application}
|
128
|
+
host: db.thebeansgroup.com
|
129
|
+
pool: 5
|
130
|
+
username: tbg
|
131
|
+
password: #{Capistrano::CLI.ui.ask("Enter MySQL database password: ")}
|
132
|
+
EOF
|
133
|
+
|
134
|
+
location = fetch(:template_dir, "config/deploy") + '/database.yml.erb'
|
135
|
+
template = File.file?(location) ? File.read(location) : default_template
|
136
|
+
|
137
|
+
config = ERB.new(template)
|
138
|
+
|
139
|
+
run "mkdir -p #{shared_path}/db"
|
140
|
+
run "mkdir -p #{shared_path}/config"
|
141
|
+
put config.result, "#{shared_path}/config/database.yml"
|
142
|
+
end
|
143
|
+
|
144
|
+
desc <<-DESC
|
145
|
+
[internal] Updates the symlink for database.yml file to the just deployed release.
|
146
|
+
DESC
|
147
|
+
task :symlink, :except => { :no_release => true } do
|
148
|
+
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
|
149
|
+
end
|
150
|
+
|
151
|
+
desc <<-DESC
|
152
|
+
[internal] Removes the database.yml file after code_update in order for the symlink to work
|
153
|
+
DESC
|
154
|
+
task :remove_config, :except => { :no_release => true } do
|
155
|
+
f = "#{release_path}/config/database.yml"
|
156
|
+
if File.file?(f) then FileUtils.rm_rf(f) end
|
157
|
+
end
|
158
|
+
|
159
|
+
|
160
|
+
end
|
161
|
+
|
162
|
+
after "deploy:setup", "deploy:db:setup" unless fetch(:skip_db_setup, false)
|
163
|
+
after "deploy:code_update", "deploy:db:remove_config"
|
164
|
+
after "deploy:finalize_update", "deploy:db:symlink"
|
165
|
+
|
166
|
+
end
|
167
|
+
|
168
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
require "pivotal-tracker"
|
2
|
+
require "grit"
|
3
|
+
require "tinder"
|
4
|
+
|
5
|
+
unless Capistrano::Configuration.respond_to?(:instance)
|
6
|
+
abort "This extension requires Capistrano 2"
|
7
|
+
end
|
8
|
+
|
9
|
+
Capistrano::Configuration.instance.load do
|
10
|
+
namespace :deploy do
|
11
|
+
namespace :automation do
|
12
|
+
desc "Get all referenced pivotal tracker stories"
|
13
|
+
task :create_changelog do
|
14
|
+
|
15
|
+
# validate Pivotal Tracker settings
|
16
|
+
_cset(:pivotal_tracker_token) { Capistrano::CLI.ui.ask("Enter your Pivotal Tracker tocken: ") }
|
17
|
+
|
18
|
+
# validate Campfire settings
|
19
|
+
_cset(:pivotal_tracker_token) { Capistrano::CLI.ui.ask("Enter your Pivotal Tracker tocken: ") }
|
20
|
+
_cset(:pivotal_tracker_token) { Capistrano::CLI.ui.ask("Enter your Pivotal Tracker tocken: ") }
|
21
|
+
|
22
|
+
_cset(:changelog_location) { "#{Rails.root}/CHANGELOG.md" }
|
23
|
+
|
24
|
+
changelog = {:features => [], :bugs => [], :chores => []}
|
25
|
+
# get current repo
|
26
|
+
repo = Grit::Repo.new Rails.root
|
27
|
+
# last release
|
28
|
+
# last_rel = "REL-2012-06-12_10-38-04"
|
29
|
+
last_rel = repo.git.describe({'abbrev' => 0, 'tags' => true, 'match' => 'REL-*'}).gsub!("\n","")
|
30
|
+
p "LAST RELEASE: #{last_rel}"
|
31
|
+
# validate
|
32
|
+
raise "Could not find previous release tag" unless last_rel
|
33
|
+
|
34
|
+
# lets tag the new release
|
35
|
+
time = Time.new
|
36
|
+
tag_name = time.to_formatted_s :release_tag
|
37
|
+
repo.git.tag({ 'a' => true, 'm' => "creating release tag for #{tag_name}"}, tag_name)
|
38
|
+
repo.git.push({'tags' => true})
|
39
|
+
|
40
|
+
# current release
|
41
|
+
cur_rel = repo.git.describe({'abbrev' => 0, 'tags' => true, 'match' => 'REL-*'}).gsub!("\n","")
|
42
|
+
p "CURRENT RELEASE: #{cur_rel}"
|
43
|
+
# validate
|
44
|
+
raise "Could not find latest release tag" unless cur_rel
|
45
|
+
# Now lets get all the commit messages with PT story references
|
46
|
+
commits = repo.git.log({'grep' => "\[[ a-z]*[ ]*#[0-9]+[ ]*\]", 'E' => true, 'i' => true, 'format' => 'format:%s'}, "#{last_rel}...#{cur_rel}")
|
47
|
+
p commits
|
48
|
+
# Only if we have commit do we need to carry on
|
49
|
+
if not commits.blank?
|
50
|
+
# Lets extract the sory references
|
51
|
+
story_ids = commits.scan(/\[[ a-z]*[ ]*#([0-9]+)[ ]*\]/).flatten!.uniq
|
52
|
+
p story_ids
|
53
|
+
# Pivotal Tracker
|
54
|
+
accepted_status = [:started, :finished, :delivered, :accepted]
|
55
|
+
# Manually set API Token
|
56
|
+
PivotalTracker::Client.token = Rails.application.config.pivotal_tracker_token
|
57
|
+
# return all projects
|
58
|
+
projects = PivotalTracker::Project.all
|
59
|
+
# We need to order the projects by the likelyhood of stories being contained within them to speed up the process
|
60
|
+
projects = projects.sort { |p1, p2| p2.last_activity_at <=> p1.last_activity_at }
|
61
|
+
projects.map do |project|
|
62
|
+
break unless story_ids
|
63
|
+
p "checking project #{project.name} for stories"
|
64
|
+
story_ids.each do |id|
|
65
|
+
story = project.stories.find id
|
66
|
+
if story
|
67
|
+
if accepted_status.include? story.current_state.to_sym
|
68
|
+
changelog[story.story_type.pluralize.to_sym] << story.name
|
69
|
+
story.update :current_state => :accepted
|
70
|
+
story.notes.create(:text => "This #{story.story_type} was deployed with release #{tag_name}")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
# Now lets assemble the changelog
|
76
|
+
head = "\n## Release #{tag_name}\nPlease find all changes below.\n"
|
77
|
+
# assemble the features
|
78
|
+
features = "\n### New features deployed:\n"
|
79
|
+
if changelog[:features]
|
80
|
+
changelog[:features].each do |feature|
|
81
|
+
features << "* #{feature}\n"
|
82
|
+
end
|
83
|
+
else
|
84
|
+
features << "**No new features deployed**\n"
|
85
|
+
end
|
86
|
+
# Assemble the bug fixes
|
87
|
+
bugs = "\n### Bug fixes deployed:\n"
|
88
|
+
if changelog[:bugs]
|
89
|
+
changelog[:bugs].each do |bug|
|
90
|
+
bugs << "* #{bug}\n"
|
91
|
+
end
|
92
|
+
else
|
93
|
+
bugs << "**No bug fixes deployed**\n"
|
94
|
+
end
|
95
|
+
# Write the changelog to the changelog file
|
96
|
+
open(changelog_location, 'a') do |f|
|
97
|
+
f << head
|
98
|
+
f << features
|
99
|
+
f << bugs
|
100
|
+
end
|
101
|
+
# And commit them to the remote
|
102
|
+
# p changelog_location
|
103
|
+
repo.git.add({}, changelog_location)
|
104
|
+
c = repo.git.commit({'m' => "updating changelog for release #{tag_name}"}, changelog_location).scan(/^\[(\w+)[\s]{1}([a-zA-Z0-9]+)\]/).flatten
|
105
|
+
if c.first and c.last
|
106
|
+
repo.git.push({}, "origin", "#{c.last}:#{c.first}")
|
107
|
+
end
|
108
|
+
else
|
109
|
+
p "No commits with story references identified"
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
after "deploy:cleanup", "deploy:automation"
|
114
|
+
end
|
115
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deploy-recipes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,88 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
13
|
-
dependencies:
|
12
|
+
date: 2012-07-11 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: capistrano
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.5.9
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.5.9
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: pivotal-tracker
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.5.4
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.5.4
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: grit
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.5.0
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.5.0
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: tinder
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 1.8.0
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.8.0
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: aws-sdk
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 1.5.3
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.5.3
|
14
94
|
description: Collection of capistrano deploy recipes
|
15
95
|
email:
|
16
96
|
- vincent@siebert.im
|
@@ -19,13 +99,19 @@ extensions: []
|
|
19
99
|
extra_rdoc_files: []
|
20
100
|
files:
|
21
101
|
- .gitignore
|
102
|
+
- .rvmrc
|
22
103
|
- Gemfile
|
23
104
|
- LICENSE
|
24
105
|
- README.md
|
25
106
|
- Rakefile
|
26
107
|
- deploy-recipes.gemspec
|
108
|
+
- lib/common.rb
|
27
109
|
- lib/deploy-recipes.rb
|
28
|
-
- lib/deploy-recipes/
|
110
|
+
- lib/deploy-recipes/aws-ec2.rb
|
111
|
+
- lib/deploy-recipes/base.rb
|
112
|
+
- lib/deploy-recipes/database.rb
|
113
|
+
- lib/deploy-recipes/deploy-automation.rb
|
114
|
+
- lib/version.rb
|
29
115
|
homepage: ''
|
30
116
|
licenses: []
|
31
117
|
post_install_message:
|
@@ -38,12 +124,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
38
124
|
- - ! '>='
|
39
125
|
- !ruby/object:Gem::Version
|
40
126
|
version: '0'
|
127
|
+
segments:
|
128
|
+
- 0
|
129
|
+
hash: 3176994864263131959
|
41
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
131
|
none: false
|
43
132
|
requirements:
|
44
133
|
- - ! '>='
|
45
134
|
- !ruby/object:Gem::Version
|
46
135
|
version: '0'
|
136
|
+
segments:
|
137
|
+
- 0
|
138
|
+
hash: 3176994864263131959
|
47
139
|
requirements: []
|
48
140
|
rubyforge_project:
|
49
141
|
rubygems_version: 1.8.19
|