groundskeeper-bitcore 0.40.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/groundskeeper.gemspec +1 -1
- data/lib/groundskeeper/commands.rb +9 -8
- data/lib/groundskeeper/git.rb +8 -0
- data/lib/groundskeeper/github.rb +42 -0
- data/lib/groundskeeper/version.rb +1 -1
- data/lib/groundskeeper.rb +1 -0
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f4cd35c41603f56a260e556a2fe427979b27daa0f21a4da440f351a5b020b7f6
|
|
4
|
+
data.tar.gz: 3325bc9365c4b235a305e98dc1ac15ed5bec508c33da8236c2e03b5bdaa802ee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 48796307b0ed598d0b06e50da43a21f078576e6855123fefdcaa1a0b80f3a46486503594082b38016621b3614ab03a6fdb0a25f3e308bd05d1972fd30d3e5a30
|
|
7
|
+
data.tar.gz: 264c1bede9edc73b5dfeebf78b13df34edb70633d3636632a8669d85683d981455fb9bbd342dc3b1b7071bba6cf1e5ae465fa3d998272ce742c0aa94d97cd6b6
|
data/README.md
CHANGED
|
@@ -29,6 +29,12 @@ export BITBUCKET_USERNAME="bitbucket_username"
|
|
|
29
29
|
export BITBUCKET_APP_PASSWORD="app_password"
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
For integration with Github, install the [Github CLI](https://cli.github.com/) and run:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
gh auth login -h='github.com' -p='SSH' --skip-ssh-key -w
|
|
36
|
+
```
|
|
37
|
+
|
|
32
38
|
For integration with Sentry, find or create your auth token
|
|
33
39
|
[from here](https://sentry.io/settings/account/api/auth-tokens/) with the scopes `event:admin, event:read, member:read, org:read, project:read, project:releases, team:read`:
|
|
34
40
|
|
data/groundskeeper.gemspec
CHANGED
|
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
|
|
|
39
39
|
spec.add_dependency "openssl", "~> 3.3"
|
|
40
40
|
spec.add_dependency "thor", "~> 1.0"
|
|
41
41
|
|
|
42
|
-
spec.add_development_dependency "bundler", "~>
|
|
42
|
+
spec.add_development_dependency "bundler", "~> 4.0"
|
|
43
43
|
spec.add_development_dependency "byebug", "~> 11.1"
|
|
44
44
|
spec.add_development_dependency "minitest", "~> 5.0"
|
|
45
45
|
spec.add_development_dependency "rubocop", "~> 1.23"
|
|
@@ -27,7 +27,8 @@ module Groundskeeper
|
|
|
27
27
|
project = Project.build(repository.name)
|
|
28
28
|
deploy_url = "https://#{project.full_dns(stage)}"
|
|
29
29
|
website = Website.new(deploy_url)
|
|
30
|
-
|
|
30
|
+
git = Git.build
|
|
31
|
+
remote_version_control = git.bitbucket? ? Bitbucket.build : Github.build
|
|
31
32
|
sentry = Sentry.build(
|
|
32
33
|
project_name: project.sentry_project,
|
|
33
34
|
version_prefix: repository.name
|
|
@@ -37,8 +38,8 @@ module Groundskeeper
|
|
|
37
38
|
|
|
38
39
|
new(
|
|
39
40
|
console: console,
|
|
40
|
-
|
|
41
|
-
git:
|
|
41
|
+
remote_version_control: remote_version_control,
|
|
42
|
+
git: git,
|
|
42
43
|
jira: Jira.build(project.jira_prefix),
|
|
43
44
|
project: project,
|
|
44
45
|
repository: repository,
|
|
@@ -59,7 +60,7 @@ module Groundskeeper
|
|
|
59
60
|
# rubocop:disable Metrics/MethodLength,Metrics/ParameterLists
|
|
60
61
|
def initialize(
|
|
61
62
|
console:, version_file:,
|
|
62
|
-
|
|
63
|
+
remote_version_control: nil,
|
|
63
64
|
git: nil,
|
|
64
65
|
jira: nil,
|
|
65
66
|
project: nil,
|
|
@@ -71,7 +72,7 @@ module Groundskeeper
|
|
|
71
72
|
website: nil
|
|
72
73
|
)
|
|
73
74
|
@console = console
|
|
74
|
-
@
|
|
75
|
+
@remote_version_control = remote_version_control
|
|
75
76
|
@git = git
|
|
76
77
|
@jira = jira
|
|
77
78
|
@project = project
|
|
@@ -112,7 +113,7 @@ module Groundskeeper
|
|
|
112
113
|
is_initial_release = !version_file.exists?
|
|
113
114
|
|
|
114
115
|
return missing_jira_credentials unless jira.credentials?
|
|
115
|
-
return missing_bitbucket_credentials unless
|
|
116
|
+
return missing_bitbucket_credentials unless remote_version_control.credentials?
|
|
116
117
|
return groundskeeper_outdated unless check_groundskeeper_version
|
|
117
118
|
return unrecognized_version unless version_file.rails?
|
|
118
119
|
|
|
@@ -172,7 +173,7 @@ module Groundskeeper
|
|
|
172
173
|
private
|
|
173
174
|
|
|
174
175
|
# collaborators
|
|
175
|
-
attr_reader :
|
|
176
|
+
attr_reader :remote_version_control, :console, :git, :jira, :project,
|
|
176
177
|
:repository, :rubygems, :sentry, :slack, :ssh, :version_file,
|
|
177
178
|
:website
|
|
178
179
|
# state
|
|
@@ -293,7 +294,7 @@ module Groundskeeper
|
|
|
293
294
|
end
|
|
294
295
|
|
|
295
296
|
def create_pr
|
|
296
|
-
|
|
297
|
+
remote_version_control.create_pr(
|
|
297
298
|
repository: repository.name, branch_name: new_branch_name
|
|
298
299
|
)
|
|
299
300
|
end
|
data/lib/groundskeeper/git.rb
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module Groundskeeper
|
|
6
|
+
# Github API wrapper
|
|
7
|
+
class Github
|
|
8
|
+
COMMAND = "gh api"
|
|
9
|
+
GITHUB_ORG = "NU-RADD"
|
|
10
|
+
HOSTNAME = "github.com"
|
|
11
|
+
CREATE_PR = <<~REQUEST.split.join(" ")
|
|
12
|
+
--method POST
|
|
13
|
+
-H "Accept: application/vnd.github+json"
|
|
14
|
+
-H "X-GitHub-Api-Version: 2022-11-28"
|
|
15
|
+
--hostname #{HOSTNAME}
|
|
16
|
+
/repos/#{GITHUB_ORG}/%<repository>s/pulls
|
|
17
|
+
-f 'title=%<branch_name>s' -f 'head=%<branch_name>s' -f 'base=main'
|
|
18
|
+
REQUEST
|
|
19
|
+
|
|
20
|
+
attr_reader :github
|
|
21
|
+
|
|
22
|
+
# :nocov:
|
|
23
|
+
def self.build
|
|
24
|
+
new Executable.new(COMMAND)
|
|
25
|
+
end
|
|
26
|
+
# :nocov:
|
|
27
|
+
|
|
28
|
+
def initialize(github)
|
|
29
|
+
@github = github
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def create_pr(repository:, branch_name:)
|
|
33
|
+
github.execute(format(CREATE_PR, repository: repository, branch_name: branch_name))
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# :nocov:
|
|
37
|
+
def credentials?
|
|
38
|
+
true
|
|
39
|
+
end
|
|
40
|
+
# :nocov:
|
|
41
|
+
end
|
|
42
|
+
end
|
data/lib/groundskeeper.rb
CHANGED
|
@@ -10,6 +10,7 @@ require "groundskeeper/commands"
|
|
|
10
10
|
require "groundskeeper/document"
|
|
11
11
|
require "groundskeeper/executable"
|
|
12
12
|
require "groundskeeper/git"
|
|
13
|
+
require "groundskeeper/github"
|
|
13
14
|
require "groundskeeper/jira"
|
|
14
15
|
require "groundskeeper/project"
|
|
15
16
|
require "groundskeeper/rails_version"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: groundskeeper-bitcore
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.41.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- RADD
|
|
@@ -99,14 +99,14 @@ dependencies:
|
|
|
99
99
|
requirements:
|
|
100
100
|
- - "~>"
|
|
101
101
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: '
|
|
102
|
+
version: '4.0'
|
|
103
103
|
type: :development
|
|
104
104
|
prerelease: false
|
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
106
106
|
requirements:
|
|
107
107
|
- - "~>"
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
|
-
version: '
|
|
109
|
+
version: '4.0'
|
|
110
110
|
- !ruby/object:Gem::Dependency
|
|
111
111
|
name: byebug
|
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -226,6 +226,7 @@ files:
|
|
|
226
226
|
- lib/groundskeeper/document.rb
|
|
227
227
|
- lib/groundskeeper/executable.rb
|
|
228
228
|
- lib/groundskeeper/git.rb
|
|
229
|
+
- lib/groundskeeper/github.rb
|
|
229
230
|
- lib/groundskeeper/jira.rb
|
|
230
231
|
- lib/groundskeeper/project.rb
|
|
231
232
|
- lib/groundskeeper/rails_version.rb
|
|
@@ -259,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
259
260
|
- !ruby/object:Gem::Version
|
|
260
261
|
version: '0'
|
|
261
262
|
requirements: []
|
|
262
|
-
rubygems_version: 4.0.
|
|
263
|
+
rubygems_version: 4.0.4
|
|
263
264
|
specification_version: 4
|
|
264
265
|
summary: A gem for managing releases and deployments.
|
|
265
266
|
test_files: []
|