rake_github 0.8.0.pre.9 → 0.9.0

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
  SHA256:
3
- metadata.gz: 9dcbdb76645e0c2d73eb81c97393d0626a4b9835f332477207223e61efa31d4c
4
- data.tar.gz: d687c0acb4308a01d5eb0b14c83f4ccef245fe935322ad5a45c977de32363ab9
3
+ metadata.gz: 73b2960bbf392ef1aeace8b8bcbd95e91b8f60f3b5b898340108654453b1c59a
4
+ data.tar.gz: 9731976e73e7bad5db4c63acf5822e4ab841a217e2118c8b203d745be6c3348c
5
5
  SHA512:
6
- metadata.gz: 55177a37b1577f8ca2fa7c3ec6224e40bd672e321e57f1069a34295480f7b699a403441742588e2475e82dd796c0f35ddaf122e6cfa6e7ef32d0140b9749f151
7
- data.tar.gz: cf139bb2175bd60da0aa4639c751c651c6d3a622260e46143306b6970a9baab6d99f858f9e8151adcd816dd115c893d0332a6973f1c0287add558d5328cb376b
6
+ metadata.gz: faa971f568964b6867aead677649c21deeedc543531792ebd97c2bfb0627d024a519fc86354d63c49d492195f7221c13fd2093730e8f727965440313c629d735
7
+ data.tar.gz: e5d435312c4499ee2c81c400ff8a9f602814f989709cfdc3b289ddf861fb326cb6f4020c7a4119199159e25dfd66ad208fb6f2e39f06a70ad44bd86c1144c651
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_github (0.8.0.pre.9)
4
+ rake_github (0.9.0)
5
5
  colored2 (~> 3.1)
6
6
  octokit (~> 4.16)
7
7
  rake_factory (~> 0.23)
data/README.md CHANGED
@@ -20,7 +20,69 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- TODO: Write usage instructions here
23
+ ### define_deploy_keys_tasks
24
+
25
+ ### define_repository_tasks
26
+
27
+ Sets up rake tasks for managing deploy keys and merging pull requests.
28
+
29
+ ```ruby
30
+ require 'rake_github'
31
+
32
+ RakeGithub.define_repository_tasks(
33
+ namespace: :github,
34
+ repository: 'org/repo', # required
35
+ ) do |t, args|
36
+ t.access_token = "your_github_access_token" # required
37
+ t.deploy_keys = [
38
+ {
39
+ title: 'CircleCI',
40
+ public_key: File.read('path/to/your_deploy_key.public')
41
+ }
42
+ ]
43
+ t.branch_name = args.branch_name
44
+ t.commit_message = args.commit_message
45
+ end
46
+ ```
47
+
48
+ | Parameter | Type | Required | Description | Example | Default |
49
+ |---------------------------------|--------|----------|------------------------------------------------------------|--------------------------------------------------------|--------------------------------------|
50
+ | repository | string | Y | Repository to perform tasks upon | 'organisation/repository_name' | N/A |
51
+ | access_token | string | Y | Github token for authorisation | 'ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | N/A |
52
+ | deploy_keys | array | N | Keys to deploy to repository | { title: string, public_key: string, read_only: bool } | [ ] |
53
+ | deploy_keys_namespace | symbol | N | Namespace to contain deploy keys tasks | :deploy_tasks | :deploy_keys |
54
+ | deploy_keys_destroy_task_name | symbol | N | Option to change the destroy task name | :obliterate | :destroy |
55
+ | deploy_keys_provision_task_name | symbol | N | Option to change the provision task name | :add | :provision |
56
+ | deploy_keys_ensure_task_name | symbol | N | Option to change the ensure task name | :destroy_and_provision | :ensure |
57
+ | namespace | symbol | N | Namespace for tasks to live in, defaults to root namespace | :rake_github | N/A |
58
+ | branch_name | string | N | Branch that can be merged | 'cool_new_feature' | N/A |
59
+ | commit_message | string | N | Merge commit message | 'merged PR using Rake Github' | "" (retains original commit message) |
60
+
61
+ Exposes tasks:
62
+ ```shell
63
+ $ rake -T
64
+
65
+ rake github:deploy_keys:destroy
66
+ rake github:deploy_keys:ensure
67
+ rake github:deploy_keys:provision
68
+ rake github:pull_requests:merge[branch_name,commit_message]
69
+ ```
70
+
71
+ #### deploy_keys:provision
72
+ Provisions deploy keys to the specified repository.
73
+
74
+ #### deploy_keys:destroy
75
+ Destroys deploy keys from the specified repository.
76
+
77
+ #### deploy_keys:ensure
78
+ Destroys and then provisions deploy keys on the specified repository.
79
+
80
+ #### pull_requests:merge[branch_name,commit_message]
81
+ Merges the PR associated with the `branch_name`. Branch name is required.
82
+
83
+ `commit_message` is optional, and can contain the original commit message with the `%s` placeholder, e.g. `pull_requests:merge[new_feature,"%s [skip ci]"]`.
84
+
85
+ ### define_release_task
24
86
 
25
87
  ## Development
26
88
 
@@ -15,6 +15,8 @@ module RakeGithub
15
15
  parameter :deploy_keys_destroy_task_name, default: :destroy
16
16
  parameter :deploy_keys_provision_task_name, default: :provision
17
17
  parameter :deploy_keys_ensure_task_name, default: :ensure
18
+ parameter :branch_name
19
+ parameter :commit_message, default: ''
18
20
 
19
21
  task Tasks::DeployKeys::Provision,
20
22
  name: RakeFactory::DynamicValue.new { |ts|
@@ -34,7 +36,14 @@ module RakeGithub
34
36
  destroy_task_name: RakeFactory::DynamicValue.new { |ts|
35
37
  ts.deploy_keys_destroy_task_name
36
38
  }
37
- task Tasks::PullRequests::Merge, argument_names: [:branch_name]
39
+ task Tasks::PullRequests::Merge,
40
+ argument_names: [:branch_name, :commit_message],
41
+ branch_name: RakeFactory::DynamicValue.new { |ts|
42
+ ts.branch_name
43
+ },
44
+ commit_message: RakeFactory::DynamicValue.new { |ts|
45
+ ts.commit_message
46
+ }
38
47
 
39
48
  def define_on(application)
40
49
  around_define(application) do
@@ -1,3 +1,3 @@
1
1
  module RakeGithub
2
- VERSION = '0.8.0.pre.9'
2
+ VERSION = '0.9.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.pre.9
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfraBlocks Maintainers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-26 00:00:00.000000000 Z
11
+ date: 2022-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colored2
@@ -264,9 +264,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
264
264
  version: '2.6'
265
265
  required_rubygems_version: !ruby/object:Gem::Requirement
266
266
  requirements:
267
- - - ">"
267
+ - - ">="
268
268
  - !ruby/object:Gem::Version
269
- version: 1.3.1
269
+ version: '0'
270
270
  requirements: []
271
271
  rubygems_version: 3.0.1
272
272
  signing_key: