papa 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +24 -4
- data/USAGE.md +54 -8
- data/lib/papa/cli/hotfix.rb +11 -3
- data/lib/papa/cli/integration.rb +25 -7
- data/lib/papa/cli/release.rb +3 -3
- data/lib/papa/task/common/add.rb +22 -26
- data/lib/papa/task/common/deploy.rb +56 -0
- data/lib/papa/task/common/finish.rb +31 -15
- data/lib/papa/task/common/start.rb +10 -7
- data/lib/papa/task/hotfix/add.rb +1 -1
- data/lib/papa/task/hotfix/deploy.rb +15 -0
- data/lib/papa/task/hotfix/finish.rb +1 -1
- data/lib/papa/task/hotfix/start.rb +1 -1
- data/lib/papa/task/integration/add.rb +29 -0
- data/lib/papa/task/integration/deploy.rb +15 -0
- data/lib/papa/task/integration/start.rb +4 -35
- data/lib/papa/task/release/add.rb +1 -1
- data/lib/papa/task/release/finish.rb +1 -1
- data/lib/papa/task/release/start.rb +1 -1
- data/lib/papa/version.rb +1 -1
- data/papa.gemspec +0 -3
- metadata +6 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 148db42da7efd02693c120d2bdc5c30eee785ff2
|
4
|
+
data.tar.gz: 4bbc65502f1104de6529462428844b6af31756cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77c15709988cfa6287d21c4fff43e99bb325a1ccc75b77fa48efcd8d089edd84db804fdd35afc992505c73eb8fcdc0c8f4183ca51538b61a1cb1c8dc7bf3ab0f
|
7
|
+
data.tar.gz: 0eb00148472bd74162d8b4b13cee2bc22a7a8265fa01c8ed8b82f453e7418b0f403c8a6ed7524874179ef4c86a3f8f7d514ee6493562297ca5fbd66d5de1084e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.6.0
|
4
|
+
* Added `papa hotfix deploy`
|
5
|
+
* Edited `papa integration start` to only start a new branch and not deploy to an environment.
|
6
|
+
* Added `papa integration add` and `papa integration deploy`
|
7
|
+
* Edited tasks so that they only run `git fetch` once
|
8
|
+
|
3
9
|
## 0.5.0
|
4
10
|
* Deprecated `papa deploy`. Deployment will be triggered during `papa integration start`.
|
5
11
|
* Simplified README.md and moved detailed command information into USAGE.md
|
data/README.md
CHANGED
@@ -77,6 +77,12 @@ If you want to use vi to specify the bugfix branches:
|
|
77
77
|
$ papa hotfix add -v 17.12.0
|
78
78
|
```
|
79
79
|
|
80
|
+
#### Deploying a hotfix branch to a hotfix environment
|
81
|
+
|
82
|
+
```
|
83
|
+
$ papa hotfix deploy -v 17.12.0
|
84
|
+
```
|
85
|
+
|
80
86
|
#### Finishing a hotfix branch
|
81
87
|
|
82
88
|
```
|
@@ -85,16 +91,30 @@ $ papa release hotfix -v 17.12.0
|
|
85
91
|
|
86
92
|
### `papa integration`
|
87
93
|
|
88
|
-
#### Starting
|
94
|
+
#### Starting an integration branch
|
95
|
+
|
96
|
+
```
|
97
|
+
$ papa integration start -f develop
|
98
|
+
```
|
99
|
+
|
100
|
+
#### Adding branches to an integration branch
|
101
|
+
|
102
|
+
If you want to specify the feature branches using `-b`:
|
103
|
+
|
104
|
+
```
|
105
|
+
$ papa integration add -v 17.12.0 -b feature/1 feature/2 feature/3
|
106
|
+
```
|
107
|
+
|
108
|
+
If you want to use vi to specify the feature branches:
|
89
109
|
|
90
110
|
```
|
91
|
-
$ papa integration
|
111
|
+
$ papa integration add -v 17.12.0
|
92
112
|
```
|
93
113
|
|
94
|
-
|
114
|
+
#### Deploying an integration branch to an integration environment
|
95
115
|
|
96
116
|
```
|
97
|
-
$ papa integration
|
117
|
+
$ papa integration deploy -v 17.12.7.18.20.30
|
98
118
|
```
|
99
119
|
|
100
120
|
### `papa sandbox`
|
data/USAGE.md
CHANGED
@@ -72,7 +72,7 @@ This will create a new hotfix branch based on the current `master` branch. The h
|
|
72
72
|
$ papa hotfix start -v, --version=VERSION
|
73
73
|
```
|
74
74
|
|
75
|
-
|
75
|
+
#### Sample Usage:
|
76
76
|
|
77
77
|
```
|
78
78
|
$ papa hotfix start -v 17.12.0
|
@@ -88,7 +88,7 @@ $ papa hotfix add -v, --version=VERSION [-b, --bugfix-branches=one two three]
|
|
88
88
|
|
89
89
|
If `--bugfix-branches` is not specified, it will prompt a vi session where you can enter the branch names separated by line breaks.
|
90
90
|
|
91
|
-
|
91
|
+
#### Sample Usage:
|
92
92
|
|
93
93
|
If you want to specify the bugfix branches using `--bugfix-branches`:
|
94
94
|
|
@@ -102,6 +102,20 @@ If you want to use vi to specify the bugfix branches:
|
|
102
102
|
$ papa hotfix add -v 17.12.0
|
103
103
|
```
|
104
104
|
|
105
|
+
### Deploying a hotfix branch to a hotfix environment
|
106
|
+
|
107
|
+
This will deploy the specified hotfix branch to a hotfix environment.
|
108
|
+
|
109
|
+
```
|
110
|
+
$ papa hotfix deploy -v, --version=VERSION
|
111
|
+
```
|
112
|
+
|
113
|
+
#### Sample Usage:
|
114
|
+
|
115
|
+
```
|
116
|
+
$ papa hotfix deploy -v 17.12.0
|
117
|
+
```
|
118
|
+
|
105
119
|
### Finishing a hotfix branch
|
106
120
|
|
107
121
|
The finished hotfix branch will be merged to `master` and `develop`. The updated `master` and `develop` branches will be pushed to origin.
|
@@ -118,24 +132,56 @@ $ papa release hotfix -v 17.12.0
|
|
118
132
|
|
119
133
|
## `papa integration`
|
120
134
|
|
121
|
-
|
135
|
+
#### Starting an integration branch
|
122
136
|
|
123
|
-
This will create a new integration branch based on the specified base branch.
|
137
|
+
This will create a new integration branch based on the specified base branch.
|
124
138
|
|
125
139
|
```
|
126
|
-
$ papa integration start -
|
140
|
+
$ papa integration start -f, --base-branch=BASE_BRANCH
|
127
141
|
```
|
128
142
|
|
129
143
|
#### Sample Usage:
|
130
144
|
|
131
145
|
```
|
132
|
-
$ papa integration start -
|
146
|
+
$ papa integration start -f feature/dunder-mifflin-this-is-pam
|
133
147
|
```
|
134
148
|
|
135
|
-
|
149
|
+
### Adding branches to an integration branch
|
150
|
+
|
151
|
+
This will rebase all branches from the integration branch (but will not push them to origin unlike hotfix and release!) and then subsequently merge the updated bugfix branch into the integration branch. The updated integration branch will be pushed to origin.
|
152
|
+
|
153
|
+
```
|
154
|
+
$ papa integration add -v, --version=VERSION [-b, --branches=one two three]
|
155
|
+
```
|
156
|
+
|
157
|
+
If `--branches` is not specified, it will prompt a vi session where you can enter the branch names separated by line breaks.
|
158
|
+
|
159
|
+
#### Sample Usage:
|
160
|
+
|
161
|
+
If you want to specify the feature branches using `-b`:
|
162
|
+
|
163
|
+
```
|
164
|
+
$ papa integration add -v 17.12.0 -b feature/1 feature/2 feature/3
|
165
|
+
```
|
166
|
+
|
167
|
+
If you want to use vi to specify the feature branches:
|
168
|
+
|
169
|
+
```
|
170
|
+
$ papa integration add -v 17.12.0
|
171
|
+
```
|
172
|
+
|
173
|
+
### Deploying an integration branch to an integration environment
|
174
|
+
|
175
|
+
This will deploy the specified integration branch to an integration environment.
|
176
|
+
|
177
|
+
```
|
178
|
+
$ papa integration deploy -v, --version=VERSION
|
179
|
+
```
|
180
|
+
|
181
|
+
#### Sample Usage:
|
136
182
|
|
137
183
|
```
|
138
|
-
$ papa integration
|
184
|
+
$ papa integration deploy -v 17.12.7.18.20.30
|
139
185
|
```
|
140
186
|
|
141
187
|
## `papa sandbox`
|
data/lib/papa/cli/hotfix.rb
CHANGED
@@ -7,7 +7,7 @@ module Papa
|
|
7
7
|
version = options[:version]
|
8
8
|
|
9
9
|
require 'papa/task/hotfix/start'
|
10
|
-
Task::Hotfix::Start.new(version
|
10
|
+
Task::Hotfix::Start.new(version).run
|
11
11
|
end
|
12
12
|
|
13
13
|
desc 'add', 'Add bugfix branches to a hotfix branch'
|
@@ -18,7 +18,15 @@ module Papa
|
|
18
18
|
bugfix_branches = options[:bugfix_branches] || []
|
19
19
|
|
20
20
|
require 'papa/task/hotfix/add'
|
21
|
-
Task::Hotfix::Add.new(version
|
21
|
+
Task::Hotfix::Add.new(version, bugfix_branches).run
|
22
|
+
end
|
23
|
+
|
24
|
+
desc 'deploy', 'Deploy the hotfix branch to hotfix.indinerocorp.com'
|
25
|
+
option :version, aliases: '-v', required: true
|
26
|
+
def deploy
|
27
|
+
version = options[:version]
|
28
|
+
require 'papa/task/hotfix/deploy'
|
29
|
+
Task::Hotfix::Deploy.new(version).run
|
22
30
|
end
|
23
31
|
|
24
32
|
desc 'finish', 'Merge the hotfix branch to the base branches'
|
@@ -29,7 +37,7 @@ module Papa
|
|
29
37
|
additional_branches = options[:additional_branches]
|
30
38
|
|
31
39
|
require 'papa/task/hotfix/finish'
|
32
|
-
Task::Hotfix::Finish.new(version
|
40
|
+
Task::Hotfix::Finish.new(version, additional_branches).run
|
33
41
|
end
|
34
42
|
end
|
35
43
|
end
|
data/lib/papa/cli/integration.rb
CHANGED
@@ -1,17 +1,35 @@
|
|
1
1
|
module Papa
|
2
2
|
module CLI
|
3
3
|
class Integration < Thor
|
4
|
-
desc 'start', 'Start an integration branch
|
5
|
-
option :base_branch, aliases: '-b', required: true
|
6
|
-
option :
|
7
|
-
option :skip_larga
|
4
|
+
desc 'start', 'Start an integration branch'
|
5
|
+
option :base_branch, aliases: ['-b', '-f'], required: true
|
6
|
+
option :override_branch_name
|
8
7
|
def start
|
9
8
|
base_branch = options[:base_branch]
|
10
|
-
|
11
|
-
skip_larga = options.has_key?('skip_larga')
|
9
|
+
task_options = { override_branch_name: options[:override_branch_name] }
|
12
10
|
|
13
11
|
require 'papa/task/integration/start'
|
14
|
-
Task::Integration::Start.new(base_branch
|
12
|
+
Task::Integration::Start.new(base_branch, task_options).run
|
13
|
+
end
|
14
|
+
|
15
|
+
desc 'add', 'Add branches to a integration branch'
|
16
|
+
option :version, aliases: '-v', required: true
|
17
|
+
option :branches, aliases: '-b', type: :array
|
18
|
+
def add
|
19
|
+
version = options[:version]
|
20
|
+
branches = options[:branches] || []
|
21
|
+
|
22
|
+
require 'papa/task/integration/add'
|
23
|
+
Task::Integration::Add.new(version, branches).run
|
24
|
+
end
|
25
|
+
|
26
|
+
desc 'deploy', 'Deploy the integration branch to integration.indinerocorp.com'
|
27
|
+
option :version, aliases: '-v', required: true
|
28
|
+
def deploy
|
29
|
+
version = options[:version]
|
30
|
+
|
31
|
+
require 'papa/task/integration/deploy'
|
32
|
+
Task::Integration::Deploy.new(version).run
|
15
33
|
end
|
16
34
|
end
|
17
35
|
end
|
data/lib/papa/cli/release.rb
CHANGED
@@ -7,7 +7,7 @@ module Papa
|
|
7
7
|
version = options[:version]
|
8
8
|
|
9
9
|
require 'papa/task/release/start'
|
10
|
-
Task::Release::Start.new(version
|
10
|
+
Task::Release::Start.new(version).run
|
11
11
|
end
|
12
12
|
|
13
13
|
desc 'add', 'Add feature branches to a release branch'
|
@@ -18,7 +18,7 @@ module Papa
|
|
18
18
|
feature_branches = options[:feature_branches] || []
|
19
19
|
|
20
20
|
require 'papa/task/release/add'
|
21
|
-
Task::Release::Add.new(version
|
21
|
+
Task::Release::Add.new(version, feature_branches).run
|
22
22
|
end
|
23
23
|
|
24
24
|
desc 'finish', 'Merge the release branch to master and develop'
|
@@ -27,7 +27,7 @@ module Papa
|
|
27
27
|
version = options[:version]
|
28
28
|
|
29
29
|
require 'papa/task/release/finish'
|
30
|
-
Task::Release::Finish.new(version
|
30
|
+
Task::Release::Finish.new(version).run
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
data/lib/papa/task/common/add.rb
CHANGED
@@ -27,18 +27,7 @@ module Papa
|
|
27
27
|
|
28
28
|
@branches.each_with_index do |branch, index|
|
29
29
|
Helper::Output.stdout "Adding branch #{branch.bold} (#{index + 1} of #{@branches.count})..."
|
30
|
-
|
31
|
-
Command::Git::Fetch.new('origin'),
|
32
|
-
Command::Git::Checkout.new(@build_branch),
|
33
|
-
Command::Git::Checkout.new(branch),
|
34
|
-
Command::Git::ResetHard.new('origin', branch),
|
35
|
-
Command::Git::Rebase.new(@build_branch),
|
36
|
-
Command::Git::PushForce.new('origin', branch),
|
37
|
-
Command::Git::Checkout.new(@build_branch),
|
38
|
-
Command::Git::Merge.new(branch),
|
39
|
-
Command::Git::Push.new('origin', @build_branch)
|
40
|
-
]
|
41
|
-
runner = Runner.new(queue)
|
30
|
+
runner = Runner.new(queue(branch))
|
42
31
|
|
43
32
|
if runner.run
|
44
33
|
@success_branches << branch
|
@@ -52,13 +41,9 @@ module Papa
|
|
52
41
|
end
|
53
42
|
end
|
54
43
|
|
55
|
-
|
56
|
-
failure_message
|
44
|
+
success_and_failure_messages
|
57
45
|
|
58
|
-
if success
|
59
|
-
success_cleanup
|
60
|
-
else
|
61
|
-
failure_cleanup
|
46
|
+
if !success
|
62
47
|
exit 1
|
63
48
|
end
|
64
49
|
end
|
@@ -76,6 +61,20 @@ module Papa
|
|
76
61
|
exit 1
|
77
62
|
end
|
78
63
|
|
64
|
+
def queue(branch)
|
65
|
+
[
|
66
|
+
Command::Git::Checkout.new(@build_branch),
|
67
|
+
Command::Git::Checkout.new(branch),
|
68
|
+
Command::Git::ResetHard.new('origin', branch),
|
69
|
+
Command::Git::Rebase.new(@build_branch),
|
70
|
+
Command::Git::PushForce.new('origin', branch),
|
71
|
+
Command::Git::Checkout.new(@build_branch),
|
72
|
+
Command::Git::Merge.new(branch),
|
73
|
+
Command::Git::BranchDelete.new(branch),
|
74
|
+
Command::Git::Push.new('origin', @build_branch)
|
75
|
+
]
|
76
|
+
end
|
77
|
+
|
79
78
|
def check_if_branches_are_given
|
80
79
|
return unless @branches.empty?
|
81
80
|
require 'papa/helper/vi'
|
@@ -83,6 +82,11 @@ module Papa
|
|
83
82
|
@branches = vi_file_helper.run
|
84
83
|
end
|
85
84
|
|
85
|
+
def success_and_failure_messages
|
86
|
+
success_message
|
87
|
+
failure_message
|
88
|
+
end
|
89
|
+
|
86
90
|
def success_message
|
87
91
|
return if @success_branches.empty?
|
88
92
|
Helper::Output.success "Successfully added these branches to #{@build_branch}:\n"
|
@@ -112,14 +116,6 @@ module Papa
|
|
112
116
|
|
113
117
|
Helper::Output.failure_info info
|
114
118
|
end
|
115
|
-
|
116
|
-
def success_cleanup
|
117
|
-
queue = @branches.map { |branch| Command::Git::BranchDelete.new(branch) }
|
118
|
-
Runner.new(queue).run
|
119
|
-
end
|
120
|
-
|
121
|
-
def failure_cleanup
|
122
|
-
end
|
123
119
|
end
|
124
120
|
end
|
125
121
|
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'papa/helper/output'
|
2
|
+
require 'papa/command/larga/type'
|
3
|
+
require 'papa/command/larga/deploy'
|
4
|
+
require 'papa/runner'
|
5
|
+
|
6
|
+
module Papa
|
7
|
+
module Task
|
8
|
+
module Common
|
9
|
+
class Deploy
|
10
|
+
def run
|
11
|
+
@build_branch ||= "#{@build_type}/#{@version}"
|
12
|
+
|
13
|
+
runner = Runner.new(queue)
|
14
|
+
|
15
|
+
if runner.run
|
16
|
+
success_message
|
17
|
+
else
|
18
|
+
failure_message
|
19
|
+
exit 1
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def queue
|
26
|
+
[
|
27
|
+
Command::Larga::Type.new,
|
28
|
+
Command::Larga::Deploy.new(deploy_options)
|
29
|
+
]
|
30
|
+
end
|
31
|
+
|
32
|
+
def deploy_options
|
33
|
+
{
|
34
|
+
branch: @build_branch,
|
35
|
+
hostname: @hostname
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
def success_message
|
40
|
+
Helper::Output.success 'Successfully deployed larga instance.'
|
41
|
+
info = ''
|
42
|
+
info << " Branch: #{@build_branch}\n"
|
43
|
+
info << " URL: https://#{@hostname}.indinerocorp.com\n"
|
44
|
+
Helper::Output.success_info info
|
45
|
+
end
|
46
|
+
|
47
|
+
def failure_message
|
48
|
+
Helper::Output.failure 'There was a problem deploying larga instance.'
|
49
|
+
info = ''
|
50
|
+
info << " Branch: #{@build_branch}\n"
|
51
|
+
Helper::Output.failure_info info
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -14,22 +14,13 @@ module Papa
|
|
14
14
|
def run
|
15
15
|
@build_branch ||= "#{@build_type}/#{@version}"
|
16
16
|
|
17
|
+
check_if_build_branch_exists
|
18
|
+
|
17
19
|
success = true
|
18
20
|
@success_branches = []
|
19
21
|
|
20
22
|
@base_branches.each do |branch|
|
21
|
-
|
22
|
-
Command::Git::Fetch.new('origin'),
|
23
|
-
Command::Git::Checkout.new(@build_branch),
|
24
|
-
Command::Git::Checkout.new(branch),
|
25
|
-
Command::Git::Merge.new(@build_branch),
|
26
|
-
Command::Git::Push.new('origin', branch)
|
27
|
-
]
|
28
|
-
if @tag_name && branch == 'master'
|
29
|
-
queue << Command::Git::Tag.new(@tag_name)
|
30
|
-
queue << Command::Git::TagPush.new('origin', @tag_name)
|
31
|
-
end
|
32
|
-
runner = Runner.new(queue)
|
23
|
+
runner = Runner.new(queue(branch))
|
33
24
|
|
34
25
|
if runner.run
|
35
26
|
@success_branches << branch
|
@@ -38,9 +29,9 @@ module Papa
|
|
38
29
|
end
|
39
30
|
end
|
40
31
|
|
41
|
-
|
42
|
-
|
43
|
-
|
32
|
+
if success
|
33
|
+
success_message
|
34
|
+
else
|
44
35
|
failure_message
|
45
36
|
exit 1
|
46
37
|
end
|
@@ -48,6 +39,31 @@ module Papa
|
|
48
39
|
|
49
40
|
private
|
50
41
|
|
42
|
+
def check_if_build_branch_exists
|
43
|
+
queue = [
|
44
|
+
Command::Git::Fetch.new('origin'),
|
45
|
+
Command::Git::Checkout.new(@build_branch)
|
46
|
+
]
|
47
|
+
runner = Runner.new(queue)
|
48
|
+
return if runner.run
|
49
|
+
Helper::Output.failure 'Build branch does not exist.'
|
50
|
+
exit 1
|
51
|
+
end
|
52
|
+
|
53
|
+
def queue(branch)
|
54
|
+
queue = [
|
55
|
+
Command::Git::Checkout.new(@build_branch),
|
56
|
+
Command::Git::Checkout.new(branch),
|
57
|
+
Command::Git::Merge.new(@build_branch),
|
58
|
+
Command::Git::Push.new('origin', branch)
|
59
|
+
]
|
60
|
+
if @tag_name && branch == 'master'
|
61
|
+
queue << Command::Git::Tag.new(@tag_name)
|
62
|
+
queue << Command::Git::TagPush.new('origin', @tag_name)
|
63
|
+
end
|
64
|
+
queue
|
65
|
+
end
|
66
|
+
|
51
67
|
def success_message
|
52
68
|
Helper::Output.success "Successfully merged #{@build_branch} to these branches:\n"
|
53
69
|
info = ''
|
@@ -12,13 +12,6 @@ module Papa
|
|
12
12
|
def run
|
13
13
|
@build_branch ||= "#{@build_type}/#{@version}"
|
14
14
|
|
15
|
-
queue = [
|
16
|
-
Command::Git::Fetch.new('origin'),
|
17
|
-
Command::Git::Checkout.new(@base_branch),
|
18
|
-
Command::Git::Branch.new(@build_branch),
|
19
|
-
Command::Git::Checkout.new(@build_branch),
|
20
|
-
Command::Git::Push.new('origin', @build_branch)
|
21
|
-
]
|
22
15
|
runner = Runner.new(queue)
|
23
16
|
|
24
17
|
if runner.run
|
@@ -31,6 +24,16 @@ module Papa
|
|
31
24
|
|
32
25
|
private
|
33
26
|
|
27
|
+
def queue
|
28
|
+
[
|
29
|
+
Command::Git::Fetch.new('origin'),
|
30
|
+
Command::Git::Checkout.new(@base_branch),
|
31
|
+
Command::Git::Branch.new(@build_branch),
|
32
|
+
Command::Git::Checkout.new(@build_branch),
|
33
|
+
Command::Git::Push.new('origin', @build_branch)
|
34
|
+
]
|
35
|
+
end
|
36
|
+
|
34
37
|
def success_message
|
35
38
|
Helper::Output.success "Successfully started new #{@build_type} branch #{@build_branch}"
|
36
39
|
end
|
data/lib/papa/task/hotfix/add.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'papa/task/common/add'
|
2
|
+
|
3
|
+
module Papa
|
4
|
+
module Task
|
5
|
+
module Integration
|
6
|
+
class Add < Common::Add
|
7
|
+
def initialize(version, branches)
|
8
|
+
@build_type = 'integration'
|
9
|
+
@version = version
|
10
|
+
@branches = branches
|
11
|
+
end
|
12
|
+
|
13
|
+
def queue(branch)
|
14
|
+
[
|
15
|
+
Command::Git::Fetch.new('origin'),
|
16
|
+
Command::Git::Checkout.new(@build_branch),
|
17
|
+
Command::Git::Checkout.new(branch),
|
18
|
+
Command::Git::ResetHard.new('origin', branch),
|
19
|
+
Command::Git::Rebase.new(@build_branch),
|
20
|
+
Command::Git::Checkout.new(@build_branch),
|
21
|
+
Command::Git::Merge.new(branch),
|
22
|
+
Command::Git::BranchDelete.new(branch),
|
23
|
+
Command::Git::Push.new('origin', @build_branch)
|
24
|
+
]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'papa/task/common/deploy'
|
2
|
+
|
3
|
+
module Papa
|
4
|
+
module Task
|
5
|
+
module Integration
|
6
|
+
class Deploy < Common::Deploy
|
7
|
+
def initialize(version)
|
8
|
+
@build_type = 'integration'
|
9
|
+
@version = version
|
10
|
+
@hostname = 'integration'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -7,47 +7,16 @@ module Papa
|
|
7
7
|
module Task
|
8
8
|
module Integration
|
9
9
|
class Start < Common::Start
|
10
|
-
def initialize(base_branch
|
10
|
+
def initialize(base_branch, options = {})
|
11
11
|
@build_type = 'integration'
|
12
12
|
@base_branch = base_branch
|
13
|
-
@
|
14
|
-
@skip_larga = skip_larga
|
15
|
-
@build_branch = generate_integration_branch_name
|
16
|
-
end
|
17
|
-
|
18
|
-
def run
|
19
|
-
super
|
20
|
-
return if @skip_larga
|
21
|
-
deploy_options = {
|
22
|
-
branch: @build_branch,
|
23
|
-
hostname: @hostname
|
24
|
-
}
|
25
|
-
queue = [
|
26
|
-
Command::Larga::Type.new,
|
27
|
-
Command::Larga::Deploy.new(deploy_options)
|
28
|
-
]
|
29
|
-
runner = Runner.new(queue)
|
30
|
-
|
31
|
-
if runner.run
|
32
|
-
success_message_integration
|
33
|
-
else
|
34
|
-
failure_message_integration
|
35
|
-
exit 1
|
36
|
-
end
|
13
|
+
@build_branch = "#{@build_type}/#{options[:override_branch_name] || generate_integration_timestamp}"
|
37
14
|
end
|
38
15
|
|
39
16
|
private
|
40
17
|
|
41
|
-
def
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
def success_message_integration
|
46
|
-
Helper::Output.success 'Successfully deployed larga instance.'
|
47
|
-
end
|
48
|
-
|
49
|
-
def failure_message_integration
|
50
|
-
Helper::Output.failure 'There was a problem deploying larga instance.'
|
18
|
+
def generate_integration_timestamp
|
19
|
+
DateTime.now.strftime('%y.%m.%d.%H.%M.%S').gsub('.0', '.')
|
51
20
|
end
|
52
21
|
end
|
53
22
|
end
|
data/lib/papa/version.rb
CHANGED
data/papa.gemspec
CHANGED
@@ -28,7 +28,4 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency "bundler", "~> 1.15"
|
29
29
|
spec.add_development_dependency "rake", "~> 10.0"
|
30
30
|
spec.add_development_dependency "rspec", "~> 3.0"
|
31
|
-
|
32
|
-
spec.add_development_dependency "pry"
|
33
|
-
spec.add_development_dependency "pry-byebug"
|
34
31
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: papa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- boggs
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -66,34 +66,6 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: pry
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: pry-byebug
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
69
|
description: Helper gem for inDinero's git workflow
|
98
70
|
email:
|
99
71
|
- hello@boggs.xyz
|
@@ -141,11 +113,15 @@ files:
|
|
141
113
|
- lib/papa/runner.rb
|
142
114
|
- lib/papa/string.rb
|
143
115
|
- lib/papa/task/common/add.rb
|
116
|
+
- lib/papa/task/common/deploy.rb
|
144
117
|
- lib/papa/task/common/finish.rb
|
145
118
|
- lib/papa/task/common/start.rb
|
146
119
|
- lib/papa/task/hotfix/add.rb
|
120
|
+
- lib/papa/task/hotfix/deploy.rb
|
147
121
|
- lib/papa/task/hotfix/finish.rb
|
148
122
|
- lib/papa/task/hotfix/start.rb
|
123
|
+
- lib/papa/task/integration/add.rb
|
124
|
+
- lib/papa/task/integration/deploy.rb
|
149
125
|
- lib/papa/task/integration/start.rb
|
150
126
|
- lib/papa/task/release/add.rb
|
151
127
|
- lib/papa/task/release/finish.rb
|