releasinator 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 194855b8293cef00a51d7cf0db1d92ffc40b8431
4
- data.tar.gz: 3a83dfbf189daeed8dd226c6b58618d946d10a6b
3
+ metadata.gz: 2cd44d3c394b6d22d00f1ed650f8fd4f91c7a64a
4
+ data.tar.gz: 4909d7351541c5fa5f0c220593f357a7072baa34
5
5
  SHA512:
6
- metadata.gz: cb334694d56c8b3152eb861d57b6861b8a7605a1ee2278916589b334f577b5abc8e8e1bc154632b25dd5abda40223c8c048add31764545b3a0526315eaed288e
7
- data.tar.gz: 3e0c022e3146461f65cf51642a094606cf572c0e371543f8e3d9ad20bfb6e5b154739bfc9de08f915343beed4571a9745b04ce25db1005236acf9a81474f2642
6
+ metadata.gz: d2d9246e4385d73942e8ef8535c540bedd1ac16117717c3209b52a6c61f982e5804d5d0bab1c258eb24fbf3f4e05287d3aede9a1c54919d6262726af734534fc
7
+ data.tar.gz: ede9f2764264f3a377b68426a40118b038fd16e77ae44ff36b68ce8d82c1c7b9fd70306444d35901fc74b6ac160cd67ed2caba0a688b5b1235bcc0cf37c92be5
@@ -0,0 +1,9 @@
1
+ ### Required Information
2
+
3
+ - Mode (Mock/Sandbox/Live):
4
+ - PayPal Android SDK Version:
5
+ - Android Version and Device (Motorola Droid Razr Maxx with Android 4.4.2, Samsung S7 with Android 6.0, etc...):
6
+ - PayPal-Debug-ID(s) (from any logs):
7
+
8
+ ### Issue Description
9
+ > Please include as many details (logs, steps to reproduce, screenshots) as you can to help us reproduce this issue faster.
data/.gitignore CHANGED
@@ -0,0 +1 @@
1
+ build
data/.releasinator.rb ADDED
@@ -0,0 +1,37 @@
1
+ configatron.product_name = "Releasinator"
2
+
3
+ # List of items to confirm from the person releasing. Required, but empty list is ok.
4
+ configatron.prerelease_checklist_items = [
5
+ ]
6
+
7
+ # The directory where all distributed docs are. Default is '.'
8
+ # configatron.base_docs_dir = '.'
9
+
10
+ def build_method
11
+ CommandProcessor.command("gem build releasinator.gemspec")
12
+ Dir.mkdir("build") unless File.exists?("build")
13
+ CommandProcessor.command("mv releasinator-*.gem build")
14
+ end
15
+
16
+ # The command that builds the sdk. Required.
17
+ configatron.build_method = method(:build_method)
18
+
19
+ def publish_to_package_manager(version)
20
+ Dir.chdir("build") do
21
+ CommandProcessor.command("gem push releasinator-#{version}.gem")
22
+ end
23
+ end
24
+
25
+ # The method that publishes the sdk to the package manager. Required.
26
+ configatron.publish_to_package_manager_method = method(:publish_to_package_manager)
27
+
28
+
29
+ def wait_for_package_manager(version)
30
+ CommandProcessor.wait_for("wget -U \"non-empty-user-agent\" -qO- https://rubygems.org/gems/releasinator/versions/#{version} | cat")
31
+ end
32
+
33
+ # The method that waits for the package manager to be done. Required
34
+ configatron.wait_for_package_manager_method = method(:wait_for_package_manager)
35
+
36
+ # Whether to publish the root repo to GitHub. Required.
37
+ configatron.release_to_github = true
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ Releasinator release notes
2
+ ==========================
3
+
4
+ 0.1.1
5
+ -----
6
+ * Fix validate:gitignore to print more and dirty git
7
+
8
+ 0.1.0
9
+ -----
10
+ * First release as a gemfile!
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,3 @@
1
+ # Contribute to the Releasinator
2
+
3
+ We love your contributions. If you're looking to submit changes, feel free to submit a PR!
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- releasinator (0.1.0)
5
- colorize
6
- configatron
7
- json
4
+ releasinator (0.1.1)
5
+ colorize (~> 0.7)
6
+ configatron (~> 4.5)
7
+ json (~> 1.8)
8
8
  octokit (~> 4.0)
9
- semantic
10
- vandamme
9
+ semantic (~> 1.4)
10
+ vandamme (~> 0.0.11)
11
11
 
12
12
  GEM
13
13
  remote: https://rubygems.org/
data/LICENSE ADDED
@@ -0,0 +1,156 @@
1
+ Apache License
2
+
3
+ Version 2.0, January 2004
4
+
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction, and
12
+ distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright
15
+ owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all other entities
18
+ that control, are controlled by, or are under common control with that entity.
19
+ For the purposes of this definition, "control" means (i) the power, direct or
20
+ indirect, to cause the direction or management of such entity, whether by
21
+ contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
25
+ permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications, including
28
+ but not limited to software source code, documentation source, and
29
+ configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical transformation or
32
+ translation of a Source form, including but not limited to compiled object
33
+ code, generated documentation, and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or Object form,
36
+ made available under the License, as indicated by a copyright notice that is
37
+ included in or attached to the work (an example is provided in the Appendix
38
+ below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
41
+ is based on (or derived from) the Work and for which the editorial revisions,
42
+ annotations, elaborations, or other modifications represent, as a whole, an
43
+ original work of authorship. For the purposes of this License, Derivative
44
+ Works shall not include works that remain separable from, or merely link (or
45
+ bind by name) to the interfaces of, the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean any work of authorship, including the original
48
+ version of the Work and any modifications or additions to that Work or
49
+ Derivative Works thereof, that is intentionally submitted to Licensor for
50
+ inclusion in the Work by the copyright owner or by an individual or Legal
51
+ Entity authorized to submit on behalf of the copyright owner. For the purposes
52
+ of this definition, "submitted" means any form of electronic, verbal, or
53
+ written communication sent to the Licensor or its representatives, including
54
+ but not limited to communication on electronic mailing lists, source code
55
+ control systems, and issue tracking systems that are managed by, or on behalf
56
+ of, the Licensor for the purpose of discussing and improving the Work, but
57
+ excluding communication that is conspicuously marked or otherwise designated in
58
+ writing by the copyright owner as "Not a Contribution."
59
+
60
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
61
+ of whom a Contribution has been received by Licensor and subsequently
62
+ incorporated within the Work.
63
+
64
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
65
+ License, each Contributor hereby grants to You a perpetual, worldwide, non-
66
+ exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce,
67
+ prepare Derivative Works of, publicly display, publicly perform, sublicense,
68
+ and distribute the Work and such Derivative Works in Source or Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of this
71
+ License, each Contributor hereby grants to You a perpetual, worldwide, non-
72
+ exclusive, no-charge, royalty-free, irrevocable (except as stated in this
73
+ section) patent license to make, have made, use, offer to sell, sell, import,
74
+ and otherwise transfer the Work, where such license applies only to those
75
+ patent claims licensable by such Contributor that are necessarily infringed by
76
+ their Contribution(s) alone or by combination of their Contribution(s) with the
77
+ Work to which such Contribution(s) was submitted. If You institute patent
78
+ litigation against any entity (including a cross-claim or counterclaim in a
79
+ lawsuit) alleging that the Work or a Contribution incorporated within the Work
80
+ constitutes direct or contributory patent infringement, then any patent
81
+ licenses granted to You under this License for that Work shall terminate as of
82
+ the date such litigation is filed.
83
+
84
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
85
+ Derivative Works thereof in any medium, with or without modifications, and in
86
+ Source or Object form, provided that You meet the following conditions:
87
+
88
+ You must give any other recipients of the Work or Derivative Works a copy of
89
+ this License; and You must cause any modified files to carry prominent notices
90
+ stating that You changed the files; and You must retain, in the Source form of
91
+ any Derivative Works that You distribute, all copyright, patent, trademark, and
92
+ attribution notices from the Source form of the Work, excluding those notices
93
+ that do not pertain to any part of the Derivative Works; and If the Work
94
+ includes a "NOTICE" text file as part of its distribution, then any Derivative
95
+ Works that You distribute must include a readable copy of the attribution
96
+ notices contained within such NOTICE file, excluding those notices that do not
97
+ pertain to any part of the Derivative Works, in at least one of the following
98
+ places: within a NOTICE text file distributed as part of the Derivative Works;
99
+ within the Source form or documentation, if provided along with the Derivative
100
+ Works; or, within a display generated by the Derivative Works, if and wherever
101
+ such third-party notices normally appear. The contents of the NOTICE file are
102
+ for informational purposes only and do not modify the License. You may add Your
103
+ own attribution notices within Derivative Works that You distribute, alongside
104
+ or as an addendum to the NOTICE text from the Work, provided that such
105
+ additional attribution notices cannot be construed as modifying the License.
106
+
107
+ You may add Your own copyright statement to Your modifications and may provide
108
+ additional or different license terms and conditions for use, reproduction, or
109
+ distribution of Your modifications, or for any such Derivative Works as a
110
+ whole, provided Your use, reproduction, and distribution of the Work otherwise
111
+ complies with the conditions stated in this License.
112
+
113
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
114
+ Contribution intentionally submitted for inclusion in the Work by You to the
115
+ Licensor shall be under the terms and conditions of this License, without any
116
+ additional terms or conditions. Notwithstanding the above, nothing herein shall
117
+ supersede or modify the terms of any separate license agreement you may have
118
+ executed with Licensor regarding such Contributions.
119
+
120
+ 6. Trademarks. This License does not grant permission to use the trade names,
121
+ trademarks, service marks, or product names of the Licensor, except as required
122
+ for reasonable and customary use in describing the origin of the Work and
123
+ reproducing the content of the NOTICE file.
124
+
125
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
126
+ writing, Licensor provides the Work (and each Contributor provides its
127
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
128
+ KIND, either express or implied, including, without limitation, any warranties
129
+ or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
130
+ PARTICULAR PURPOSE. You are solely responsible for determining the
131
+ appropriateness of using or redistributing the Work and assume any risks
132
+ associated with Your exercise of permissions under this License.
133
+
134
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
135
+ tort (including negligence), contract, or otherwise, unless required by
136
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
137
+ writing, shall any Contributor be liable to You for damages, including any
138
+ direct, indirect, special, incidental, or consequential damages of any
139
+ character arising as a result of this License or out of the use or inability
140
+ to use the Work (including but not limited to damages for loss of goodwill,
141
+ work stoppage, computer failure or malfunction, or any and all other commercial
142
+ damages or losses), even if such Contributor has been advised of the
143
+ possibility of such damages.
144
+
145
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or
146
+ Derivative Works thereof, You may choose to offer, and charge a fee for,
147
+ acceptance of support, warranty, indemnity, or other liability obligations
148
+ and/or rights consistent with this License. However, in accepting such
149
+ obligations, You may act only on Your own behalf and on Your sole
150
+ responsibility, not on behalf of any other Contributor, and only if You agree
151
+ to indemnify, defend, and hold each Contributor harmless for any liability
152
+ incurred by, or claims asserted against, such Contributor by reason of your
153
+ accepting any such warranty or additional liability.
154
+
155
+ END OF TERMS AND CONDITIONS
156
+
data/README.md CHANGED
@@ -102,13 +102,10 @@ The releasinator enforces certain conventions. If a filename doesn't exactly ma
102
102
  11. TODO add those same release notes within the release notes of the downstream repo.
103
103
  11. Assemble a draft of news, and publish (where possible, i.e. send email, tweet, whatever).
104
104
 
105
- #### Open items:
105
+ ## Contributing
106
106
 
107
- * Might need a different name - [releasinator is taken](https://qconnewyork.com/ny2015/system/files/presentation-slides/QCon%20Distributing%20a%20Mobile%20Team.pdf)
107
+ Please read our [contributing guidelines](CONTRIBUTING.md) prior to submitting a Pull Request.
108
108
 
109
- ### Example build files
110
-
111
- * https://github.paypal.com/SDK-R/PayPal-Android-SDK/blob/develop/fabfile.py
112
- * https://github.paypal.com/SDK-R/PayPal-iOS-SDK/blob/develop/fabfile.py
113
- * https://github.braintreeps.com/braintree/braintree-android/blob/master/Rakefile
109
+ ## License
114
110
 
111
+ Please refer to this repo's [license file](LICENSE).
data/lib/git_util.rb CHANGED
@@ -47,6 +47,26 @@ module Releasinator
47
47
  end
48
48
  end
49
49
 
50
+ def self.confirm_tag_overwrite(new_tag)
51
+ tag_results = CommandProcessor.command('git tag -l')
52
+ tag_results.split.each do |existing_tag|
53
+ if existing_tag == new_tag
54
+ Printer.check_proceed("Tag #{existing_tag} already present. Overwrite tag #{existing_tag}?", "Tag #{existing_tag} not overwritten.")
55
+ end
56
+ end
57
+ end
58
+
59
+ def self.tag(new_tag, changelog)
60
+ confirm_tag_overwrite(new_tag)
61
+ puts "tagging with changelog: \n\n#{changelog}\n".yellow
62
+ changelog_tempfile = Tempfile.new("#{new_tag}.changelog")
63
+ changelog_tempfile.write(changelog)
64
+ changelog_tempfile.close
65
+ # include changelog in annotated tag
66
+ CommandProcessor.command("git tag -a -f #{new_tag} -F #{changelog_tempfile.path}")
67
+ changelog_tempfile.unlink
68
+ end
69
+
50
70
  def self.init_gh_pages
51
71
  if !has_branch? "gh-pages"
52
72
  if has_remote_branch? "origin/gh-pages"
@@ -1,3 +1,3 @@
1
1
  module Releasinator
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -39,17 +39,6 @@ def release_to_github(options)
39
39
  false
40
40
  end
41
41
 
42
- def git_tag(new_tag, changelog)
43
- confirm_tag_overwrite(new_tag)
44
- puts "tagging with changelog: \n\n#{@currentRelease.changelog}\n".yellow
45
- changelog_tempfile = Tempfile.new("#{new_tag}.changelog")
46
- changelog_tempfile.write(changelog)
47
- changelog_tempfile.close
48
- # include changelog in annotated tag
49
- CommandProcessor.command("git tag -a -f #{new_tag} -F #{changelog_tempfile.path}")
50
- changelog_tempfile.unlink
51
- end
52
-
53
42
  desc "read and validate the config, adding one if not found"
54
43
  task :config do
55
44
  @releasinator_config = ConfigHash.new(verbose == true, Rake.application.options.trace == true)
@@ -174,15 +163,6 @@ task :release => [:"validate:all",:"local:build",:"pm:all",:"downstream:all",:"l
174
163
  Printer.success("Done releasing.")
175
164
  end
176
165
 
177
- def confirm_tag_overwrite(new_tag)
178
- tag_results = CommandProcessor.command('git tag -l')
179
- tag_results.split.each do |existing_tag|
180
- if existing_tag == new_tag
181
- Printer.check_proceed("Tag #{existing_tag} already present. Overwrite tag #{existing_tag}?", "Tag #{existing_tag} not overwritten.")
182
- end
183
- end
184
- end
185
-
186
166
  desc "iterate over the prerelease_checklist_items, asking the user if each is done"
187
167
  task :prerelease_checklist => :config do
188
168
  @releasinator_config[:prerelease_checklist_items].each do |prerelease_item|
@@ -205,7 +185,7 @@ namespace :local do
205
185
 
206
186
  desc "tag the local repo"
207
187
  task :tag => :config do
208
- git_tag(@currentRelease.release, @currentRelease.changelog)
188
+ GitUtil.tag(@currentRelease.release, @currentRelease.changelog)
209
189
  end
210
190
 
211
191
  desc "build the local repo"
@@ -422,7 +402,7 @@ namespace :downstream do
422
402
  Dir.chdir(DOWNSTREAM_REPOS) do
423
403
  Dir.chdir(downstream_repo.name) do
424
404
  # don't tag those where new branches are created
425
- git_tag(@currentRelease.release, @currentRelease.changelog) unless downstream_repo.options.has_key? :new_branch_name
405
+ GitUtil.tag(@currentRelease.release, @currentRelease.changelog) unless downstream_repo.options.has_key? :new_branch_name
426
406
  end
427
407
  end
428
408
  end
data/lib/validator.rb CHANGED
@@ -116,9 +116,17 @@ module Releasinator
116
116
 
117
117
  def validate_gitignore(line, is_downstream_present)
118
118
  if !File.exist?(".gitignore")
119
+ is_git_already_clean = GitUtil.new().is_clean_git?
119
120
  FileUtils.touch('.gitignore')
120
- CommandProcessor.command("git add . && git commit -m \"#{@releasinator_config[:releasinator_name]}: add .gitignore\"")
121
+ if is_git_already_clean
122
+ CommandProcessor.command("git add . && git commit -m \"#{@releasinator_config[:releasinator_name]}: add .gitignore\"")
123
+ Printer.success("Added .gitignore file.")
124
+ else
125
+ Printer.fail("Added .gitignore, but there are other changes in the workspace. Please commit and continue.")
126
+ abort()
127
+ end
121
128
  end
129
+ Printer.success(".gitignore found.")
122
130
 
123
131
  if is_downstream_present
124
132
  if !line_match_in_file?(line, ".gitignore")
@@ -130,6 +138,10 @@ module Releasinator
130
138
 
131
139
  if is_git_already_clean
132
140
  CommandProcessor.command("git add . && git commit -m \"#{@releasinator_config[:releasinator_name]}: add downstream dir to .gitignore\"")
141
+ Printer.success("Added downstream dir to .gitignore file.")
142
+ else
143
+ Printer.fail("Added downstream dir to .gitignore file, but there are other changes in the workspace. Please commit and continue.")
144
+ abort()
133
145
  end
134
146
  end
135
147
  end
@@ -295,12 +307,12 @@ module Releasinator
295
307
  CommandProcessor.command("mv #{old_name} #{new_name}")
296
308
  # fix any references to file in readme
297
309
  replace_string("README.md", "(#{old_name})", "(#{new_name})")
298
- CommandProcessor.command("git add . && git commit -m \"#{@config[:releasinator_name]}: rename #{old_name} to #{new_name}\"")
310
+ CommandProcessor.command("git add . && git commit -m \"#{@releasinator_config[:releasinator_name]}: rename #{old_name} to #{new_name}\"")
299
311
  end
300
312
 
301
313
  def rename_alternate_name(expected_file_name, alternate_names)
302
314
  alternate_names.each do |name|
303
- if '' != CommandProcessor.command("ls #{name}")
315
+ Dir.glob(name) do |entry|
304
316
  puts "Found similar file: #{name}."
305
317
  rename_file(name, expected_file_name)
306
318
  return true
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.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - PayPal
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-26 00:00:00.000000000 Z
11
+ date: 2016-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -129,9 +129,14 @@ executables: []
129
129
  extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
+ - ".github/ISSUE_TEMPLATE.md"
132
133
  - ".gitignore"
134
+ - ".releasinator.rb"
135
+ - CHANGELOG.md
136
+ - CONTRIBUTING.md
133
137
  - Gemfile
134
138
  - Gemfile.lock
139
+ - LICENSE
135
140
  - README.md
136
141
  - Rakefile
137
142
  - lib/command_processor.rb