bard 0.6.4 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. data/VERSION +1 -1
  2. data/bard.gemspec +1 -1
  3. data/lib/bard.rb +5 -5
  4. data/lib/bard/io.rb +4 -0
  5. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.4
1
+ 0.6.5
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bard}
8
- s.version = "0.6.4"
8
+ s.version = "0.6.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Micah Geisel", "Nick Hogle"]
@@ -99,6 +99,8 @@ class Bard < Thor
99
99
  run_crucial "git merge integration"
100
100
  run_crucial "git push origin master"
101
101
  run_crucial "git checkout integration"
102
+
103
+ run_crucial "cap ROLES=staging COMMAND='cd #{project_name} && cap deploy' invoke"
102
104
  end
103
105
 
104
106
  if ENV['RAILS_ENV'] == "staging"
@@ -114,8 +116,6 @@ class Bard < Thor
114
116
  ENV['GIT_DIR'] = '.git'
115
117
  end
116
118
 
117
- run_crucial "git reset --hard"
118
-
119
119
  # find out the current branch
120
120
  head = File.read('.git/HEAD').chomp
121
121
  # abort if we're on a detached head
@@ -123,9 +123,9 @@ class Bard < Thor
123
123
  revs = gets.split ' '
124
124
  old_rev, new_rev, branch = revs
125
125
 
126
- if branch == "master"
127
- run_crucial "cap deploy"
128
- elsif head == branch
126
+ if head == branch
127
+ run_crucial "git reset --hard"
128
+
129
129
  changed_files = run_crucial("git diff #{old_rev} #{new_rev} --diff-filter=ACMRD --name-only").split("\n")
130
130
 
131
131
  if changed_files.any? { |f| f =~ %r(^db/migrate/.+) }
@@ -19,4 +19,8 @@ module BardIO
19
19
  end
20
20
  stdout.chomp
21
21
  end
22
+
23
+ def project_name
24
+ @project_name ||= File.expand_path(".").split("/").last
25
+ end
22
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel