papa 0.4.1 → 0.5.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 +5 -0
- data/README.md +8 -85
- data/USAGE.md +149 -0
- data/lib/papa/cli/integration.rb +6 -2
- data/lib/papa/cli/main.rb +0 -12
- data/lib/papa/command/larga/deploy.rb +2 -2
- data/lib/papa/task/integration/start.rb +35 -2
- data/lib/papa/version.rb +1 -1
- data/papa.gemspec +1 -0
- metadata +3 -3
- data/lib/papa/task/deploy.rb +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67520d68cdc9b5dc51e12158774c9a56a2fbeaa4
|
4
|
+
data.tar.gz: c725d388086c5cb945f46aac6f1bbdb8ff8e3692
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 425913e88b97ebefc37f86f58f85d1d0770f2869395367dfa5e9e8eb31a79255f1fcf1a2e65f5b7147cf5bd4bab9e110037605e9bf94b27940764de0cf96ff98
|
7
|
+
data.tar.gz: ff3452e93ff53ff102e1627da9dcbaaf423a1571841d2c6d064ebd36758c0731e3f5a149c318ec0e834fc7fa3e692c26d4a89e5139d259b4bf4de0c4b9572848
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.5.0
|
4
|
+
* Deprecated `papa deploy`. Deployment will be triggered during `papa integration start`.
|
5
|
+
* Simplified README.md and moved detailed command information into USAGE.md
|
6
|
+
* Changed integration branch naming scheme to include seconds in the branch name.
|
7
|
+
|
3
8
|
## 0.4.1
|
4
9
|
* Check whether build branch exists before prompting vi
|
5
10
|
* Add preceeding newlines in vi prompt
|
data/README.md
CHANGED
@@ -22,37 +22,21 @@ $ gem install papa
|
|
22
22
|
|
23
23
|
That's it, you're ready to go!
|
24
24
|
|
25
|
-
##
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
Detailed information about what these commands do can be found in [USAGE.md](https://github.com/b-ggs/papa/blob/master/USAGE.md).
|
26
28
|
|
27
29
|
### `papa release`
|
28
30
|
|
29
31
|
#### Starting a release branch
|
30
32
|
|
31
|
-
This will create a new release branch based on the current `develop` branch. The release branch will be pushed to origin.
|
32
|
-
|
33
|
-
```
|
34
|
-
$ papa release start -v, --version=VERSION
|
35
|
-
```
|
36
|
-
|
37
|
-
###### Sample Usage:
|
38
|
-
|
39
33
|
```
|
40
34
|
$ papa release start -v 17.12.0
|
41
35
|
```
|
42
36
|
|
43
37
|
#### Adding feature branches to a release branch
|
44
38
|
|
45
|
-
|
46
|
-
|
47
|
-
```
|
48
|
-
$ papa release add -v, --version=VERSION [-b, --feature-branches=one two three]
|
49
|
-
```
|
50
|
-
|
51
|
-
If `--feature-branches` is not specified, it will prompt a vi session where you can enter the branch names separated by line breaks.
|
52
|
-
|
53
|
-
##### Sample Usage:
|
54
|
-
|
55
|
-
If you want to specify the feature branches using `--feature-branches`:
|
39
|
+
If you want to specify the feature branches using `-b`:
|
56
40
|
|
57
41
|
```
|
58
42
|
$ papa release add -v 17.12.0 -b feature/1 feature/2 feature/3
|
@@ -66,14 +50,6 @@ $ papa release add -v 17.12.0
|
|
66
50
|
|
67
51
|
#### Finishing a release branch
|
68
52
|
|
69
|
-
The finished release branch will be merged to `master` and `develop`. The updated `master` and `develop` branches will be pushed to origin.
|
70
|
-
|
71
|
-
```
|
72
|
-
$ papa release finish -v, --version=VERSION
|
73
|
-
```
|
74
|
-
|
75
|
-
##### Sample Usage:
|
76
|
-
|
77
53
|
```
|
78
54
|
$ papa release finish -v 17.12.0
|
79
55
|
```
|
@@ -82,31 +58,14 @@ $ papa release finish -v 17.12.0
|
|
82
58
|
|
83
59
|
#### Starting a hotfix branch
|
84
60
|
|
85
|
-
This will create a new hotfix branch based on the current `master` branch. The hotfix branch will be pushed to origin.
|
86
|
-
|
87
|
-
```
|
88
|
-
$ papa hotfix start -v, --version=VERSION
|
89
|
-
```
|
90
|
-
|
91
|
-
###### Sample Usage:
|
92
|
-
|
93
61
|
```
|
94
62
|
$ papa hotfix start -v 17.12.0
|
95
63
|
```
|
96
64
|
|
97
65
|
#### Adding bugfix branches to a hotfix branch
|
98
66
|
|
99
|
-
This will rebase all new bugfix branches from the hotfix branch and then subsequently merge the updated bugfix branch into the release branch. The updated release branch will be pushed to origin.
|
100
|
-
|
101
|
-
```
|
102
|
-
$ papa hotfix add -v, --version=VERSION [-b, --bugfix-branches=one two three]
|
103
|
-
```
|
104
67
|
|
105
|
-
If
|
106
|
-
|
107
|
-
##### Sample Usage:
|
108
|
-
|
109
|
-
If you want to specify the bugfix branches using `--bugfix-branches`:
|
68
|
+
If you want to specify the bugfix branches using `-b`:
|
110
69
|
|
111
70
|
```
|
112
71
|
$ papa hotfix add -v 17.12.0 -b bugfix/1 bugfix/2 bugfix/3
|
@@ -120,62 +79,26 @@ $ papa hotfix add -v 17.12.0
|
|
120
79
|
|
121
80
|
#### Finishing a hotfix branch
|
122
81
|
|
123
|
-
The finished hotfix branch will be merged to `master` and `develop`. The updated `master` and `develop` branches will be pushed to origin.
|
124
|
-
|
125
|
-
```
|
126
|
-
$ papa release hotfix -v, --version=VERSION
|
127
|
-
```
|
128
|
-
|
129
|
-
##### Sample Usage:
|
130
|
-
|
131
82
|
```
|
132
83
|
$ papa release hotfix -v 17.12.0
|
133
84
|
```
|
134
85
|
|
135
86
|
### `papa integration`
|
136
87
|
|
137
|
-
#### Starting an integration branch
|
138
|
-
|
139
|
-
This will create a new integration branch based on the specified base branch. The integration branch will be pushed to origin.
|
140
|
-
|
141
|
-
```
|
142
|
-
$ papa integration start -b, --base-branch=BASE_BRANCH
|
143
|
-
```
|
144
|
-
|
145
|
-
##### Sample Usage:
|
88
|
+
#### Starting and deploying an integration branch
|
146
89
|
|
147
90
|
```
|
148
|
-
$ papa integration start -b
|
149
|
-
```
|
150
|
-
|
151
|
-
### `papa deploy`
|
152
|
-
|
153
|
-
#### Deploying a new environment
|
154
|
-
|
155
|
-
This will create a new environment using `larga`.
|
156
|
-
|
157
|
-
```
|
158
|
-
$ papa deploy -b, --branch=BRANCH [-h, --hostname=HOSTNAME]
|
159
|
-
```
|
160
|
-
|
161
|
-
##### Sample Usage:
|
162
|
-
|
163
|
-
```
|
164
|
-
$ papa deploy -b feature/dunder-mifflin-this-is-pam
|
91
|
+
$ papa integration start -b feature/dunder-mifflin-this-is-pam
|
165
92
|
```
|
166
93
|
|
167
94
|
If you want to specify a hostname for this environment:
|
168
95
|
|
169
96
|
```
|
170
|
-
$ papa
|
97
|
+
$ papa integration start -b feature/we-were-on-a-break -h ross-and-rachel
|
171
98
|
```
|
172
99
|
|
173
100
|
### `papa sandbox`
|
174
101
|
|
175
|
-
#### Generating a new sandbox
|
176
|
-
|
177
|
-
This will generate a git repository that you can use to test out `papa`.
|
178
|
-
|
179
102
|
```
|
180
103
|
$ papa sandbox generate
|
181
104
|
```
|
data/USAGE.md
ADDED
@@ -0,0 +1,149 @@
|
|
1
|
+
# Usage
|
2
|
+
|
3
|
+
## Contents
|
4
|
+
|
5
|
+
* [papa release](#papa-release)
|
6
|
+
* [papa hotfix](#papa-hotfix)
|
7
|
+
* [papa integration](#papa-integration)
|
8
|
+
* [papa deploy](#papa-deploy)
|
9
|
+
* [papa sandbox](#papa-sandbox)
|
10
|
+
|
11
|
+
## `papa release`
|
12
|
+
|
13
|
+
### Starting a release branch
|
14
|
+
|
15
|
+
This will create a new release branch based on the current `develop` branch. The release branch will be pushed to origin.
|
16
|
+
|
17
|
+
```
|
18
|
+
$ papa release start -v, --version=VERSION
|
19
|
+
```
|
20
|
+
|
21
|
+
#### Sample Usage:
|
22
|
+
|
23
|
+
```
|
24
|
+
$ papa release start -v 17.12.0
|
25
|
+
```
|
26
|
+
|
27
|
+
### Adding feature branches to a release branch
|
28
|
+
|
29
|
+
This will rebase all new feature branches from the release branch and then subsequently merge the updated feature branch into the release branch. The updated release branch will be pushed to origin.
|
30
|
+
|
31
|
+
```
|
32
|
+
$ papa release add -v, --version=VERSION [-b, --feature-branches=one two three]
|
33
|
+
```
|
34
|
+
|
35
|
+
If `--feature-branches` is not specified, it will prompt a vi session where you can enter the branch names separated by line breaks.
|
36
|
+
|
37
|
+
#### Sample Usage:
|
38
|
+
|
39
|
+
If you want to specify the feature branches using `--feature-branches`:
|
40
|
+
|
41
|
+
```
|
42
|
+
$ papa release add -v 17.12.0 -b feature/1 feature/2 feature/3
|
43
|
+
```
|
44
|
+
|
45
|
+
If you want to use vi to specify the feature branches:
|
46
|
+
|
47
|
+
```
|
48
|
+
$ papa release add -v 17.12.0
|
49
|
+
```
|
50
|
+
|
51
|
+
### Finishing a release branch
|
52
|
+
|
53
|
+
The finished release branch will be merged to `master` and `develop`. The updated `master` and `develop` branches will be pushed to origin.
|
54
|
+
|
55
|
+
```
|
56
|
+
$ papa release finish -v, --version=VERSION
|
57
|
+
```
|
58
|
+
|
59
|
+
#### Sample Usage:
|
60
|
+
|
61
|
+
```
|
62
|
+
$ papa release finish -v 17.12.0
|
63
|
+
```
|
64
|
+
|
65
|
+
## `papa hotfix`
|
66
|
+
|
67
|
+
### Starting a hotfix branch
|
68
|
+
|
69
|
+
This will create a new hotfix branch based on the current `master` branch. The hotfix branch will be pushed to origin.
|
70
|
+
|
71
|
+
```
|
72
|
+
$ papa hotfix start -v, --version=VERSION
|
73
|
+
```
|
74
|
+
|
75
|
+
##### Sample Usage:
|
76
|
+
|
77
|
+
```
|
78
|
+
$ papa hotfix start -v 17.12.0
|
79
|
+
```
|
80
|
+
|
81
|
+
### Adding bugfix branches to a hotfix branch
|
82
|
+
|
83
|
+
This will rebase all new bugfix branches from the hotfix branch and then subsequently merge the updated bugfix branch into the release branch. The updated release branch will be pushed to origin.
|
84
|
+
|
85
|
+
```
|
86
|
+
$ papa hotfix add -v, --version=VERSION [-b, --bugfix-branches=one two three]
|
87
|
+
```
|
88
|
+
|
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
|
+
|
91
|
+
##### Sample Usage:
|
92
|
+
|
93
|
+
If you want to specify the bugfix branches using `--bugfix-branches`:
|
94
|
+
|
95
|
+
```
|
96
|
+
$ papa hotfix add -v 17.12.0 -b bugfix/1 bugfix/2 bugfix/3
|
97
|
+
```
|
98
|
+
|
99
|
+
If you want to use vi to specify the bugfix branches:
|
100
|
+
|
101
|
+
```
|
102
|
+
$ papa hotfix add -v 17.12.0
|
103
|
+
```
|
104
|
+
|
105
|
+
### Finishing a hotfix branch
|
106
|
+
|
107
|
+
The finished hotfix branch will be merged to `master` and `develop`. The updated `master` and `develop` branches will be pushed to origin.
|
108
|
+
|
109
|
+
```
|
110
|
+
$ papa release hotfix -v, --version=VERSION
|
111
|
+
```
|
112
|
+
|
113
|
+
#### Sample Usage:
|
114
|
+
|
115
|
+
```
|
116
|
+
$ papa release hotfix -v 17.12.0
|
117
|
+
```
|
118
|
+
|
119
|
+
## `papa integration`
|
120
|
+
|
121
|
+
### Starting and deploying an integration branch
|
122
|
+
|
123
|
+
This will create a new integration branch based on the specified base branch. The integration branch will be pushed to origin. The new branch will then be deployed to Larga.
|
124
|
+
|
125
|
+
```
|
126
|
+
$ papa integration start -b, --base-branch=BASE_BRANCH [-h, --hostname=HOSTNAME]
|
127
|
+
```
|
128
|
+
|
129
|
+
#### Sample Usage:
|
130
|
+
|
131
|
+
```
|
132
|
+
$ papa integration start -b feature/dunder-mifflin-this-is-pam
|
133
|
+
```
|
134
|
+
|
135
|
+
If you want to specify a hostname for this environment:
|
136
|
+
|
137
|
+
```
|
138
|
+
$ papa integration start -b feature/we-were-on-a-break -h ross-and-rachel
|
139
|
+
```
|
140
|
+
|
141
|
+
## `papa sandbox`
|
142
|
+
|
143
|
+
### Generating a new sandbox
|
144
|
+
|
145
|
+
This will generate a git repository that you can use to test out `papa`.
|
146
|
+
|
147
|
+
```
|
148
|
+
$ papa sandbox generate
|
149
|
+
```
|
data/lib/papa/cli/integration.rb
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
module Papa
|
2
2
|
module CLI
|
3
3
|
class Integration < Thor
|
4
|
-
desc 'start', 'Start an integration branch'
|
4
|
+
desc 'start', 'Start an integration branch and deploy it to Larga'
|
5
5
|
option :base_branch, aliases: '-b', required: true
|
6
|
+
option :hostname, aliases: '-h'
|
7
|
+
option :skip_larga
|
6
8
|
def start
|
7
9
|
base_branch = options[:base_branch]
|
10
|
+
hostname = options[:hostname]
|
11
|
+
skip_larga = options.has_key?('skip_larga')
|
8
12
|
|
9
13
|
require 'papa/task/integration/start'
|
10
|
-
Task::Integration::Start.new(base_branch: base_branch).run
|
14
|
+
Task::Integration::Start.new(base_branch: base_branch, hostname: hostname, skip_larga: skip_larga).run
|
11
15
|
end
|
12
16
|
end
|
13
17
|
end
|
data/lib/papa/cli/main.rb
CHANGED
@@ -15,18 +15,6 @@ module Papa
|
|
15
15
|
desc 'integration [COMMAND]', 'Perform actions on integration branches'
|
16
16
|
subcommand 'integration', CLI::Integration
|
17
17
|
|
18
|
-
desc 'deploy', 'Deploy a branch with larga'
|
19
|
-
option :branch, aliases: '-b', required: true
|
20
|
-
option :hostname, aliases: '-h'
|
21
|
-
def deploy
|
22
|
-
require 'papa/task/deploy'
|
23
|
-
|
24
|
-
branch = options[:branch]
|
25
|
-
hostname = options[:hostname]
|
26
|
-
|
27
|
-
Task::Deploy.new(branch: branch, hostname: hostname).run
|
28
|
-
end
|
29
|
-
|
30
18
|
desc 'sandbox [COMMAND]', 'Test out papa in a sandboxed git environment'
|
31
19
|
subcommand 'sandbox', CLI::Sandbox
|
32
20
|
end
|
@@ -17,7 +17,7 @@ module Papa
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def failed?
|
20
|
-
stdout.include?
|
20
|
+
stdout.include?('Cowardly refusing') || stdout.include?('Error')
|
21
21
|
end
|
22
22
|
|
23
23
|
def failure_message
|
@@ -46,7 +46,7 @@ module Papa
|
|
46
46
|
hostname = @options[:hostname]
|
47
47
|
|
48
48
|
options = []
|
49
|
-
options << '-action
|
49
|
+
options << '-action build'
|
50
50
|
options << "-branch #{branch}"
|
51
51
|
options << "-lifespan #{lifespan}"
|
52
52
|
options << "-protection #{protection}"
|
@@ -1,20 +1,53 @@
|
|
1
1
|
require 'papa/task/common/start'
|
2
|
+
require 'papa/command/larga/type'
|
3
|
+
require 'papa/command/larga/deploy'
|
2
4
|
require 'date'
|
3
5
|
|
4
6
|
module Papa
|
5
7
|
module Task
|
6
8
|
module Integration
|
7
9
|
class Start < Common::Start
|
8
|
-
def initialize(base_branch:)
|
10
|
+
def initialize(base_branch:, hostname:, skip_larga:)
|
9
11
|
@build_type = 'integration'
|
10
12
|
@base_branch = base_branch
|
13
|
+
@hostname = hostname
|
14
|
+
@skip_larga = skip_larga
|
11
15
|
@build_branch = generate_integration_branch_name
|
12
16
|
end
|
13
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
|
37
|
+
end
|
38
|
+
|
14
39
|
private
|
15
40
|
|
16
41
|
def generate_integration_branch_name
|
17
|
-
"integration/#{DateTime.now.strftime('%y.%m.%d.%H.%M').gsub('.0', '.')}"
|
42
|
+
"integration/#{DateTime.now.strftime('%y.%m.%d.%H.%M.%S').gsub('.0', '.')}"
|
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
51
|
end
|
19
52
|
end
|
20
53
|
end
|
data/lib/papa/version.rb
CHANGED
data/papa.gemspec
CHANGED
@@ -28,6 +28,7 @@ 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
|
+
|
31
32
|
spec.add_development_dependency "pry"
|
32
33
|
spec.add_development_dependency "pry-byebug"
|
33
34
|
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.5.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-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -110,6 +110,7 @@ files:
|
|
110
110
|
- LICENSE.txt
|
111
111
|
- README.md
|
112
112
|
- Rakefile
|
113
|
+
- USAGE.md
|
113
114
|
- exe/papa
|
114
115
|
- lib/papa.rb
|
115
116
|
- lib/papa/cli/hotfix.rb
|
@@ -142,7 +143,6 @@ files:
|
|
142
143
|
- lib/papa/task/common/add.rb
|
143
144
|
- lib/papa/task/common/finish.rb
|
144
145
|
- lib/papa/task/common/start.rb
|
145
|
-
- lib/papa/task/deploy.rb
|
146
146
|
- lib/papa/task/hotfix/add.rb
|
147
147
|
- lib/papa/task/hotfix/finish.rb
|
148
148
|
- lib/papa/task/hotfix/start.rb
|
data/lib/papa/task/deploy.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'papa/command/larga/type'
|
2
|
-
require 'papa/command/larga/deploy'
|
3
|
-
require 'papa/runner'
|
4
|
-
|
5
|
-
module Papa
|
6
|
-
module Task
|
7
|
-
class Deploy
|
8
|
-
def initialize(options = {})
|
9
|
-
@options = options
|
10
|
-
end
|
11
|
-
|
12
|
-
def run
|
13
|
-
queue = [
|
14
|
-
Command::Larga::Type.new,
|
15
|
-
Command::Larga::Deploy.new(@options)
|
16
|
-
]
|
17
|
-
runner = Runner.new(queue)
|
18
|
-
|
19
|
-
if runner.run
|
20
|
-
success_message
|
21
|
-
else
|
22
|
-
failure_message
|
23
|
-
exit 1
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
private
|
28
|
-
|
29
|
-
def success_message
|
30
|
-
Helper::Output.success 'Successfully deployed larga instance.'
|
31
|
-
end
|
32
|
-
|
33
|
-
def failure_message
|
34
|
-
Helper::Output.failure 'There was a problem deploying larga instance.'
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|