releasinator 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/.gitignore +1 -0
- data/.releasinator.rb +2 -2
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +3 -3
- data/README.md +15 -5
- data/Rakefile +1 -1
- data/lib/command_processor.rb +1 -1
- data/lib/config_hash.rb +1 -1
- data/lib/copy_file.rb +1 -1
- data/lib/current_release.rb +1 -1
- data/lib/default_config.rb +3 -3
- data/lib/downstream.rb +1 -1
- data/lib/downstream_repo.rb +1 -1
- data/lib/git_util.rb +1 -1
- data/lib/github_repo.rb +1 -1
- data/lib/printer.rb +1 -1
- data/lib/publisher.rb +12 -0
- data/lib/releasinator/version.rb +1 -1
- data/lib/tasks/releasinator.rake +1 -0
- data/lib/validator.rb +3 -6
- data/lib/validator_changelog.rb +1 -1
- data/releasinator.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfcb0c0860fd15ef1e4ece2155302b634699dcc2
|
4
|
+
data.tar.gz: 8aa056a5a1f092e7ac2fafb183b73061bce4e666
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e519b13c6301ede333d82afa4d2a3216cb785000802c1e1b7b3cecdd20f63183d4de46fc34bd4c980b20846555b6bd158f5e1b420d7130083d361c14f00965a
|
7
|
+
data.tar.gz: efb92b51475f46d51892ea3598af803827fea3555131fcff533ad2387efc6cd7455fa96c90541c199121f6fce103f6de68985f9b7f8a65f8a7f4606273c4f3a6
|
data/.gitignore
CHANGED
data/.releasinator.rb
CHANGED
@@ -46,7 +46,7 @@ def build_method
|
|
46
46
|
CommandProcessor.command("mv releasinator-*.gem #{output_dir}")
|
47
47
|
end
|
48
48
|
|
49
|
-
# The command that builds the
|
49
|
+
# The command that builds the project. Required.
|
50
50
|
configatron.build_method = method(:build_method)
|
51
51
|
|
52
52
|
def publish_to_package_manager(version)
|
@@ -56,7 +56,7 @@ def publish_to_package_manager(version)
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
# The method that publishes the
|
59
|
+
# The method that publishes the project to the package manager. Required.
|
60
60
|
configatron.publish_to_package_manager_method = method(:publish_to_package_manager)
|
61
61
|
|
62
62
|
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
releasinator (0.
|
4
|
+
releasinator (0.5.0)
|
5
5
|
colorize (~> 0.7)
|
6
6
|
configatron (~> 4.5)
|
7
7
|
json (~> 1.8)
|
@@ -23,13 +23,13 @@ GEM
|
|
23
23
|
octokit (4.3.0)
|
24
24
|
sawyer (~> 0.7.0, >= 0.5.3)
|
25
25
|
power_assert (0.3.0)
|
26
|
-
rake (11.
|
26
|
+
rake (11.2.2)
|
27
27
|
redcarpet (3.3.4)
|
28
28
|
sawyer (0.7.0)
|
29
29
|
addressable (>= 2.3.5, < 2.5)
|
30
30
|
faraday (~> 0.8, < 0.10)
|
31
31
|
semantic (1.4.1)
|
32
|
-
test-unit (3.
|
32
|
+
test-unit (3.2.0)
|
33
33
|
power_assert
|
34
34
|
vandamme (0.0.11)
|
35
35
|
github-markup (~> 1.3)
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
## Problem
|
6
6
|
|
7
|
-
When automating
|
7
|
+
When automating a release process for libraries, SDKs, apps, or other open source projects, many teams have different ideas. This is on top of the fact that each language has its own conventions and repositories for distributing packages. The release process is a hurdle that makes it hard for new project members to ramp up. One shouldn't have to read a `release_process.md` to release an open source project.
|
8
8
|
|
9
9
|
## Solution
|
10
10
|
|
@@ -77,14 +77,14 @@ release
|
|
77
77
|
|
78
78
|
### Config
|
79
79
|
|
80
|
-
A default config file is created when running any releasinator rake task for the first time. This file includes placeholders for all the mandatory config items. Below is the full list of config options.
|
80
|
+
A [default config file](lib/default_config.rb) is created when running any releasinator rake task for the first time. This file includes placeholders for all the mandatory config items. Below is the full list of config options.
|
81
81
|
|
82
82
|
#### Required `.releasinator.rb` config options:
|
83
83
|
|
84
|
-
1. `configatron.product_name`: The name of the
|
84
|
+
1. `configatron.product_name`: The name of the project for usage in various commit statements.
|
85
85
|
2. `configatron.prerelease_checklist_items`: List of items to confirm from the person releasing.
|
86
|
-
3. `configatron.build_method`: The command that builds the
|
87
|
-
4. `configatron.publish_to_package_manager_method`: The method that publishes the
|
86
|
+
3. `configatron.build_method`: The command that builds the project.
|
87
|
+
4. `configatron.publish_to_package_manager_method`: The method that publishes the project to the package manager.
|
88
88
|
5. `configatron.wait_for_package_manager_method`: The method that waits for the package manager to be done.
|
89
89
|
6. `configatron.release_to_github`: True if publishing the root repo to GitHub.
|
90
90
|
|
@@ -98,6 +98,16 @@ A default config file is created when running any releasinator rake task for the
|
|
98
98
|
6. `configatron.doc_target_dir`: The directory where to run all git commands when publishing the docs. If not specified, the default is `.`. Generally useful if the docs are only applicable on a downstream release, rather than on the source itself.
|
99
99
|
7. `configatron.doc_files_to_copy`: List of CopyFile objects for copying built docs into a targeted location. Please see documentation on the `CopyFile` class.
|
100
100
|
|
101
|
+
#### Appending existing tasks in the releasinator lifecycle:
|
102
|
+
|
103
|
+
In some cases, releasing a project may require a deviation from the task lifecycle. To deal with this without requiring an update to the releasinator, you may just append an existing task in your project's config file. For example:
|
104
|
+
|
105
|
+
```
|
106
|
+
task :"validate:changelog" do
|
107
|
+
puts "validating changelog complete, let's dance!".red
|
108
|
+
end
|
109
|
+
```
|
110
|
+
This will 'append' the task `validate:changelog`, running the code block after the official releasinator task contents have run. See [this blog post](http://www.dan-manges.com/blog/modifying-rake-tasks) for a detailed description of how this mechanism works. You may append a task more than once.
|
101
111
|
|
102
112
|
## Conventions
|
103
113
|
|
data/Rakefile
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import "./lib/tasks/releasinator.rake"
|
1
|
+
import "./lib/tasks/releasinator.rake"
|
data/lib/command_processor.rb
CHANGED
data/lib/config_hash.rb
CHANGED
data/lib/copy_file.rb
CHANGED
data/lib/current_release.rb
CHANGED
data/lib/default_config.rb
CHANGED
@@ -11,14 +11,14 @@ def build_method
|
|
11
11
|
abort("please implement build_method method")
|
12
12
|
end
|
13
13
|
|
14
|
-
# The command that builds the
|
14
|
+
# The command that builds the project. Required.
|
15
15
|
configatron.build_method = method(:build_method)
|
16
16
|
|
17
17
|
def publish_to_package_manager(version)
|
18
18
|
abort("please implement publish_to_package_manager method")
|
19
19
|
end
|
20
20
|
|
21
|
-
# The method that publishes the
|
21
|
+
# The method that publishes the project to the package manager. Required.
|
22
22
|
configatron.publish_to_package_manager_method = method(:publish_to_package_manager)
|
23
23
|
|
24
24
|
|
@@ -30,4 +30,4 @@ configatron.wait_for_package_manager_method = method(:wait_for_package_manager)
|
|
30
30
|
|
31
31
|
# True if publishing the root repo to GitHub. Required.
|
32
32
|
configatron.release_to_github = true
|
33
|
-
)
|
33
|
+
)
|
data/lib/downstream.rb
CHANGED
@@ -67,7 +67,7 @@ module Releasinator
|
|
67
67
|
# remove old everything
|
68
68
|
CommandProcessor.command("rm -rf *")
|
69
69
|
|
70
|
-
# update all
|
70
|
+
# update all distribution files
|
71
71
|
CommandProcessor.command("rsync -av --exclude='#{DOWNSTREAM_REPOS}' --exclude='.git/' #{copy_from_dir}/* .")
|
72
72
|
CommandProcessor.command("rsync -av --exclude='#{DOWNSTREAM_REPOS}' --exclude='.git/' #{copy_from_dir}/.[!.]* .")
|
73
73
|
end
|
data/lib/downstream_repo.rb
CHANGED
data/lib/git_util.rb
CHANGED
data/lib/github_repo.rb
CHANGED
data/lib/printer.rb
CHANGED
data/lib/publisher.rb
CHANGED
@@ -26,6 +26,18 @@ module Releasinator
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
def upload_asset(repo_url, release, path_or_file, content_type)
|
30
|
+
begin
|
31
|
+
github_repo = GitHubRepo.new(repo_url)
|
32
|
+
github_release = github_repo.client.release_for_tag "#{github_repo.org}/#{github_repo.repo}", release.version
|
33
|
+
github_repo.client.upload_asset github_release.url, path_or_file, :content_type => content_type
|
34
|
+
rescue => error
|
35
|
+
#This will fail if it cannot upload the files
|
36
|
+
Printer.fail(error.inspect)
|
37
|
+
abort()
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
29
41
|
def publish_pull_request(repo_url, release, product_name, base, head)
|
30
42
|
begin
|
31
43
|
github_repo = GitHubRepo.new(repo_url)
|
data/lib/releasinator/version.rb
CHANGED
data/lib/tasks/releasinator.rake
CHANGED
@@ -87,6 +87,7 @@ namespace :validate do
|
|
87
87
|
task :gitignore => :config do
|
88
88
|
@validator.validate_exist('.', ".gitignore", DOWNSTREAM_REPOS)
|
89
89
|
@validator.validate_exist(@releasinator_config.base_dir, ".gitignore", DOWNSTREAM_REPOS) if '.' != @releasinator_config.base_dir
|
90
|
+
@validator.validate_gitignore_contents(".DS_Store")
|
90
91
|
if @releasinator_config.has_key?(:downstream_repos)
|
91
92
|
@validator.validate_gitignore_contents("#{DOWNSTREAM_REPOS}/")
|
92
93
|
end
|
data/lib/validator.rb
CHANGED
@@ -140,16 +140,13 @@ module Releasinator
|
|
140
140
|
if !line_match_in_file?(line, ".gitignore")
|
141
141
|
is_git_already_clean = GitUtil.is_clean_git?
|
142
142
|
File.open('.gitignore', 'a') do |f|
|
143
|
-
f.puts "# #{@releasinator_config[:releasinator_name]}"
|
144
143
|
f.puts line
|
145
144
|
end
|
146
145
|
|
146
|
+
Printer.success("Added missing line '#{line}' to .gitignore.")
|
147
|
+
|
147
148
|
if is_git_already_clean
|
148
|
-
CommandProcessor.command("git add . && git commit -m \"#{@releasinator_config[:releasinator_name]}: add
|
149
|
-
Printer.success("Added downstream dir to .gitignore file.")
|
150
|
-
else
|
151
|
-
Printer.fail("Added downstream dir to .gitignore file, but there are other changes in the workspace. Please commit and continue.")
|
152
|
-
abort()
|
149
|
+
CommandProcessor.command("git add . && git commit -m \"#{@releasinator_config[:releasinator_name]}: add missing line to .gitignore\"")
|
153
150
|
end
|
154
151
|
end
|
155
152
|
end
|
data/lib/validator_changelog.rb
CHANGED
data/releasinator.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Releasinator::VERSION
|
9
9
|
spec.authors = ["PayPal"]
|
10
10
|
spec.email = ["DL-PP-RUBY-SDK@paypal.com"]
|
11
|
-
spec.summary = %q{The releasinator assists in building and releasing
|
12
|
-
spec.description = %q{The releasinator assists in building and releasing
|
11
|
+
spec.summary = %q{The releasinator assists in building and releasing open source projects.}
|
12
|
+
spec.description = %q{The releasinator assists in building and releasing open source projects.}
|
13
13
|
spec.homepage = "https://developer.paypal.com"
|
14
14
|
spec.license = "Apache-2.0"
|
15
15
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: releasinator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PayPal
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -136,7 +136,7 @@ dependencies:
|
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '4.0'
|
139
|
-
description: The releasinator assists in building and releasing
|
139
|
+
description: The releasinator assists in building and releasing open source projects.
|
140
140
|
email:
|
141
141
|
- DL-PP-RUBY-SDK@paypal.com
|
142
142
|
executables: []
|
@@ -193,5 +193,5 @@ rubyforge_project:
|
|
193
193
|
rubygems_version: 2.5.1
|
194
194
|
signing_key:
|
195
195
|
specification_version: 4
|
196
|
-
summary: The releasinator assists in building and releasing
|
196
|
+
summary: The releasinator assists in building and releasing open source projects.
|
197
197
|
test_files: []
|