allegro_release 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +98 -5
- data/allegro_release.gemspec +2 -0
- data/lib/allegro_release.rb +30 -6
- data/lib/allegro_release/version.rb +1 -1
- metadata +31 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21cd14882704d7d59db9e50860adadb65c617268
|
4
|
+
data.tar.gz: 634e64b48221019aab86036997a29910cc68922f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1c730b3051c8a4094a4ae384472b4e4bb15cc67bf4cb94b0f958a0724f60f7a05cfe62628bc0dbdb5162de52c28210da668bd0b7784c9abc1d72033d78d30b7
|
7
|
+
data.tar.gz: 4fd502a9e25f6db3d808c9058335753ba156e8ec83535e6a61d34249d72c985db757ff54687fb8a585bfbb29f1ce5f8770df63f1e0c4c3de038b25615d7d7a4f
|
data/README.md
CHANGED
@@ -1,9 +1,102 @@
|
|
1
|
-
|
1
|
+
### `allegro_release` tool
|
2
2
|
|
3
|
-
|
3
|
+
`allegro_release` is a dedicated tool that helps in releasing a pod.
|
4
4
|
|
5
|
-
|
5
|
+
#### Prerequests
|
6
6
|
|
7
|
-
|
7
|
+
In order to properly use `allegro_release` you need to install [`atlassian-stash`](http://blogs.atlassian.com/2012/11/stash-pull-requests-from-the-command-line/) gem:
|
8
8
|
|
9
|
-
|
9
|
+
```sh
|
10
|
+
gem install atlassian-stash
|
11
|
+
```
|
12
|
+
|
13
|
+
After installation, run `stash configure` to configure Stash instance (you will have to run `stash configure` every time you change your password, which currently is once per month). The following prompts should appear:
|
14
|
+
|
15
|
+
```sh
|
16
|
+
Bitbucket Server Username: <your_username> (go to "View Profile" in upper-right corner of Stash)
|
17
|
+
Bitbucket Server Password (optional): <your_password>
|
18
|
+
Bitbucket Server URL: https://stash.allegrogroup.com/
|
19
|
+
Remote (optional): <leave_empty>
|
20
|
+
Create a git alias 'git create-pull-request'? n
|
21
|
+
```
|
22
|
+
|
23
|
+
#### Installation of `allegro_release`
|
24
|
+
|
25
|
+
Run:
|
26
|
+
|
27
|
+
```sh
|
28
|
+
gem install allegro_release
|
29
|
+
```
|
30
|
+
|
31
|
+
|
32
|
+
### Procedure flow
|
33
|
+
|
34
|
+
If you don't want to use `allegro_release` just follow the steps in **What it does?** sections.
|
35
|
+
|
36
|
+
#### Step 1
|
37
|
+
|
38
|
+
Run command in root of repository where `.podspec` is.
|
39
|
+
|
40
|
+
```sh
|
41
|
+
allegro_release (major|minor|patch)
|
42
|
+
```
|
43
|
+
|
44
|
+
* `major` increases major (X.0.0) version of pod.
|
45
|
+
* `minor` increases minor (0.X.0) version of pod.
|
46
|
+
* `patch` increases patch (0.0.X) version of pod.
|
47
|
+
|
48
|
+
**What it does?**
|
49
|
+
|
50
|
+
1. Checkouts `develop` branch and pulls changes from repository.
|
51
|
+
2. Creates new branch named `release_<version>`.
|
52
|
+
3. Bumps the version in `.podspec` accordingly to chosen option.
|
53
|
+
4. Updates `CHANGELOG.md` if available in the repository. Precisely, the tool is updating release date of release version and adds placeholders for next version on top of the file. `CHANGELOG.md` must follow the convention (explained below) used in repositories in order for this step to work.
|
54
|
+
5. Checks if `.podspec` file is valid via `pod lib lint`.
|
55
|
+
6. Commits all the changes. During this step `allegro_release` is asking the user for release issue JIRA ID.
|
56
|
+
7. Pushes the branch to the remote repository.
|
57
|
+
8. Creates pull request from `release_<version>` to `develop`.
|
58
|
+
|
59
|
+
##### CHANGELOG.md convention
|
60
|
+
|
61
|
+
File line numbers are on the left.
|
62
|
+
|
63
|
+
```
|
64
|
+
1. # CHANEGLOG
|
65
|
+
2.
|
66
|
+
3. ## Version X.X.X
|
67
|
+
4. #### Unreleased
|
68
|
+
5.
|
69
|
+
6. - (added) # Some unreleased changes
|
70
|
+
7.
|
71
|
+
8. ## Version 2.2.2
|
72
|
+
9. ### Released 01.01.2016
|
73
|
+
10.
|
74
|
+
11. - (modified) # Some released changes and the rest of CHANGELOG.md.
|
75
|
+
```
|
76
|
+
|
77
|
+
#### Step 2
|
78
|
+
|
79
|
+
After merging pull request that was created automatically in step 1, run command in root of repository where `.podspec` is.
|
80
|
+
|
81
|
+
```sh
|
82
|
+
allegro_release to_master
|
83
|
+
```
|
84
|
+
|
85
|
+
**What it does?**
|
86
|
+
|
87
|
+
1. Checkouts `release_<version>` branch and pulls changes from repository.
|
88
|
+
2. Creates pull requests from `release_<version>` to `master`.
|
89
|
+
|
90
|
+
#### Step 3
|
91
|
+
|
92
|
+
After merging pull request that was created automatically in step 2, run command in root of repository where `.podspec` is.
|
93
|
+
|
94
|
+
```sh
|
95
|
+
allegro_release finish
|
96
|
+
```
|
97
|
+
|
98
|
+
**What it does?**
|
99
|
+
|
100
|
+
1. Checkouts `master` branch and pulls changes from repository.
|
101
|
+
2. Adds tag to `master` with updated version.
|
102
|
+
3. Pushes `.podspec` to spec repository (this repository).
|
data/allegro_release.gemspec
CHANGED
data/lib/allegro_release.rb
CHANGED
@@ -59,35 +59,51 @@ module AllegroRelease
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def self.to_master
|
62
|
-
|
62
|
+
checkout_release
|
63
63
|
create_pull_request_to_master
|
64
64
|
puts "Second step is done! Now head to HipChat and paste the content of clipboard that contains link to pull request. After manual merge perform `allegro_release finish`.".colorize(:green)
|
65
65
|
end
|
66
66
|
|
67
67
|
def self.create_pull_request_to_master
|
68
68
|
puts "Creating pull request to master on Stash.".colorize(:green)
|
69
|
-
|
69
|
+
pull_request_command = "stash pull-request master -T \"Release #{version_from_file}.\" -d \"Release #{version_from_file}.\""
|
70
|
+
link = perform_pull_request(pull_request_command)
|
70
71
|
pbcopy "(kotek) (kotek) (successful) (successful) #{link}"
|
71
72
|
end
|
72
73
|
|
73
74
|
def self.bump(current, next_version, options)
|
74
75
|
checkout_develop
|
75
|
-
|
76
|
+
create_release_branch(next_version)
|
76
77
|
replace(current, next_version)
|
77
78
|
update_changelog(next_version)
|
78
79
|
check_podspec
|
79
80
|
commit_release(next_version)
|
80
81
|
push_changes_to_remote_branch(next_version)
|
81
82
|
create_pull_request_to_develop(next_version)
|
82
|
-
puts "First step is done! Now head to HipChat and paste the content of clipboard that contains link to pull request. After manual merge perform `allegro_release to_master
|
83
|
+
puts "First step is done! Now head to HipChat and paste the content of clipboard that contains link to pull request. After manual merge perform `allegro_release to_master`.\n".colorize(:green) + "Do not delete local release_#{version_from_file} branch, because it will be used to merge to master branch.".colorize(:red)
|
83
84
|
end
|
84
85
|
|
85
86
|
def self.create_pull_request_to_develop(version)
|
86
87
|
puts "Creating pull request to develop on Stash.".colorize(:green)
|
87
|
-
|
88
|
+
pull_request_command = "stash pull-request develop -T \"Release #{version_from_file}.\" -d \"Release #{version_from_file}.\""
|
89
|
+
link = perform_pull_request(pull_request_command)
|
88
90
|
pbcopy "(kotek) (kotek) (successful) (successful) #{link}"
|
89
91
|
end
|
90
92
|
|
93
|
+
def self.perform_pull_request(pull_request_command)
|
94
|
+
link = `#{pull_request_command}`
|
95
|
+
if link.include? 'Authentication failed. Please check your credentials and try again.'
|
96
|
+
expired_credentials = "Your Stash credentials expired (probably due to monthly password change). Below you can find instruction what values to enter. Authorizing again. \n".colorize(:red)
|
97
|
+
tip_one = "Bitbucket Server Username: <your_username> (go to \"View Profile\" in upper-right corner of Stash)\n".colorize(:green)
|
98
|
+
tip_two = "Bitbucket Server Password (optional): <your_password>\n".colorize(:green)
|
99
|
+
tip_three = "Bitbucket Server URL: https://stash.allegrogroup.com/\n".colorize(:green)
|
100
|
+
puts expired_credentials + tip_one + tip_two + tip_three
|
101
|
+
system_cmd("stash configure")
|
102
|
+
link = `#{pull_request_command}`
|
103
|
+
end
|
104
|
+
return link
|
105
|
+
end
|
106
|
+
|
91
107
|
def self.push_changes_to_remote_branch(version)
|
92
108
|
puts "Pushing branch to upstream.".colorize(:green)
|
93
109
|
system_cmd("git push -u origin release_#{version}")
|
@@ -143,6 +159,14 @@ module AllegroRelease
|
|
143
159
|
system_cmd("git pull")
|
144
160
|
end
|
145
161
|
|
162
|
+
def self.checkout_release
|
163
|
+
return unless File.directory?(".git")
|
164
|
+
puts "Pulling release_#{version_from_file} branch.".colorize(:green)
|
165
|
+
system_cmd("git checkout release_#{version_from_file}")
|
166
|
+
system_cmd("git pull")
|
167
|
+
puts "Checking out release_#{version_from_file} branch.".colorize(:green)
|
168
|
+
end
|
169
|
+
|
146
170
|
def self.commit(jira_id, version)
|
147
171
|
return unless File.directory?(".git")
|
148
172
|
commit_message = "'[#{jira_id}] Release #{version}.'"
|
@@ -151,7 +175,7 @@ module AllegroRelease
|
|
151
175
|
system_cmd("git commit -m #{commit_message}")
|
152
176
|
end
|
153
177
|
|
154
|
-
def self.
|
178
|
+
def self.create_release_branch(version)
|
155
179
|
return unless File.directory?(".git")
|
156
180
|
puts "Creating release branch.".colorize(:green)
|
157
181
|
system_cmd("git checkout -b release_#{version}")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allegro_release
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksander Grzyb
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,34 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: cocoapods
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.39'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.39'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: atlassian-stash
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.7'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.7'
|
69
97
|
description: A command line tools to release module easily.
|
70
98
|
email:
|
71
99
|
- aleksander.grzyb@allegrogroup.com
|
@@ -103,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
131
|
version: '0'
|
104
132
|
requirements: []
|
105
133
|
rubyforge_project:
|
106
|
-
rubygems_version: 2.
|
134
|
+
rubygems_version: 2.4.8
|
107
135
|
signing_key:
|
108
136
|
specification_version: 4
|
109
137
|
summary: A command line tools to release module.
|