thegarage-gitx 2.7.2 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/thegarage/gitx/cli/release_command.rb +2 -1
- data/lib/thegarage/gitx/version.rb +1 -1
- data/spec/thegarage/gitx/cli/release_command_spec.rb +33 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10f4e21a3805920b5ca93946c11e56ef001efe97
|
4
|
+
data.tar.gz: d9aadf889e5fb72ff04eea5a038415b1c7de1f82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfd973230ab08b57c6dca5d53af1be8ba7b82f043ee17f03ef9aa58496f53c52592035143194015a89de3be1fb42d8f97b3e9b1c66687cb4325a3c29fd26588c
|
7
|
+
data.tar.gz: c955f5f81ad7adca14b84537f64b0d7fefa6e02d88243e00c4fe1a57f2188d3e0f345635ad0a016c4b53e3653da2b4df3b6fe358b2b3ab34bf1dae92b9cf4c60
|
data/README.md
CHANGED
@@ -45,7 +45,10 @@ release the current feature branch to master. This operation will perform the f
|
|
45
45
|
* merge in latest code from master branch
|
46
46
|
* prompt user to confirm they actually want to perform the release
|
47
47
|
* merge current branch into master
|
48
|
-
* cleanup merged branches from remote server
|
48
|
+
* (optional) cleanup merged branches from remote server
|
49
|
+
|
50
|
+
options:
|
51
|
+
* `--cleanup` = automatically cleanup merged branches after release complete
|
49
52
|
|
50
53
|
# Extra Utility Git Extensions
|
51
54
|
|
@@ -13,6 +13,7 @@ module Thegarage
|
|
13
13
|
include Github
|
14
14
|
|
15
15
|
desc 'release', 'release the current branch to production'
|
16
|
+
method_option :cleanup, :type => :boolean, :desc => 'cleanup merged branches after release'
|
16
17
|
def release
|
17
18
|
return unless yes?("Release #{current_branch.name} to production? (y/n)", :green)
|
18
19
|
|
@@ -28,7 +29,7 @@ module Thegarage
|
|
28
29
|
run_cmd "git push origin HEAD"
|
29
30
|
|
30
31
|
execute_command(IntegrateCommand, :integrate, 'staging')
|
31
|
-
execute_command(CleanupCommand, :cleanup)
|
32
|
+
execute_command(CleanupCommand, :cleanup) if options[:cleanup]
|
32
33
|
end
|
33
34
|
end
|
34
35
|
end
|
@@ -33,7 +33,7 @@ describe Thegarage::Gitx::Cli::ReleaseCommand do
|
|
33
33
|
before do
|
34
34
|
expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::UpdateCommand, :update)
|
35
35
|
expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::IntegrateCommand, :integrate, 'staging')
|
36
|
-
expect(cli).
|
36
|
+
expect(cli).to_not receive(:execute_command).with(Thegarage::Gitx::Cli::CleanupCommand, :cleanup)
|
37
37
|
|
38
38
|
expect(cli).to receive(:yes?).and_return(true)
|
39
39
|
allow(cli).to receive(:authorization_token).and_return(authorization_token)
|
@@ -69,7 +69,7 @@ describe Thegarage::Gitx::Cli::ReleaseCommand do
|
|
69
69
|
|
70
70
|
expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::UpdateCommand, :update).twice
|
71
71
|
expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::IntegrateCommand, :integrate, 'staging')
|
72
|
-
expect(cli).
|
72
|
+
expect(cli).to_not receive(:execute_command).with(Thegarage::Gitx::Cli::CleanupCommand, :cleanup)
|
73
73
|
|
74
74
|
expect(cli).to receive(:yes?).and_return(true)
|
75
75
|
|
@@ -91,5 +91,36 @@ describe Thegarage::Gitx::Cli::ReleaseCommand do
|
|
91
91
|
should meet_expectations
|
92
92
|
end
|
93
93
|
end
|
94
|
+
context 'when --cleanup flag passed' do
|
95
|
+
let(:options) do
|
96
|
+
{
|
97
|
+
cleanup: true
|
98
|
+
}
|
99
|
+
end
|
100
|
+
let(:authorization_token) { '123123' }
|
101
|
+
before do
|
102
|
+
expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::UpdateCommand, :update)
|
103
|
+
expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::IntegrateCommand, :integrate, 'staging')
|
104
|
+
expect(cli).to receive(:execute_command).with(Thegarage::Gitx::Cli::CleanupCommand, :cleanup)
|
105
|
+
|
106
|
+
expect(cli).to receive(:yes?).and_return(true)
|
107
|
+
allow(cli).to receive(:authorization_token).and_return(authorization_token)
|
108
|
+
|
109
|
+
expect(cli).to receive(:run_cmd).with("git checkout master").ordered
|
110
|
+
expect(cli).to receive(:run_cmd).with("git pull origin master").ordered
|
111
|
+
expect(cli).to receive(:run_cmd).with("git merge --no-ff feature-branch").ordered
|
112
|
+
expect(cli).to receive(:run_cmd).with("git push origin HEAD").ordered
|
113
|
+
|
114
|
+
VCR.use_cassette('pull_request_does_exist') do
|
115
|
+
cli.release
|
116
|
+
end
|
117
|
+
end
|
118
|
+
it 'runs expected commands' do
|
119
|
+
should meet_expectations
|
120
|
+
end
|
121
|
+
it 'prunes merged branches (git cleanup)' do
|
122
|
+
should meet_expectations
|
123
|
+
end
|
124
|
+
end
|
94
125
|
end
|
95
126
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thegarage-gitx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Sonnek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|