rake_gcp 0.3.0.pre.2 → 0.3.0.pre.2.pr137.1.1
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/Gemfile.lock +84 -75
- data/README.md +4 -4
- data/Rakefile +110 -47
- data/lib/rake_gcp/version.rb +1 -1
- data/rake_gcp.gemspec +2 -3
- metadata +10 -24
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 690657370de212f7a5f1b8747afef9f397490fb54dc434e68014ef0233863663
|
|
4
|
+
data.tar.gz: 06de3af34cc68de8801819b3d3cdaf3ddcf190d08739eb81ea16c01b720f2790
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 79965867c94563e1ab47d4da616825c1d47e87e73d884a47a9cdd63b44606a8957cb0ae3e5d6ad5b178501a39dfc2e0c59d810466b3f7221910b4e1ddfbb1af5
|
|
7
|
+
data.tar.gz: 160b4b8e14e21a5334a3fc65b43c9dfdeca30c0b6606b99b59139a7b4f538704a0d11280f902c215e3913ef7f394231f2e1e5cf0eb6e97eed89b6b8505667a73
|
data/Gemfile.lock
CHANGED
|
@@ -1,80 +1,84 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rake_gcp (0.3.0.pre.2)
|
|
4
|
+
rake_gcp (0.3.0.pre.2.pr137.1.1)
|
|
5
5
|
colored2 (~> 3.1)
|
|
6
6
|
rake_factory (~> 0.33)
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
-
activesupport (
|
|
11
|
+
activesupport (8.1.3)
|
|
12
12
|
base64
|
|
13
13
|
bigdecimal
|
|
14
|
-
concurrent-ruby (~> 1.0, >= 1.
|
|
14
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
15
15
|
connection_pool (>= 2.2.5)
|
|
16
16
|
drb
|
|
17
17
|
i18n (>= 1.6, < 2)
|
|
18
|
+
json
|
|
19
|
+
logger (>= 1.4.2)
|
|
18
20
|
minitest (>= 5.1)
|
|
19
|
-
|
|
20
|
-
tzinfo (~> 2.0)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
securerandom (>= 0.3)
|
|
22
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
23
|
+
uri (>= 0.13.1)
|
|
24
|
+
addressable (2.9.0)
|
|
25
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
26
|
+
ast (2.4.3)
|
|
27
|
+
base64 (0.3.0)
|
|
28
|
+
bigdecimal (4.1.2)
|
|
26
29
|
childprocess (5.0.0)
|
|
27
30
|
colored2 (3.1.2)
|
|
28
|
-
concurrent-ruby (1.3.
|
|
29
|
-
connection_pool (
|
|
30
|
-
diff-lcs (1.
|
|
31
|
+
concurrent-ruby (1.3.8)
|
|
32
|
+
connection_pool (3.0.2)
|
|
33
|
+
diff-lcs (1.6.2)
|
|
31
34
|
docile (1.4.0)
|
|
32
|
-
drb (2.2.
|
|
33
|
-
excon (
|
|
34
|
-
faraday (2.10.0)
|
|
35
|
-
faraday-net_http (>= 2.0, < 3.2)
|
|
35
|
+
drb (2.2.3)
|
|
36
|
+
excon (1.6.0)
|
|
36
37
|
logger
|
|
37
|
-
faraday
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
faraday (2.14.3)
|
|
39
|
+
faraday-net_http (>= 2.0, < 3.5)
|
|
40
|
+
json
|
|
41
|
+
logger
|
|
42
|
+
faraday-net_http (3.4.4)
|
|
43
|
+
net-http (~> 0.5)
|
|
44
|
+
ffi (1.17.4)
|
|
45
|
+
ffi (1.17.4-arm64-darwin)
|
|
46
|
+
ffi (1.17.4-x86_64-darwin)
|
|
47
|
+
ffi (1.17.4-x86_64-linux-gnu)
|
|
48
|
+
gem-release (2.2.4)
|
|
40
49
|
git (1.19.1)
|
|
41
50
|
addressable (~> 2.8)
|
|
42
51
|
rchardet (~> 1.8)
|
|
43
52
|
hamster (3.0.0)
|
|
44
53
|
concurrent-ruby (~> 1.0)
|
|
45
|
-
i18n (1.
|
|
54
|
+
i18n (1.15.2)
|
|
46
55
|
concurrent-ruby (~> 1.0)
|
|
47
|
-
immutable-struct (2.
|
|
48
|
-
json (2.
|
|
49
|
-
language_server-protocol (3.17.0.
|
|
56
|
+
immutable-struct (2.5.0)
|
|
57
|
+
json (2.12.2)
|
|
58
|
+
language_server-protocol (3.17.0.5)
|
|
50
59
|
lino (4.1.0)
|
|
51
60
|
childprocess (~> 5.0.0)
|
|
52
61
|
hamster (~> 3.0)
|
|
53
62
|
open4 (~> 1.3)
|
|
54
|
-
|
|
63
|
+
lint_roller (1.1.0)
|
|
64
|
+
logger (1.7.0)
|
|
55
65
|
memfs (1.0.0)
|
|
56
|
-
minitest (5.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
octokit (8.1.0)
|
|
61
|
-
base64
|
|
66
|
+
minitest (5.27.0)
|
|
67
|
+
net-http (0.9.1)
|
|
68
|
+
uri (>= 0.11.1)
|
|
69
|
+
octokit (10.0.0)
|
|
62
70
|
faraday (>= 1, < 3)
|
|
63
71
|
sawyer (~> 0.9)
|
|
64
72
|
open4 (1.3.4)
|
|
65
|
-
parallel (1.
|
|
66
|
-
parser (3.3.
|
|
73
|
+
parallel (1.27.0)
|
|
74
|
+
parser (3.3.8.0)
|
|
67
75
|
ast (~> 2.4.1)
|
|
68
76
|
racc
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
prism (1.4.0)
|
|
78
|
+
public_suffix (7.0.5)
|
|
79
|
+
racc (1.8.1)
|
|
71
80
|
rainbow (3.1.1)
|
|
72
|
-
rake (13.2
|
|
73
|
-
rake_circle_ci (0.13.0)
|
|
74
|
-
colored2 (~> 3.1)
|
|
75
|
-
excon (~> 0.72)
|
|
76
|
-
rake_factory (~> 0.33)
|
|
77
|
-
sshkey (~> 2.0)
|
|
81
|
+
rake (13.4.2)
|
|
78
82
|
rake_factory (0.33.0)
|
|
79
83
|
activesupport (>= 4)
|
|
80
84
|
rake (~> 13.0)
|
|
@@ -82,66 +86,71 @@ GEM
|
|
|
82
86
|
colored2 (~> 3.1)
|
|
83
87
|
git (~> 1.13, >= 1.13.2)
|
|
84
88
|
rake_factory (~> 0.33)
|
|
85
|
-
rake_git_crypt (0.
|
|
89
|
+
rake_git_crypt (0.4.0)
|
|
86
90
|
colored2 (~> 3.1)
|
|
91
|
+
lino (~> 4.1)
|
|
87
92
|
rake_factory (~> 0.33)
|
|
88
93
|
ruby_git_crypt (~> 0.1)
|
|
89
94
|
ruby_gpg2 (~> 0.12)
|
|
90
|
-
rake_github (0.
|
|
95
|
+
rake_github (0.17.0)
|
|
91
96
|
colored2 (~> 3.1)
|
|
92
|
-
octokit (>=
|
|
93
|
-
rake_factory (~> 0.
|
|
97
|
+
octokit (>= 7.0, < 11.0)
|
|
98
|
+
rake_factory (~> 0.33)
|
|
99
|
+
rbnacl (~> 7.1)
|
|
94
100
|
sshkey (~> 2.0)
|
|
95
101
|
rake_gpg (0.20.0)
|
|
96
102
|
rake_factory (~> 0.33)
|
|
97
103
|
ruby_gpg2 (~> 0.12)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
rake_factory (~> 0.
|
|
101
|
-
|
|
104
|
+
rake_slack (0.3.0)
|
|
105
|
+
excon (>= 0.72, < 2.0)
|
|
106
|
+
rake_factory (~> 0.33)
|
|
107
|
+
rbnacl (7.1.2)
|
|
108
|
+
ffi (~> 1)
|
|
102
109
|
rchardet (1.8.0)
|
|
103
|
-
regexp_parser (2.
|
|
104
|
-
|
|
105
|
-
strscan
|
|
106
|
-
rspec (3.13.0)
|
|
110
|
+
regexp_parser (2.10.0)
|
|
111
|
+
rspec (3.13.1)
|
|
107
112
|
rspec-core (~> 3.13.0)
|
|
108
113
|
rspec-expectations (~> 3.13.0)
|
|
109
114
|
rspec-mocks (~> 3.13.0)
|
|
110
|
-
rspec-core (3.13.
|
|
115
|
+
rspec-core (3.13.4)
|
|
111
116
|
rspec-support (~> 3.13.0)
|
|
112
|
-
rspec-expectations (3.13.
|
|
117
|
+
rspec-expectations (3.13.5)
|
|
113
118
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
114
119
|
rspec-support (~> 3.13.0)
|
|
115
|
-
rspec-mocks (3.13.
|
|
120
|
+
rspec-mocks (3.13.5)
|
|
116
121
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
117
122
|
rspec-support (~> 3.13.0)
|
|
118
|
-
rspec-support (3.13.
|
|
119
|
-
rubocop (1.
|
|
123
|
+
rspec-support (3.13.4)
|
|
124
|
+
rubocop (1.75.8)
|
|
120
125
|
json (~> 2.3)
|
|
121
|
-
language_server-protocol (
|
|
126
|
+
language_server-protocol (~> 3.17.0.2)
|
|
127
|
+
lint_roller (~> 1.1.0)
|
|
122
128
|
parallel (~> 1.10)
|
|
123
129
|
parser (>= 3.3.0.2)
|
|
124
130
|
rainbow (>= 2.2.2, < 4.0)
|
|
125
|
-
regexp_parser (>= 2.
|
|
126
|
-
|
|
127
|
-
rubocop-ast (>= 1.31.1, < 2.0)
|
|
131
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
132
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
|
128
133
|
ruby-progressbar (~> 1.7)
|
|
129
|
-
unicode-display_width (>= 2.4.0, <
|
|
130
|
-
rubocop-ast (1.
|
|
131
|
-
parser (>= 3.3.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
rubocop (
|
|
134
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
135
|
+
rubocop-ast (1.44.1)
|
|
136
|
+
parser (>= 3.3.7.2)
|
|
137
|
+
prism (~> 1.4)
|
|
138
|
+
rubocop-rake (0.7.1)
|
|
139
|
+
lint_roller (~> 1.1)
|
|
140
|
+
rubocop (>= 1.72.1)
|
|
141
|
+
rubocop-rspec (3.6.0)
|
|
142
|
+
lint_roller (~> 1.1)
|
|
143
|
+
rubocop (~> 1.72, >= 1.72.1)
|
|
136
144
|
ruby-progressbar (1.13.0)
|
|
137
145
|
ruby_git_crypt (0.1.0)
|
|
138
146
|
immutable-struct (~> 2.4)
|
|
139
147
|
lino (>= 4.1)
|
|
140
148
|
ruby_gpg2 (0.12.0)
|
|
141
149
|
lino (>= 4.1)
|
|
142
|
-
sawyer (0.9.
|
|
150
|
+
sawyer (0.9.3)
|
|
143
151
|
addressable (>= 2.3.5)
|
|
144
152
|
faraday (>= 0.17.3, < 3)
|
|
153
|
+
securerandom (0.4.1)
|
|
145
154
|
simplecov (0.22.0)
|
|
146
155
|
docile (~> 1.1)
|
|
147
156
|
simplecov-html (~> 0.11)
|
|
@@ -149,11 +158,12 @@ GEM
|
|
|
149
158
|
simplecov-html (0.12.3)
|
|
150
159
|
simplecov_json_formatter (0.1.4)
|
|
151
160
|
sshkey (2.0.0)
|
|
152
|
-
strscan (3.1.0)
|
|
153
161
|
tzinfo (2.0.6)
|
|
154
162
|
concurrent-ruby (~> 1.0)
|
|
155
|
-
unicode-display_width (
|
|
156
|
-
|
|
163
|
+
unicode-display_width (3.1.4)
|
|
164
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
|
165
|
+
unicode-emoji (4.0.4)
|
|
166
|
+
uri (1.1.1)
|
|
157
167
|
|
|
158
168
|
PLATFORMS
|
|
159
169
|
arm64-darwin-21
|
|
@@ -167,13 +177,12 @@ DEPENDENCIES
|
|
|
167
177
|
gem-release
|
|
168
178
|
memfs
|
|
169
179
|
rake
|
|
170
|
-
rake_circle_ci
|
|
171
180
|
rake_gcp!
|
|
172
181
|
rake_git
|
|
173
182
|
rake_git_crypt
|
|
174
183
|
rake_github
|
|
175
184
|
rake_gpg
|
|
176
|
-
|
|
185
|
+
rake_slack
|
|
177
186
|
rspec
|
|
178
187
|
rubocop
|
|
179
188
|
rubocop-rake
|
data/README.md
CHANGED
|
@@ -34,16 +34,16 @@ release a new version, update the version number in `version.rb`, and then run
|
|
|
34
34
|
git commits and tags, and push the `.gem` file to
|
|
35
35
|
[rubygems.org](https://rubygems.org).
|
|
36
36
|
|
|
37
|
-
### Managing
|
|
37
|
+
### Managing CI keys
|
|
38
38
|
|
|
39
|
-
To encrypt a GPG key for use by
|
|
39
|
+
To encrypt a GPG key for use by CI:
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
42
|
openssl aes-256-cbc \
|
|
43
43
|
-e \
|
|
44
44
|
-md sha1 \
|
|
45
45
|
-in ./config/secrets/ci/gpg.private \
|
|
46
|
-
-out ./.
|
|
46
|
+
-out ./.github/gpg.private.enc \
|
|
47
47
|
-k "<passphrase>"
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -53,7 +53,7 @@ To check decryption is working correctly:
|
|
|
53
53
|
openssl aes-256-cbc \
|
|
54
54
|
-d \
|
|
55
55
|
-md sha1 \
|
|
56
|
-
-in ./.
|
|
56
|
+
-in ./.github/gpg.private.enc \
|
|
57
57
|
-k "<passphrase>"
|
|
58
58
|
```
|
|
59
59
|
|
data/Rakefile
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'rake_circle_ci'
|
|
4
3
|
require 'rake_git'
|
|
5
4
|
require 'rake_git_crypt'
|
|
6
5
|
require 'rake_github'
|
|
7
6
|
require 'rake_gpg'
|
|
8
|
-
require '
|
|
7
|
+
require 'rake_slack'
|
|
9
8
|
require 'rspec/core/rake_task'
|
|
10
9
|
require 'rubocop/rake_task'
|
|
11
10
|
require 'securerandom'
|
|
12
|
-
require 'yaml'
|
|
13
11
|
|
|
14
12
|
task default: %i[
|
|
15
13
|
library:fix
|
|
@@ -59,13 +57,6 @@ namespace :encryption do
|
|
|
59
57
|
end
|
|
60
58
|
|
|
61
59
|
namespace :keys do
|
|
62
|
-
namespace :deploy do
|
|
63
|
-
RakeSSH.define_key_tasks(
|
|
64
|
-
path: 'config/secrets/ci/',
|
|
65
|
-
comment: 'maintainers@infrablocks.io'
|
|
66
|
-
)
|
|
67
|
-
end
|
|
68
|
-
|
|
69
60
|
namespace :gpg do
|
|
70
61
|
RakeGPG.define_generate_key_task(
|
|
71
62
|
output_directory: 'config/secrets/ci',
|
|
@@ -91,7 +82,6 @@ namespace :secrets do
|
|
|
91
82
|
desc 'Generate all generatable secrets.'
|
|
92
83
|
task generate: %w[
|
|
93
84
|
encryption:passphrase:generate
|
|
94
|
-
keys:deploy:generate
|
|
95
85
|
keys:gpg:generate
|
|
96
86
|
]
|
|
97
87
|
|
|
@@ -115,57 +105,98 @@ namespace :library do
|
|
|
115
105
|
|
|
116
106
|
desc 'Attempt to automatically fix issues with the library'
|
|
117
107
|
task fix: [:'rubocop:autocorrect_all']
|
|
108
|
+
|
|
109
|
+
desc 'Build the library'
|
|
110
|
+
task :build do
|
|
111
|
+
sh 'gem build rake_gcp.gemspec'
|
|
112
|
+
end
|
|
118
113
|
end
|
|
119
114
|
|
|
120
115
|
namespace :test do
|
|
121
116
|
RSpec::Core::RakeTask.new(:unit)
|
|
122
117
|
end
|
|
123
118
|
|
|
124
|
-
RakeCircleCI.define_project_tasks(
|
|
125
|
-
namespace: :circle_ci,
|
|
126
|
-
project_slug: 'github/infrablocks/rake_gcp'
|
|
127
|
-
) do |t|
|
|
128
|
-
circle_ci_config =
|
|
129
|
-
YAML.load_file('config/secrets/circle_ci/config.yaml')
|
|
130
|
-
|
|
131
|
-
t.api_token = circle_ci_config['circle_ci_api_token']
|
|
132
|
-
t.environment_variables = {
|
|
133
|
-
ENCRYPTION_PASSPHRASE:
|
|
134
|
-
File.read('config/secrets/ci/encryption.passphrase')
|
|
135
|
-
.chomp
|
|
136
|
-
}
|
|
137
|
-
t.checkout_keys = []
|
|
138
|
-
t.ssh_keys = [
|
|
139
|
-
{
|
|
140
|
-
hostname: 'github.com',
|
|
141
|
-
private_key: File.read('config/secrets/ci/ssh.private')
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
end
|
|
145
|
-
|
|
146
119
|
RakeGithub.define_repository_tasks(
|
|
147
120
|
namespace: :github,
|
|
148
121
|
repository: 'infrablocks/rake_gcp'
|
|
149
122
|
) do |t|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
123
|
+
# Operator's ambient auth. Resolve once and fail fast: a missing,
|
|
124
|
+
# unauthenticated, or absent gh yields an empty string, which would
|
|
125
|
+
# otherwise surface later as an opaque Octokit 401. An empty or
|
|
126
|
+
# whitespace-only GITHUB_TOKEN is treated as absent so an authenticated
|
|
127
|
+
# operator falls through to `gh auth token` rather than hitting the raise.
|
|
128
|
+
github_token = ENV['GITHUB_TOKEN'].to_s.strip
|
|
129
|
+
if github_token.empty?
|
|
130
|
+
github_token = begin
|
|
131
|
+
`gh auth token`
|
|
132
|
+
rescue Errno::ENOENT
|
|
133
|
+
''
|
|
134
|
+
end.strip
|
|
135
|
+
end
|
|
136
|
+
if github_token.empty?
|
|
137
|
+
raise 'No GitHub token available: set GITHUB_TOKEN or run `gh auth login`'
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
t.access_token = github_token
|
|
141
|
+
|
|
142
|
+
# Actions store only: dependabot runs never reach the passphrase — the
|
|
143
|
+
# only pr.yaml job that unlocks git-crypt (prerelease) is guarded to
|
|
144
|
+
# same-repo human PRs. Guard against a locked clone: without
|
|
145
|
+
# it, File.read returns git-crypt ciphertext and github:secrets:ensure
|
|
146
|
+
# silently uploads garbage that only surfaces much later as an opaque
|
|
147
|
+
# GPG unlock failure in the release job.
|
|
148
|
+
passphrase_path = 'config/secrets/ci/encryption.passphrase'
|
|
149
|
+
unless File.exist?(passphrase_path)
|
|
150
|
+
raise "Passphrase file not found: #{passphrase_path} — expected a " \
|
|
151
|
+
'git-crypt-unlocked clone with the CI secrets present'
|
|
152
|
+
end
|
|
153
|
+
passphrase = File.binread(passphrase_path)
|
|
154
|
+
if passphrase.start_with?("\x00GITCRYPT")
|
|
155
|
+
raise 'encryption.passphrase is git-crypt ciphertext — unlock the ' \
|
|
156
|
+
'clone before provisioning'
|
|
157
|
+
end
|
|
158
|
+
t.secrets = [
|
|
159
|
+
{ name: 'ENCRYPTION_PASSPHRASE', value: passphrase.chomp }
|
|
159
160
|
]
|
|
161
|
+
t.environments = [
|
|
162
|
+
{ name: 'release',
|
|
163
|
+
reviewers: [{ team: 'maintainers' }] }
|
|
164
|
+
]
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
namespace :slack do
|
|
168
|
+
RakeSlack.define_notification_tasks do |t|
|
|
169
|
+
t.bot_token = ENV.fetch('SLACK_BOT_TOKEN', nil)
|
|
170
|
+
t.routing_rules = [
|
|
171
|
+
{ when: { type: 'on_hold' },
|
|
172
|
+
channel: 'C038EDCRSQJ', format: :on_hold }, # release
|
|
173
|
+
{ when: { actor: 'dependabot[bot]', outcome: 'success' },
|
|
174
|
+
channel: 'C03N711HVDG', format: :success }, # builds-dependabot
|
|
175
|
+
{ when: { actor: 'dependabot[bot]' },
|
|
176
|
+
channel: 'C03N711HVDG', format: :failure }, # builds-dependabot
|
|
177
|
+
{ when: { outcome: 'success' },
|
|
178
|
+
channel: 'C023XUE76GH', format: :success }, # builds
|
|
179
|
+
# Failures go to builds, not team-dev (org default), to keep noise
|
|
180
|
+
# out of a popular channel while this pipeline beds in.
|
|
181
|
+
{ when: {},
|
|
182
|
+
channel: 'C023XUE76GH', format: :failure } # builds
|
|
183
|
+
]
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
namespace :repository do
|
|
188
|
+
desc 'Set the git author for CI'
|
|
189
|
+
task :set_ci_author do
|
|
190
|
+
sh 'git config --global user.name "InfraBlocks CI"'
|
|
191
|
+
sh 'git config --global user.email "ci@infrablocks.io"'
|
|
192
|
+
end
|
|
160
193
|
end
|
|
161
194
|
|
|
162
195
|
namespace :pipeline do
|
|
163
|
-
desc 'Prepare
|
|
196
|
+
desc 'Prepare GitHub Actions pipeline'
|
|
164
197
|
task prepare: %i[
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
circle_ci:ssh_keys:ensure
|
|
168
|
-
github:deploy_keys:ensure
|
|
198
|
+
github:secrets:ensure
|
|
199
|
+
github:environments:ensure
|
|
169
200
|
]
|
|
170
201
|
end
|
|
171
202
|
|
|
@@ -176,6 +207,38 @@ namespace :version do
|
|
|
176
207
|
end
|
|
177
208
|
end
|
|
178
209
|
|
|
210
|
+
namespace :prerelease do
|
|
211
|
+
desc 'Build and push a namespaced pre-release to RubyGems ' \
|
|
212
|
+
'(PR CI only; no bump, no tag, no commit, no push)'
|
|
213
|
+
task :publish, %i[pr_number run_number run_attempt] do |_, args|
|
|
214
|
+
%i[pr_number run_number run_attempt].each do |name|
|
|
215
|
+
raise "Missing task argument: #{name}" if args[name].to_s.empty?
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
version_file = 'lib/rake_gcp/version.rb'
|
|
219
|
+
version_pattern = /(VERSION\s*=\s*')([^']+)(')/
|
|
220
|
+
source = File.read(version_file)
|
|
221
|
+
base = source[version_pattern, 2]
|
|
222
|
+
raise "Could not read VERSION from #{version_file}" unless base
|
|
223
|
+
|
|
224
|
+
version = "#{base}.pr#{args.pr_number}" \
|
|
225
|
+
".#{args.run_number}.#{args.run_attempt}"
|
|
226
|
+
gem_file = "rake_gcp-#{version}.gem"
|
|
227
|
+
begin
|
|
228
|
+
File.write(version_file,
|
|
229
|
+
source.sub(version_pattern, "\\1#{version}\\3"))
|
|
230
|
+
# Build + push directly: `gem release` aborts on the (deliberately)
|
|
231
|
+
# uncommitted version rewrite. PR CI must not tag, commit, or push
|
|
232
|
+
# (contrast the `release` task).
|
|
233
|
+
sh 'gem build rake_gcp.gemspec'
|
|
234
|
+
sh "gem push #{gem_file}"
|
|
235
|
+
ensure
|
|
236
|
+
File.write(version_file, source)
|
|
237
|
+
rm_f gem_file
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
end
|
|
241
|
+
|
|
179
242
|
desc 'Release gem'
|
|
180
243
|
task :release do
|
|
181
244
|
sh 'gem release --tag --push'
|
data/lib/rake_gcp/version.rb
CHANGED
data/rake_gcp.gemspec
CHANGED
|
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
|
34
34
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
35
35
|
spec.require_paths = ['lib']
|
|
36
36
|
|
|
37
|
-
spec.required_ruby_version = '>= 3.
|
|
37
|
+
spec.required_ruby_version = '>= 3.3'
|
|
38
38
|
|
|
39
39
|
spec.add_dependency 'colored2', '~> 3.1'
|
|
40
40
|
spec.add_dependency 'rake_factory', '~> 0.33'
|
|
@@ -44,12 +44,11 @@ Gem::Specification.new do |spec|
|
|
|
44
44
|
spec.add_development_dependency 'gem-release'
|
|
45
45
|
spec.add_development_dependency 'memfs'
|
|
46
46
|
spec.add_development_dependency 'rake'
|
|
47
|
-
spec.add_development_dependency 'rake_circle_ci'
|
|
48
47
|
spec.add_development_dependency 'rake_git'
|
|
49
48
|
spec.add_development_dependency 'rake_git_crypt'
|
|
50
49
|
spec.add_development_dependency 'rake_github'
|
|
51
50
|
spec.add_development_dependency 'rake_gpg'
|
|
52
|
-
spec.add_development_dependency '
|
|
51
|
+
spec.add_development_dependency 'rake_slack'
|
|
53
52
|
spec.add_development_dependency 'rspec'
|
|
54
53
|
spec.add_development_dependency 'rubocop'
|
|
55
54
|
spec.add_development_dependency 'rubocop-rake'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rake_gcp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.0.pre.2
|
|
4
|
+
version: 0.3.0.pre.2.pr137.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- InfraBlocks Maintainers
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-07-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: colored2
|
|
@@ -108,20 +108,6 @@ dependencies:
|
|
|
108
108
|
- - ">="
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: '0'
|
|
111
|
-
- !ruby/object:Gem::Dependency
|
|
112
|
-
name: rake_circle_ci
|
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
|
114
|
-
requirements:
|
|
115
|
-
- - ">="
|
|
116
|
-
- !ruby/object:Gem::Version
|
|
117
|
-
version: '0'
|
|
118
|
-
type: :development
|
|
119
|
-
prerelease: false
|
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
-
requirements:
|
|
122
|
-
- - ">="
|
|
123
|
-
- !ruby/object:Gem::Version
|
|
124
|
-
version: '0'
|
|
125
111
|
- !ruby/object:Gem::Dependency
|
|
126
112
|
name: rake_git
|
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -179,7 +165,7 @@ dependencies:
|
|
|
179
165
|
- !ruby/object:Gem::Version
|
|
180
166
|
version: '0'
|
|
181
167
|
- !ruby/object:Gem::Dependency
|
|
182
|
-
name:
|
|
168
|
+
name: rake_slack
|
|
183
169
|
requirement: !ruby/object:Gem::Requirement
|
|
184
170
|
requirements:
|
|
185
171
|
- - ">="
|
|
@@ -285,7 +271,7 @@ licenses:
|
|
|
285
271
|
- MIT
|
|
286
272
|
metadata:
|
|
287
273
|
rubygems_mfa_required: 'false'
|
|
288
|
-
post_install_message:
|
|
274
|
+
post_install_message:
|
|
289
275
|
rdoc_options: []
|
|
290
276
|
require_paths:
|
|
291
277
|
- lib
|
|
@@ -293,15 +279,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
293
279
|
requirements:
|
|
294
280
|
- - ">="
|
|
295
281
|
- !ruby/object:Gem::Version
|
|
296
|
-
version: '3.
|
|
282
|
+
version: '3.3'
|
|
297
283
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
284
|
requirements:
|
|
299
|
-
- - "
|
|
285
|
+
- - ">="
|
|
300
286
|
- !ruby/object:Gem::Version
|
|
301
|
-
version:
|
|
287
|
+
version: '0'
|
|
302
288
|
requirements: []
|
|
303
|
-
rubygems_version: 3.
|
|
304
|
-
signing_key:
|
|
289
|
+
rubygems_version: 3.5.22
|
|
290
|
+
signing_key:
|
|
305
291
|
specification_version: 4
|
|
306
292
|
summary: Rake tasks for interacting with GCP.
|
|
307
293
|
test_files: []
|