rake_secrets 0.3.0.pre.2 → 0.3.0.pre.3
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 +1 -2
- data/Gemfile.lock +84 -75
- data/README.md +4 -4
- data/Rakefile +112 -47
- data/lib/rake_secrets/version.rb +1 -1
- data/rake_secrets.gemspec +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: df6bf2a473c675a20dbf2ac4d75b4bcf5344a1472bd041a9d8ecb699e192881b
|
|
4
|
+
data.tar.gz: 40941ed972c2b637c2ca5061975048d0da62949761fa98d814da829f094cbdc9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b085df4daae384c26136e9cd032694088b56bbc8d6bfb2269e28a7d91e72cf25cab6e6bad194264db1c07df713b72b01988a62c30fd726f7dad91a66b06494a6
|
|
7
|
+
data.tar.gz: 2ffd06849791c4cdf5759293d483ee41eaa25c927bd5888b69f49a64f33a05cba5110f65c2f5b793f10dca42cba4eec576780263fa2503d651448042bf37e254
|
data/Gemfile
CHANGED
|
@@ -10,12 +10,11 @@ gem 'bundler'
|
|
|
10
10
|
gem 'gem-release'
|
|
11
11
|
gem 'memfs'
|
|
12
12
|
gem 'rake'
|
|
13
|
-
gem 'rake_circle_ci'
|
|
14
13
|
gem 'rake_git'
|
|
15
14
|
gem 'rake_git_crypt'
|
|
16
15
|
gem 'rake_github'
|
|
17
16
|
gem 'rake_gpg'
|
|
18
|
-
gem '
|
|
17
|
+
gem 'rake_slack'
|
|
19
18
|
gem 'rspec'
|
|
20
19
|
gem 'rubocop'
|
|
21
20
|
gem 'rubocop-rake'
|
data/Gemfile.lock
CHANGED
|
@@ -1,80 +1,84 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rake_secrets (0.3.0.pre.
|
|
4
|
+
rake_secrets (0.3.0.pre.3)
|
|
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.76.0)
|
|
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.45.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.45.0)
|
|
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
|
|
@@ -169,13 +179,12 @@ DEPENDENCIES
|
|
|
169
179
|
gem-release
|
|
170
180
|
memfs
|
|
171
181
|
rake
|
|
172
|
-
rake_circle_ci
|
|
173
182
|
rake_git
|
|
174
183
|
rake_git_crypt
|
|
175
184
|
rake_github
|
|
176
185
|
rake_gpg
|
|
177
186
|
rake_secrets!
|
|
178
|
-
|
|
187
|
+
rake_slack
|
|
179
188
|
rspec
|
|
180
189
|
rubocop
|
|
181
190
|
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,100 @@ 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_secrets.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
|
-
|
|
125
|
-
namespace: :circle_ci,
|
|
126
|
-
project_slug: 'github/infrablocks/rake_secrets'
|
|
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
|
-
|
|
119
|
+
# rubocop:disable Metrics/BlockLength
|
|
146
120
|
RakeGithub.define_repository_tasks(
|
|
147
121
|
namespace: :github,
|
|
148
122
|
repository: 'infrablocks/rake_secrets'
|
|
149
123
|
) do |t|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
124
|
+
# Operator's ambient auth. Resolve once and fail fast: a missing,
|
|
125
|
+
# unauthenticated, or absent gh yields an empty string, which would
|
|
126
|
+
# otherwise surface later as an opaque Octokit 401. An empty or
|
|
127
|
+
# whitespace-only GITHUB_TOKEN is treated as absent so an authenticated
|
|
128
|
+
# operator falls through to `gh auth token` rather than hitting the raise.
|
|
129
|
+
github_token = ENV['GITHUB_TOKEN'].to_s.strip
|
|
130
|
+
if github_token.empty?
|
|
131
|
+
github_token = begin
|
|
132
|
+
`gh auth token`
|
|
133
|
+
rescue Errno::ENOENT
|
|
134
|
+
''
|
|
135
|
+
end.strip
|
|
136
|
+
end
|
|
137
|
+
if github_token.empty?
|
|
138
|
+
raise 'No GitHub token available: set GITHUB_TOKEN or run `gh auth login`'
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
t.access_token = github_token
|
|
142
|
+
|
|
143
|
+
# Actions store only: dependabot runs never reach the passphrase — the
|
|
144
|
+
# only pr.yaml job that unlocks git-crypt (prerelease) is guarded to
|
|
145
|
+
# same-repo human PRs. Guard against a locked clone: without
|
|
146
|
+
# it, File.read returns git-crypt ciphertext and github:secrets:ensure
|
|
147
|
+
# silently uploads garbage that only surfaces much later as an opaque
|
|
148
|
+
# GPG unlock failure in the release job.
|
|
149
|
+
passphrase_path = 'config/secrets/ci/encryption.passphrase'
|
|
150
|
+
unless File.exist?(passphrase_path)
|
|
151
|
+
raise "Passphrase file not found: #{passphrase_path} — expected a " \
|
|
152
|
+
'git-crypt-unlocked clone with the CI secrets present'
|
|
153
|
+
end
|
|
154
|
+
passphrase = File.binread(passphrase_path)
|
|
155
|
+
if passphrase.start_with?("\x00GITCRYPT")
|
|
156
|
+
raise 'encryption.passphrase is git-crypt ciphertext — unlock the ' \
|
|
157
|
+
'clone before provisioning'
|
|
158
|
+
end
|
|
159
|
+
t.secrets = [
|
|
160
|
+
{ name: 'ENCRYPTION_PASSPHRASE', value: passphrase.chomp }
|
|
161
|
+
]
|
|
162
|
+
t.environments = [
|
|
163
|
+
{ name: 'release',
|
|
164
|
+
reviewers: [{ team: 'maintainers' }] }
|
|
159
165
|
]
|
|
160
166
|
end
|
|
167
|
+
# rubocop:enable Metrics/BlockLength
|
|
168
|
+
|
|
169
|
+
namespace :slack do
|
|
170
|
+
RakeSlack.define_notification_tasks do |t|
|
|
171
|
+
t.bot_token = ENV.fetch('SLACK_BOT_TOKEN', nil)
|
|
172
|
+
t.routing_rules = [
|
|
173
|
+
{ when: { type: 'on_hold' },
|
|
174
|
+
channel: 'C038EDCRSQJ', format: :on_hold }, # release
|
|
175
|
+
{ when: { actor: 'dependabot[bot]', outcome: 'success' },
|
|
176
|
+
channel: 'C03N711HVDG', format: :success }, # builds-dependabot
|
|
177
|
+
{ when: { actor: 'dependabot[bot]' },
|
|
178
|
+
channel: 'C03N711HVDG', format: :failure }, # builds-dependabot
|
|
179
|
+
{ when: { outcome: 'success' },
|
|
180
|
+
channel: 'C023XUE76GH', format: :success }, # builds
|
|
181
|
+
# Failures go to builds, not team-dev (org default), to keep noise
|
|
182
|
+
# out of a popular channel while this pipeline beds in.
|
|
183
|
+
{ when: {},
|
|
184
|
+
channel: 'C023XUE76GH', format: :failure } # builds
|
|
185
|
+
]
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
namespace :repository do
|
|
190
|
+
desc 'Set the git author for CI'
|
|
191
|
+
task :set_ci_author do
|
|
192
|
+
sh 'git config --global user.name "InfraBlocks CI"'
|
|
193
|
+
sh 'git config --global user.email "ci@infrablocks.io"'
|
|
194
|
+
end
|
|
195
|
+
end
|
|
161
196
|
|
|
162
197
|
namespace :pipeline do
|
|
163
|
-
desc 'Prepare
|
|
198
|
+
desc 'Prepare GitHub Actions pipeline'
|
|
164
199
|
task prepare: %i[
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
circle_ci:ssh_keys:ensure
|
|
168
|
-
github:deploy_keys:ensure
|
|
200
|
+
github:secrets:ensure
|
|
201
|
+
github:environments:ensure
|
|
169
202
|
]
|
|
170
203
|
end
|
|
171
204
|
|
|
@@ -176,6 +209,38 @@ namespace :version do
|
|
|
176
209
|
end
|
|
177
210
|
end
|
|
178
211
|
|
|
212
|
+
namespace :prerelease do
|
|
213
|
+
desc 'Build and push a namespaced pre-release to RubyGems ' \
|
|
214
|
+
'(PR CI only; no bump, no tag, no commit, no push)'
|
|
215
|
+
task :publish, %i[pr_number run_number run_attempt] do |_, args|
|
|
216
|
+
%i[pr_number run_number run_attempt].each do |name|
|
|
217
|
+
raise "Missing task argument: #{name}" if args[name].to_s.empty?
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
version_file = 'lib/rake_secrets/version.rb'
|
|
221
|
+
version_pattern = /(VERSION\s*=\s*')([^']+)(')/
|
|
222
|
+
source = File.read(version_file)
|
|
223
|
+
base = source[version_pattern, 2]
|
|
224
|
+
raise "Could not read VERSION from #{version_file}" unless base
|
|
225
|
+
|
|
226
|
+
version = "#{base}.pr#{args.pr_number}" \
|
|
227
|
+
".#{args.run_number}.#{args.run_attempt}"
|
|
228
|
+
gem_file = "rake_secrets-#{version}.gem"
|
|
229
|
+
begin
|
|
230
|
+
File.write(version_file,
|
|
231
|
+
source.sub(version_pattern, "\\1#{version}\\3"))
|
|
232
|
+
# Build + push directly: `gem release` aborts on the (deliberately)
|
|
233
|
+
# uncommitted version rewrite. PR CI must not tag, commit, or push
|
|
234
|
+
# (contrast the `release` task).
|
|
235
|
+
sh 'gem build rake_secrets.gemspec'
|
|
236
|
+
sh "gem push #{gem_file}"
|
|
237
|
+
ensure
|
|
238
|
+
File.write(version_file, source)
|
|
239
|
+
rm_f gem_file
|
|
240
|
+
end
|
|
241
|
+
end
|
|
242
|
+
end
|
|
243
|
+
|
|
179
244
|
desc 'Release gem'
|
|
180
245
|
task :release do
|
|
181
246
|
sh 'gem release --tag --push'
|
data/lib/rake_secrets/version.rb
CHANGED
data/rake_secrets.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'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rake_secrets
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.0.pre.
|
|
4
|
+
version: 0.3.0.pre.3
|
|
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-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: colored2
|
|
@@ -84,7 +84,7 @@ licenses:
|
|
|
84
84
|
- MIT
|
|
85
85
|
metadata:
|
|
86
86
|
rubygems_mfa_required: 'false'
|
|
87
|
-
post_install_message:
|
|
87
|
+
post_install_message:
|
|
88
88
|
rdoc_options: []
|
|
89
89
|
require_paths:
|
|
90
90
|
- lib
|
|
@@ -92,15 +92,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
92
92
|
requirements:
|
|
93
93
|
- - ">="
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: '3.
|
|
95
|
+
version: '3.3'
|
|
96
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
requirements:
|
|
98
|
-
- - "
|
|
98
|
+
- - ">="
|
|
99
99
|
- !ruby/object:Gem::Version
|
|
100
|
-
version:
|
|
100
|
+
version: '0'
|
|
101
101
|
requirements: []
|
|
102
|
-
rubygems_version: 3.
|
|
103
|
-
signing_key:
|
|
102
|
+
rubygems_version: 3.5.22
|
|
103
|
+
signing_key:
|
|
104
104
|
specification_version: 4
|
|
105
105
|
summary: Rake tasks for managing secrets.
|
|
106
106
|
test_files: []
|