ruby_git_crypt 0.2.0.pre.2 → 0.2.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 +5 -0
- data/Gemfile.lock +104 -99
- data/README.md +4 -4
- data/Rakefile +111 -48
- data/lib/ruby_git_crypt/options/types.rb +2 -2
- data/lib/ruby_git_crypt/version.rb +1 -1
- data/ruby_git_crypt.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: 730591090775706e7dd3dc1ce3e1a49f96f61802d7c00a840b0d48619ec1a41e
|
|
4
|
+
data.tar.gz: b9eb1810cd6733a643aba3863bc86c1165a91bb045976eb82ea3b7e4a011a9e3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c7f668740fd8f25d140193f3f23ba4dbbf27bf3da10250cb34f57b31207e11a4b37bcd3f3aba3d5e0f212e25ce2d0e70143a5d88555daa20757b93c43d52c22
|
|
7
|
+
data.tar.gz: ad291979498e3b6be7a6c0afe69f7a4c224b53e36f949e40703a909bc0968732c49240790777abc5700a28d51a5b2e7a2c3e74f06d7ba8259926f2ea34187d04
|
data/Gemfile
CHANGED
|
@@ -4,3 +4,8 @@ source 'https://rubygems.org'
|
|
|
4
4
|
|
|
5
5
|
# Specify your gem's dependencies in ruby_git_crypt.gemspec
|
|
6
6
|
gemspec
|
|
7
|
+
|
|
8
|
+
# Hold these to their stable lines: a floor-only requirement lets bundler
|
|
9
|
+
# prefer a prerelease even when a stable release satisfies every dependant.
|
|
10
|
+
gem 'rake_factory', '~> 0.33'
|
|
11
|
+
gem 'rake_git', '~> 0.2'
|
data/Gemfile.lock
CHANGED
|
@@ -1,56 +1,64 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ruby_git_crypt (0.2.0.pre.
|
|
4
|
+
ruby_git_crypt (0.2.0.pre.3)
|
|
5
5
|
immutable-struct (~> 2.4)
|
|
6
6
|
lino (>= 4.1)
|
|
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
|
coderay (1.1.3)
|
|
28
31
|
colored2 (3.1.2)
|
|
29
|
-
concurrent-ruby (1.3.
|
|
30
|
-
connection_pool (
|
|
31
|
-
diff-lcs (1.
|
|
32
|
+
concurrent-ruby (1.3.8)
|
|
33
|
+
connection_pool (3.0.2)
|
|
34
|
+
diff-lcs (1.6.2)
|
|
32
35
|
docile (1.4.0)
|
|
33
|
-
drb (2.2.
|
|
34
|
-
excon (
|
|
35
|
-
|
|
36
|
+
drb (2.2.3)
|
|
37
|
+
excon (1.6.0)
|
|
38
|
+
logger
|
|
39
|
+
faker (3.5.1)
|
|
36
40
|
i18n (>= 1.8.11, < 2)
|
|
37
|
-
faraday (2.
|
|
38
|
-
faraday-net_http (>= 2.0, < 3.
|
|
41
|
+
faraday (2.14.3)
|
|
42
|
+
faraday-net_http (>= 2.0, < 3.5)
|
|
43
|
+
json
|
|
39
44
|
logger
|
|
40
|
-
faraday-net_http (3.
|
|
41
|
-
net-http
|
|
42
|
-
ffi (1.17.
|
|
45
|
+
faraday-net_http (3.4.4)
|
|
46
|
+
net-http (~> 0.5)
|
|
47
|
+
ffi (1.17.1)
|
|
48
|
+
ffi (1.17.1-x86_64-linux-gnu)
|
|
43
49
|
formatador (1.1.0)
|
|
44
|
-
gem-release (2.2.
|
|
50
|
+
gem-release (2.2.4)
|
|
45
51
|
git (1.19.1)
|
|
46
52
|
addressable (~> 2.8)
|
|
47
53
|
rchardet (~> 1.8)
|
|
48
|
-
guard (2.
|
|
54
|
+
guard (2.19.1)
|
|
49
55
|
formatador (>= 0.2.4)
|
|
50
56
|
listen (>= 2.7, < 4.0)
|
|
57
|
+
logger (~> 1.6)
|
|
51
58
|
lumberjack (>= 1.0.12, < 2.0)
|
|
52
59
|
nenv (~> 0.1)
|
|
53
60
|
notiffany (~> 0.0)
|
|
61
|
+
ostruct (~> 0.6)
|
|
54
62
|
pry (>= 0.13.0)
|
|
55
63
|
shellany (~> 0.0)
|
|
56
64
|
thor (>= 0.18.1)
|
|
@@ -61,117 +69,118 @@ GEM
|
|
|
61
69
|
rspec (>= 2.99.0, < 4.0)
|
|
62
70
|
hamster (3.0.0)
|
|
63
71
|
concurrent-ruby (~> 1.0)
|
|
64
|
-
i18n (1.
|
|
72
|
+
i18n (1.15.2)
|
|
65
73
|
concurrent-ruby (~> 1.0)
|
|
66
|
-
immutable-struct (2.
|
|
67
|
-
json (2.
|
|
68
|
-
language_server-protocol (3.17.0.
|
|
74
|
+
immutable-struct (2.5.0)
|
|
75
|
+
json (2.21.1)
|
|
76
|
+
language_server-protocol (3.17.0.5)
|
|
69
77
|
lino (4.1.0)
|
|
70
78
|
childprocess (~> 5.0.0)
|
|
71
79
|
hamster (~> 3.0)
|
|
72
80
|
open4 (~> 1.3)
|
|
81
|
+
lint_roller (1.1.0)
|
|
73
82
|
listen (3.9.0)
|
|
74
83
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
75
84
|
rb-inotify (~> 0.9, >= 0.9.10)
|
|
76
|
-
logger (1.
|
|
85
|
+
logger (1.7.0)
|
|
77
86
|
lumberjack (1.2.10)
|
|
78
87
|
method_source (1.1.0)
|
|
79
|
-
minitest (5.
|
|
80
|
-
mutex_m (0.2.0)
|
|
88
|
+
minitest (5.27.0)
|
|
81
89
|
nenv (0.3.0)
|
|
82
|
-
net-http (0.
|
|
83
|
-
uri
|
|
90
|
+
net-http (0.9.1)
|
|
91
|
+
uri (>= 0.11.1)
|
|
84
92
|
notiffany (0.1.3)
|
|
85
93
|
nenv (~> 0.1)
|
|
86
94
|
shellany (~> 0.0)
|
|
87
|
-
octokit (
|
|
88
|
-
base64
|
|
95
|
+
octokit (10.0.0)
|
|
89
96
|
faraday (>= 1, < 3)
|
|
90
97
|
sawyer (~> 0.9)
|
|
91
98
|
open4 (1.3.4)
|
|
92
|
-
|
|
93
|
-
|
|
99
|
+
ostruct (0.6.1)
|
|
100
|
+
parallel (1.27.0)
|
|
101
|
+
parser (3.3.8.0)
|
|
94
102
|
ast (~> 2.4.1)
|
|
95
103
|
racc
|
|
96
|
-
|
|
104
|
+
prism (1.4.0)
|
|
105
|
+
pry (0.15.2)
|
|
97
106
|
coderay (~> 1.1)
|
|
98
107
|
method_source (~> 1.0)
|
|
99
|
-
public_suffix (
|
|
100
|
-
racc (1.8.
|
|
108
|
+
public_suffix (7.0.5)
|
|
109
|
+
racc (1.8.1)
|
|
101
110
|
rainbow (3.1.1)
|
|
102
|
-
rake (13.2
|
|
103
|
-
|
|
104
|
-
colored2 (~> 3.1)
|
|
105
|
-
excon (~> 0.72)
|
|
106
|
-
rake_factory (~> 0.23)
|
|
107
|
-
sshkey (~> 2.0)
|
|
108
|
-
rake_factory (0.32.0.pre.2)
|
|
111
|
+
rake (13.4.2)
|
|
112
|
+
rake_factory (0.33.0)
|
|
109
113
|
activesupport (>= 4)
|
|
110
114
|
rake (~> 13.0)
|
|
111
|
-
rake_git (0.
|
|
115
|
+
rake_git (0.2.0)
|
|
112
116
|
colored2 (~> 3.1)
|
|
113
117
|
git (~> 1.13, >= 1.13.2)
|
|
114
|
-
rake_factory (
|
|
115
|
-
rake_git_crypt (0.
|
|
118
|
+
rake_factory (~> 0.33)
|
|
119
|
+
rake_git_crypt (0.4.0)
|
|
116
120
|
colored2 (~> 3.1)
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
lino (~> 4.1)
|
|
122
|
+
rake_factory (~> 0.33)
|
|
123
|
+
ruby_git_crypt (~> 0.1)
|
|
124
|
+
ruby_gpg2 (~> 0.12)
|
|
125
|
+
rake_github (0.17.0)
|
|
121
126
|
colored2 (~> 3.1)
|
|
122
|
-
octokit (>=
|
|
123
|
-
rake_factory (~> 0.
|
|
124
|
-
|
|
125
|
-
rake_gpg (0.18.0)
|
|
126
|
-
rake_factory (~> 0.23)
|
|
127
|
-
ruby_gpg2 (~> 0.6)
|
|
128
|
-
rake_ssh (0.10.0)
|
|
129
|
-
colored2 (~> 3.1)
|
|
130
|
-
rake_factory (~> 0.23)
|
|
127
|
+
octokit (>= 7.0, < 11.0)
|
|
128
|
+
rake_factory (~> 0.33)
|
|
129
|
+
rbnacl (~> 7.1)
|
|
131
130
|
sshkey (~> 2.0)
|
|
131
|
+
rake_gpg (0.20.0)
|
|
132
|
+
rake_factory (~> 0.33)
|
|
133
|
+
ruby_gpg2 (~> 0.12)
|
|
134
|
+
rake_slack (0.3.0)
|
|
135
|
+
excon (>= 0.72, < 2.0)
|
|
136
|
+
rake_factory (~> 0.33)
|
|
132
137
|
rb-fsevent (0.11.2)
|
|
133
138
|
rb-inotify (0.11.1)
|
|
134
139
|
ffi (~> 1.0)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
rspec (3.13.
|
|
140
|
+
rbnacl (7.1.2)
|
|
141
|
+
ffi (~> 1)
|
|
142
|
+
rchardet (1.10.2)
|
|
143
|
+
regexp_parser (2.10.0)
|
|
144
|
+
rspec (3.13.1)
|
|
140
145
|
rspec-core (~> 3.13.0)
|
|
141
146
|
rspec-expectations (~> 3.13.0)
|
|
142
147
|
rspec-mocks (~> 3.13.0)
|
|
143
|
-
rspec-core (3.13.
|
|
148
|
+
rspec-core (3.13.4)
|
|
144
149
|
rspec-support (~> 3.13.0)
|
|
145
|
-
rspec-expectations (3.13.
|
|
150
|
+
rspec-expectations (3.13.5)
|
|
146
151
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
147
152
|
rspec-support (~> 3.13.0)
|
|
148
|
-
rspec-mocks (3.13.
|
|
153
|
+
rspec-mocks (3.13.5)
|
|
149
154
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
150
155
|
rspec-support (~> 3.13.0)
|
|
151
|
-
rspec-support (3.13.
|
|
152
|
-
rubocop (1.
|
|
156
|
+
rspec-support (3.13.4)
|
|
157
|
+
rubocop (1.75.8)
|
|
153
158
|
json (~> 2.3)
|
|
154
|
-
language_server-protocol (
|
|
159
|
+
language_server-protocol (~> 3.17.0.2)
|
|
160
|
+
lint_roller (~> 1.1.0)
|
|
155
161
|
parallel (~> 1.10)
|
|
156
162
|
parser (>= 3.3.0.2)
|
|
157
163
|
rainbow (>= 2.2.2, < 4.0)
|
|
158
|
-
regexp_parser (>= 2.
|
|
159
|
-
|
|
160
|
-
rubocop-ast (>= 1.31.1, < 2.0)
|
|
164
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
165
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
|
161
166
|
ruby-progressbar (~> 1.7)
|
|
162
|
-
unicode-display_width (>= 2.4.0, <
|
|
163
|
-
rubocop-ast (1.
|
|
164
|
-
parser (>= 3.3.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
rubocop (
|
|
167
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
168
|
+
rubocop-ast (1.44.1)
|
|
169
|
+
parser (>= 3.3.7.2)
|
|
170
|
+
prism (~> 1.4)
|
|
171
|
+
rubocop-rake (0.7.1)
|
|
172
|
+
lint_roller (~> 1.1)
|
|
173
|
+
rubocop (>= 1.72.1)
|
|
174
|
+
rubocop-rspec (3.6.0)
|
|
175
|
+
lint_roller (~> 1.1)
|
|
176
|
+
rubocop (~> 1.72, >= 1.72.1)
|
|
169
177
|
ruby-progressbar (1.13.0)
|
|
170
|
-
ruby_gpg2 (0.
|
|
171
|
-
lino (>= 1
|
|
172
|
-
sawyer (0.9.
|
|
178
|
+
ruby_gpg2 (0.12.0)
|
|
179
|
+
lino (>= 4.1)
|
|
180
|
+
sawyer (0.9.3)
|
|
173
181
|
addressable (>= 2.3.5)
|
|
174
182
|
faraday (>= 0.17.3, < 3)
|
|
183
|
+
securerandom (0.4.1)
|
|
175
184
|
shellany (0.0.1)
|
|
176
185
|
simplecov (0.22.0)
|
|
177
186
|
docile (~> 1.1)
|
|
@@ -180,22 +189,18 @@ GEM
|
|
|
180
189
|
simplecov-html (0.12.3)
|
|
181
190
|
simplecov_json_formatter (0.1.4)
|
|
182
191
|
sshkey (2.0.0)
|
|
183
|
-
strscan (3.1.0)
|
|
184
192
|
terminal-notifier-guard (1.7.0)
|
|
185
|
-
thor (1.3.
|
|
193
|
+
thor (1.3.2)
|
|
186
194
|
tzinfo (2.0.6)
|
|
187
195
|
concurrent-ruby (~> 1.0)
|
|
188
|
-
unicode-display_width (
|
|
189
|
-
|
|
190
|
-
|
|
196
|
+
unicode-display_width (3.1.4)
|
|
197
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
|
198
|
+
unicode-emoji (4.0.4)
|
|
199
|
+
uri (1.1.1)
|
|
200
|
+
yard (0.9.37)
|
|
191
201
|
|
|
192
202
|
PLATFORMS
|
|
193
|
-
arm64-darwin-21
|
|
194
|
-
arm64-darwin-22
|
|
195
203
|
ruby
|
|
196
|
-
x86_64-darwin-19
|
|
197
|
-
x86_64-darwin-20
|
|
198
|
-
x86_64-darwin-21
|
|
199
204
|
x86_64-linux
|
|
200
205
|
|
|
201
206
|
DEPENDENCIES
|
|
@@ -205,12 +210,12 @@ DEPENDENCIES
|
|
|
205
210
|
guard
|
|
206
211
|
guard-rspec
|
|
207
212
|
rake
|
|
208
|
-
|
|
209
|
-
rake_git
|
|
213
|
+
rake_factory (~> 0.33)
|
|
214
|
+
rake_git (~> 0.2)
|
|
210
215
|
rake_git_crypt
|
|
211
216
|
rake_github
|
|
212
217
|
rake_gpg
|
|
213
|
-
|
|
218
|
+
rake_slack
|
|
214
219
|
rspec
|
|
215
220
|
rubocop
|
|
216
221
|
rubocop-rake
|
data/README.md
CHANGED
|
@@ -63,16 +63,16 @@ To check for code linting / formatting issues without fixing:
|
|
|
63
63
|
You can also run `bin/console` for an interactive prompt that will allow you to
|
|
64
64
|
experiment.
|
|
65
65
|
|
|
66
|
-
### Managing
|
|
66
|
+
### Managing CI keys
|
|
67
67
|
|
|
68
|
-
To encrypt a GPG key for use by
|
|
68
|
+
To encrypt a GPG key for use by CI:
|
|
69
69
|
|
|
70
70
|
```shell
|
|
71
71
|
openssl aes-256-cbc \
|
|
72
72
|
-e \
|
|
73
73
|
-md sha1 \
|
|
74
74
|
-in ./config/secrets/ci/gpg.private \
|
|
75
|
-
-out ./.
|
|
75
|
+
-out ./.github/gpg.private.enc \
|
|
76
76
|
-k "<passphrase>"
|
|
77
77
|
```
|
|
78
78
|
|
|
@@ -82,7 +82,7 @@ To check decryption is working correctly:
|
|
|
82
82
|
openssl aes-256-cbc \
|
|
83
83
|
-d \
|
|
84
84
|
-md sha1 \
|
|
85
|
-
-in ./.
|
|
85
|
+
-in ./.github/gpg.private.enc \
|
|
86
86
|
-k "<passphrase>"
|
|
87
87
|
```
|
|
88
88
|
|
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
|
require 'yard'
|
|
14
12
|
|
|
15
13
|
task default: %i[
|
|
@@ -60,13 +58,6 @@ namespace :encryption do
|
|
|
60
58
|
end
|
|
61
59
|
|
|
62
60
|
namespace :keys do
|
|
63
|
-
namespace :deploy do
|
|
64
|
-
RakeSSH.define_key_tasks(
|
|
65
|
-
path: 'config/secrets/ci/',
|
|
66
|
-
comment: 'maintainers@infrablocks.io'
|
|
67
|
-
)
|
|
68
|
-
end
|
|
69
|
-
|
|
70
61
|
namespace :gpg do
|
|
71
62
|
RakeGPG.define_generate_key_task(
|
|
72
63
|
output_directory: 'config/secrets/ci',
|
|
@@ -92,7 +83,6 @@ namespace :secrets do
|
|
|
92
83
|
desc 'Generate all generatable secrets.'
|
|
93
84
|
task generate: %w[
|
|
94
85
|
encryption:passphrase:generate
|
|
95
|
-
keys:deploy:generate
|
|
96
86
|
keys:gpg:generate
|
|
97
87
|
]
|
|
98
88
|
|
|
@@ -121,6 +111,11 @@ namespace :library do
|
|
|
121
111
|
|
|
122
112
|
desc 'Attempt to automatically fix issues with the library'
|
|
123
113
|
task fix: [:'rubocop:autocorrect_all']
|
|
114
|
+
|
|
115
|
+
desc 'Build the library'
|
|
116
|
+
task :build do
|
|
117
|
+
sh 'gem build ruby_git_crypt.gemspec'
|
|
118
|
+
end
|
|
124
119
|
end
|
|
125
120
|
|
|
126
121
|
namespace :documentation do
|
|
@@ -147,54 +142,90 @@ namespace :test do
|
|
|
147
142
|
RSpec::Core::RakeTask.new(:unit)
|
|
148
143
|
end
|
|
149
144
|
|
|
150
|
-
|
|
151
|
-
namespace: :circle_ci,
|
|
152
|
-
project_slug: 'github/infrablocks/ruby_git_crypt'
|
|
153
|
-
) do |t|
|
|
154
|
-
circle_ci_config =
|
|
155
|
-
YAML.load_file('config/secrets/circle_ci/config.yaml')
|
|
156
|
-
|
|
157
|
-
t.api_token = circle_ci_config['circle_ci_api_token']
|
|
158
|
-
t.environment_variables = {
|
|
159
|
-
ENCRYPTION_PASSPHRASE:
|
|
160
|
-
File.read('config/secrets/ci/encryption.passphrase')
|
|
161
|
-
.chomp
|
|
162
|
-
}
|
|
163
|
-
t.checkout_keys = []
|
|
164
|
-
t.ssh_keys = [
|
|
165
|
-
{
|
|
166
|
-
hostname: 'github.com',
|
|
167
|
-
private_key: File.read('config/secrets/ci/ssh.private')
|
|
168
|
-
}
|
|
169
|
-
]
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
RakeGithub.define_repository_tasks(
|
|
145
|
+
RakeGithub.define_repository_tasks( # rubocop:disable Metrics/BlockLength
|
|
173
146
|
namespace: :github,
|
|
174
147
|
repository: 'infrablocks/ruby_git_crypt'
|
|
175
148
|
) do |t|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
149
|
+
# Operator's ambient auth. Resolve once and fail fast: a missing,
|
|
150
|
+
# unauthenticated, or absent gh yields an empty string, which would
|
|
151
|
+
# otherwise surface later as an opaque Octokit 401. An empty or
|
|
152
|
+
# whitespace-only GITHUB_TOKEN is treated as absent so an authenticated
|
|
153
|
+
# operator falls through to `gh auth token` rather than hitting the raise.
|
|
154
|
+
github_token = ENV['GITHUB_TOKEN'].to_s.strip
|
|
155
|
+
if github_token.empty?
|
|
156
|
+
github_token = begin
|
|
157
|
+
`gh auth token`
|
|
158
|
+
rescue Errno::ENOENT
|
|
159
|
+
''
|
|
160
|
+
end.strip
|
|
161
|
+
end
|
|
162
|
+
if github_token.empty?
|
|
163
|
+
raise 'No GitHub token available: set GITHUB_TOKEN or run `gh auth login`'
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
t.access_token = github_token
|
|
167
|
+
|
|
168
|
+
# Actions store only: dependabot runs never reach the passphrase — the
|
|
169
|
+
# only pr.yaml job that unlocks git-crypt (prerelease) is guarded to
|
|
170
|
+
# same-repo human PRs. Guard against a locked clone: without
|
|
171
|
+
# it, File.read returns git-crypt ciphertext and github:secrets:ensure
|
|
172
|
+
# silently uploads garbage that only surfaces much later as an opaque
|
|
173
|
+
# GPG unlock failure in the release job.
|
|
174
|
+
passphrase_path = 'config/secrets/ci/encryption.passphrase'
|
|
175
|
+
unless File.exist?(passphrase_path)
|
|
176
|
+
raise "Passphrase file not found: #{passphrase_path} — expected a " \
|
|
177
|
+
'git-crypt-unlocked clone with the CI secrets present'
|
|
178
|
+
end
|
|
179
|
+
passphrase = File.binread(passphrase_path)
|
|
180
|
+
if passphrase.start_with?("\x00GITCRYPT")
|
|
181
|
+
raise 'encryption.passphrase is git-crypt ciphertext — unlock the ' \
|
|
182
|
+
'clone before provisioning'
|
|
183
|
+
end
|
|
184
|
+
t.secrets = [
|
|
185
|
+
{ name: 'ENCRYPTION_PASSPHRASE', value: passphrase.chomp }
|
|
186
|
+
]
|
|
187
|
+
t.environments = [
|
|
188
|
+
{ name: 'release',
|
|
189
|
+
reviewers: [{ team: 'maintainers' }] }
|
|
185
190
|
]
|
|
186
191
|
end
|
|
187
192
|
|
|
188
193
|
namespace :pipeline do
|
|
189
|
-
desc 'Prepare
|
|
194
|
+
desc 'Prepare GitHub Actions pipeline'
|
|
190
195
|
task prepare: %i[
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
circle_ci:ssh_keys:ensure
|
|
194
|
-
github:deploy_keys:ensure
|
|
196
|
+
github:secrets:ensure
|
|
197
|
+
github:environments:ensure
|
|
195
198
|
]
|
|
196
199
|
end
|
|
197
200
|
|
|
201
|
+
namespace :slack do
|
|
202
|
+
RakeSlack.define_notification_tasks do |t|
|
|
203
|
+
t.bot_token = ENV.fetch('SLACK_BOT_TOKEN', nil)
|
|
204
|
+
t.routing_rules = [
|
|
205
|
+
{ when: { type: 'on_hold' },
|
|
206
|
+
channel: 'C038EDCRSQJ', format: :on_hold }, # release
|
|
207
|
+
{ when: { actor: 'dependabot[bot]', outcome: 'success' },
|
|
208
|
+
channel: 'C03N711HVDG', format: :success }, # builds-dependabot
|
|
209
|
+
{ when: { actor: 'dependabot[bot]' },
|
|
210
|
+
channel: 'C03N711HVDG', format: :failure }, # builds-dependabot
|
|
211
|
+
{ when: { outcome: 'success' },
|
|
212
|
+
channel: 'C023XUE76GH', format: :success }, # builds
|
|
213
|
+
# Failures go to builds, not team-dev (org default), to keep noise
|
|
214
|
+
# out of a popular channel while this pipeline beds in.
|
|
215
|
+
{ when: {},
|
|
216
|
+
channel: 'C023XUE76GH', format: :failure } # builds
|
|
217
|
+
]
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
namespace :repository do
|
|
222
|
+
desc 'Set the git author for CI'
|
|
223
|
+
task :set_ci_author do
|
|
224
|
+
sh 'git config --global user.name "InfraBlocks CI"'
|
|
225
|
+
sh 'git config --global user.email "ci@infrablocks.io"'
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
|
|
198
229
|
namespace :version do
|
|
199
230
|
desc 'Bump version for specified type (pre, major, minor, patch)'
|
|
200
231
|
task :bump, [:type] do |_, args|
|
|
@@ -202,6 +233,38 @@ namespace :version do
|
|
|
202
233
|
end
|
|
203
234
|
end
|
|
204
235
|
|
|
236
|
+
namespace :prerelease do
|
|
237
|
+
desc 'Build and push a namespaced pre-release to RubyGems ' \
|
|
238
|
+
'(PR CI only; no bump, no tag, no commit, no push)'
|
|
239
|
+
task :publish, %i[pr_number run_number run_attempt] do |_, args|
|
|
240
|
+
%i[pr_number run_number run_attempt].each do |name|
|
|
241
|
+
raise "Missing task argument: #{name}" if args[name].to_s.empty?
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
version_file = 'lib/ruby_git_crypt/version.rb'
|
|
245
|
+
version_pattern = /(VERSION\s*=\s*')([^']+)(')/
|
|
246
|
+
source = File.read(version_file)
|
|
247
|
+
base = source[version_pattern, 2]
|
|
248
|
+
raise "Could not read VERSION from #{version_file}" unless base
|
|
249
|
+
|
|
250
|
+
version = "#{base}.pr#{args.pr_number}" \
|
|
251
|
+
".#{args.run_number}.#{args.run_attempt}"
|
|
252
|
+
gem_file = "ruby_git_crypt-#{version}.gem"
|
|
253
|
+
begin
|
|
254
|
+
File.write(version_file,
|
|
255
|
+
source.sub(version_pattern, "\\1#{version}\\3"))
|
|
256
|
+
# Build + push directly: `gem release` aborts on the (deliberately)
|
|
257
|
+
# uncommitted version rewrite. PR CI must not tag, commit, or push
|
|
258
|
+
# (contrast the `release` task).
|
|
259
|
+
sh 'gem build ruby_git_crypt.gemspec'
|
|
260
|
+
sh "gem push #{gem_file}"
|
|
261
|
+
ensure
|
|
262
|
+
File.write(version_file, source)
|
|
263
|
+
rm_f gem_file
|
|
264
|
+
end
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
|
|
205
268
|
desc 'Release gem'
|
|
206
269
|
task :release do
|
|
207
270
|
sh 'gem release --tag --push'
|
|
@@ -6,8 +6,8 @@ require_relative 'types/flag'
|
|
|
6
6
|
module RubyGitCrypt
|
|
7
7
|
module Options
|
|
8
8
|
module Types
|
|
9
|
-
def self.standard(name, value, **
|
|
10
|
-
Standard.new(name, value, **
|
|
9
|
+
def self.standard(name, value, **)
|
|
10
|
+
Standard.new(name, value, **)
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def self.flag(name, value)
|
data/ruby_git_crypt.gemspec
CHANGED
|
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
|
|
|
36
36
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
37
37
|
spec.require_paths = ['lib']
|
|
38
38
|
|
|
39
|
-
spec.required_ruby_version = '>= 3.
|
|
39
|
+
spec.required_ruby_version = '>= 3.3'
|
|
40
40
|
|
|
41
41
|
spec.add_dependency 'immutable-struct', '~> 2.4'
|
|
42
42
|
spec.add_dependency 'lino', '>= 4.1'
|
|
@@ -47,12 +47,11 @@ Gem::Specification.new do |spec|
|
|
|
47
47
|
spec.add_development_dependency 'guard'
|
|
48
48
|
spec.add_development_dependency 'guard-rspec'
|
|
49
49
|
spec.add_development_dependency 'rake'
|
|
50
|
-
spec.add_development_dependency 'rake_circle_ci'
|
|
51
50
|
spec.add_development_dependency 'rake_git'
|
|
52
51
|
spec.add_development_dependency 'rake_git_crypt'
|
|
53
52
|
spec.add_development_dependency 'rake_github'
|
|
54
53
|
spec.add_development_dependency 'rake_gpg'
|
|
55
|
-
spec.add_development_dependency '
|
|
54
|
+
spec.add_development_dependency 'rake_slack'
|
|
56
55
|
spec.add_development_dependency 'rspec'
|
|
57
56
|
spec.add_development_dependency 'rubocop'
|
|
58
57
|
spec.add_development_dependency 'rubocop-rake'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_git_crypt
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.0.pre.
|
|
4
|
+
version: 0.2.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: immutable-struct
|
|
@@ -122,20 +122,6 @@ dependencies:
|
|
|
122
122
|
- - ">="
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
124
|
version: '0'
|
|
125
|
-
- !ruby/object:Gem::Dependency
|
|
126
|
-
name: rake_circle_ci
|
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
|
128
|
-
requirements:
|
|
129
|
-
- - ">="
|
|
130
|
-
- !ruby/object:Gem::Version
|
|
131
|
-
version: '0'
|
|
132
|
-
type: :development
|
|
133
|
-
prerelease: false
|
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
-
requirements:
|
|
136
|
-
- - ">="
|
|
137
|
-
- !ruby/object:Gem::Version
|
|
138
|
-
version: '0'
|
|
139
125
|
- !ruby/object:Gem::Dependency
|
|
140
126
|
name: rake_git
|
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -193,7 +179,7 @@ dependencies:
|
|
|
193
179
|
- !ruby/object:Gem::Version
|
|
194
180
|
version: '0'
|
|
195
181
|
- !ruby/object:Gem::Dependency
|
|
196
|
-
name:
|
|
182
|
+
name: rake_slack
|
|
197
183
|
requirement: !ruby/object:Gem::Requirement
|
|
198
184
|
requirements:
|
|
199
185
|
- - ">="
|
|
@@ -353,7 +339,7 @@ licenses:
|
|
|
353
339
|
- MIT
|
|
354
340
|
metadata:
|
|
355
341
|
rubygems_mfa_required: 'false'
|
|
356
|
-
post_install_message:
|
|
342
|
+
post_install_message:
|
|
357
343
|
rdoc_options: []
|
|
358
344
|
require_paths:
|
|
359
345
|
- lib
|
|
@@ -361,15 +347,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
361
347
|
requirements:
|
|
362
348
|
- - ">="
|
|
363
349
|
- !ruby/object:Gem::Version
|
|
364
|
-
version: '3.
|
|
350
|
+
version: '3.3'
|
|
365
351
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
366
352
|
requirements:
|
|
367
|
-
- - "
|
|
353
|
+
- - ">="
|
|
368
354
|
- !ruby/object:Gem::Version
|
|
369
|
-
version:
|
|
355
|
+
version: '0'
|
|
370
356
|
requirements: []
|
|
371
|
-
rubygems_version: 3.
|
|
372
|
-
signing_key:
|
|
357
|
+
rubygems_version: 3.5.22
|
|
358
|
+
signing_key:
|
|
373
359
|
specification_version: 4
|
|
374
360
|
summary: A simple Ruby wrapper for invoking git-crypt commands.
|
|
375
361
|
test_files: []
|