rake_template 0.9.0.pre.2 → 0.9.0.pre.2.pr158.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 +82 -74
- data/README.md +4 -4
- data/Rakefile +111 -48
- data/lib/rake_template/version.rb +1 -1
- data/rake_template.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: 6e10b147229dedc243ebf311f194302323036e68abd8469276e5c3784eaba5a6
|
|
4
|
+
data.tar.gz: a92e56e8a3043adf67942cb5678d6f1adaa751cbf0b10bdb7c726b23c9129878
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aa612d1f523007382756832b9d20b1b9b8e37363ff08c6ed1b3380e1dbf57f8902e33f6b8299083576d2125b2623beb88c4631c064e84dda306a703e552d8bbe
|
|
7
|
+
data.tar.gz: 3d193f33073412f61b710b207491840b56ac0fc713c1e9d1cb235ef8a69c5fe4c68c33d08b97d7b922721b5f907bf8119ec03bfc69caca04da239137397ad9a8
|
data/Gemfile.lock
CHANGED
|
@@ -1,79 +1,81 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rake_template (0.9.0.pre.2)
|
|
4
|
+
rake_template (0.9.0.pre.2.pr158.1.1)
|
|
5
5
|
rake_factory (~> 0.33)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
activesupport (
|
|
10
|
+
activesupport (8.1.3)
|
|
11
11
|
base64
|
|
12
12
|
bigdecimal
|
|
13
|
-
concurrent-ruby (~> 1.0, >= 1.
|
|
13
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
14
14
|
connection_pool (>= 2.2.5)
|
|
15
15
|
drb
|
|
16
16
|
i18n (>= 1.6, < 2)
|
|
17
|
+
json
|
|
18
|
+
logger (>= 1.4.2)
|
|
17
19
|
minitest (>= 5.1)
|
|
18
|
-
|
|
19
|
-
tzinfo (~> 2.0)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
securerandom (>= 0.3)
|
|
21
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
22
|
+
uri (>= 0.13.1)
|
|
23
|
+
addressable (2.9.0)
|
|
24
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
25
|
+
ast (2.4.3)
|
|
26
|
+
base64 (0.3.0)
|
|
27
|
+
bigdecimal (4.1.2)
|
|
25
28
|
childprocess (5.0.0)
|
|
26
29
|
colored2 (3.1.2)
|
|
27
|
-
concurrent-ruby (1.3.
|
|
28
|
-
connection_pool (
|
|
29
|
-
diff-lcs (1.
|
|
30
|
+
concurrent-ruby (1.3.8)
|
|
31
|
+
connection_pool (3.0.2)
|
|
32
|
+
diff-lcs (1.6.2)
|
|
30
33
|
docile (1.4.0)
|
|
31
|
-
drb (2.2.
|
|
32
|
-
excon (
|
|
33
|
-
faraday (2.10.0)
|
|
34
|
-
faraday-net_http (>= 2.0, < 3.2)
|
|
34
|
+
drb (2.2.3)
|
|
35
|
+
excon (1.6.0)
|
|
35
36
|
logger
|
|
36
|
-
faraday
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
faraday (2.14.3)
|
|
38
|
+
faraday-net_http (>= 2.0, < 3.5)
|
|
39
|
+
json
|
|
40
|
+
logger
|
|
41
|
+
faraday-net_http (3.4.4)
|
|
42
|
+
net-http (~> 0.5)
|
|
43
|
+
ffi (1.17.4)
|
|
44
|
+
ffi (1.17.4-x86_64-linux-gnu)
|
|
45
|
+
gem-release (2.2.4)
|
|
39
46
|
git (1.19.1)
|
|
40
47
|
addressable (~> 2.8)
|
|
41
48
|
rchardet (~> 1.8)
|
|
42
49
|
hamster (3.0.0)
|
|
43
50
|
concurrent-ruby (~> 1.0)
|
|
44
|
-
i18n (1.
|
|
51
|
+
i18n (1.15.2)
|
|
45
52
|
concurrent-ruby (~> 1.0)
|
|
46
|
-
immutable-struct (2.
|
|
47
|
-
json (2.
|
|
48
|
-
language_server-protocol (3.17.0.
|
|
53
|
+
immutable-struct (2.5.0)
|
|
54
|
+
json (2.12.2)
|
|
55
|
+
language_server-protocol (3.17.0.5)
|
|
49
56
|
lino (4.1.0)
|
|
50
57
|
childprocess (~> 5.0.0)
|
|
51
58
|
hamster (~> 3.0)
|
|
52
59
|
open4 (~> 1.3)
|
|
53
|
-
|
|
60
|
+
lint_roller (1.1.0)
|
|
61
|
+
logger (1.7.0)
|
|
54
62
|
memfs (1.0.0)
|
|
55
|
-
minitest (5.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
octokit (8.1.0)
|
|
60
|
-
base64
|
|
63
|
+
minitest (5.27.0)
|
|
64
|
+
net-http (0.9.1)
|
|
65
|
+
uri (>= 0.11.1)
|
|
66
|
+
octokit (10.0.0)
|
|
61
67
|
faraday (>= 1, < 3)
|
|
62
68
|
sawyer (~> 0.9)
|
|
63
69
|
open4 (1.3.4)
|
|
64
|
-
parallel (1.
|
|
65
|
-
parser (3.3.
|
|
70
|
+
parallel (1.27.0)
|
|
71
|
+
parser (3.3.8.0)
|
|
66
72
|
ast (~> 2.4.1)
|
|
67
73
|
racc
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
prism (1.4.0)
|
|
75
|
+
public_suffix (7.0.5)
|
|
76
|
+
racc (1.8.1)
|
|
70
77
|
rainbow (3.1.1)
|
|
71
|
-
rake (13.2
|
|
72
|
-
rake_circle_ci (0.13.0)
|
|
73
|
-
colored2 (~> 3.1)
|
|
74
|
-
excon (~> 0.72)
|
|
75
|
-
rake_factory (~> 0.33)
|
|
76
|
-
sshkey (~> 2.0)
|
|
78
|
+
rake (13.4.2)
|
|
77
79
|
rake_factory (0.33.0)
|
|
78
80
|
activesupport (>= 4)
|
|
79
81
|
rake (~> 13.0)
|
|
@@ -81,66 +83,71 @@ GEM
|
|
|
81
83
|
colored2 (~> 3.1)
|
|
82
84
|
git (~> 1.13, >= 1.13.2)
|
|
83
85
|
rake_factory (~> 0.33)
|
|
84
|
-
rake_git_crypt (0.
|
|
86
|
+
rake_git_crypt (0.4.0)
|
|
85
87
|
colored2 (~> 3.1)
|
|
88
|
+
lino (~> 4.1)
|
|
86
89
|
rake_factory (~> 0.33)
|
|
87
90
|
ruby_git_crypt (~> 0.1)
|
|
88
91
|
ruby_gpg2 (~> 0.12)
|
|
89
|
-
rake_github (0.
|
|
92
|
+
rake_github (0.17.0)
|
|
90
93
|
colored2 (~> 3.1)
|
|
91
|
-
octokit (>=
|
|
94
|
+
octokit (>= 7.0, < 11.0)
|
|
92
95
|
rake_factory (~> 0.33)
|
|
96
|
+
rbnacl (~> 7.1)
|
|
93
97
|
sshkey (~> 2.0)
|
|
94
98
|
rake_gpg (0.20.0)
|
|
95
99
|
rake_factory (~> 0.33)
|
|
96
100
|
ruby_gpg2 (~> 0.12)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
rake_factory (~> 0.
|
|
100
|
-
|
|
101
|
+
rake_slack (0.3.0)
|
|
102
|
+
excon (>= 0.72, < 2.0)
|
|
103
|
+
rake_factory (~> 0.33)
|
|
104
|
+
rbnacl (7.1.2)
|
|
105
|
+
ffi (~> 1)
|
|
101
106
|
rchardet (1.8.0)
|
|
102
|
-
regexp_parser (2.
|
|
103
|
-
|
|
104
|
-
strscan
|
|
105
|
-
rspec (3.13.0)
|
|
107
|
+
regexp_parser (2.10.0)
|
|
108
|
+
rspec (3.13.1)
|
|
106
109
|
rspec-core (~> 3.13.0)
|
|
107
110
|
rspec-expectations (~> 3.13.0)
|
|
108
111
|
rspec-mocks (~> 3.13.0)
|
|
109
|
-
rspec-core (3.13.
|
|
112
|
+
rspec-core (3.13.4)
|
|
110
113
|
rspec-support (~> 3.13.0)
|
|
111
|
-
rspec-expectations (3.13.
|
|
114
|
+
rspec-expectations (3.13.5)
|
|
112
115
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
113
116
|
rspec-support (~> 3.13.0)
|
|
114
|
-
rspec-mocks (3.13.
|
|
117
|
+
rspec-mocks (3.13.5)
|
|
115
118
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
116
119
|
rspec-support (~> 3.13.0)
|
|
117
|
-
rspec-support (3.13.
|
|
118
|
-
rubocop (1.
|
|
120
|
+
rspec-support (3.13.4)
|
|
121
|
+
rubocop (1.75.8)
|
|
119
122
|
json (~> 2.3)
|
|
120
|
-
language_server-protocol (
|
|
123
|
+
language_server-protocol (~> 3.17.0.2)
|
|
124
|
+
lint_roller (~> 1.1.0)
|
|
121
125
|
parallel (~> 1.10)
|
|
122
126
|
parser (>= 3.3.0.2)
|
|
123
127
|
rainbow (>= 2.2.2, < 4.0)
|
|
124
|
-
regexp_parser (>= 2.
|
|
125
|
-
|
|
126
|
-
rubocop-ast (>= 1.31.1, < 2.0)
|
|
128
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
129
|
+
rubocop-ast (>= 1.44.0, < 2.0)
|
|
127
130
|
ruby-progressbar (~> 1.7)
|
|
128
|
-
unicode-display_width (>= 2.4.0, <
|
|
129
|
-
rubocop-ast (1.
|
|
130
|
-
parser (>= 3.3.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
rubocop (
|
|
131
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
132
|
+
rubocop-ast (1.44.1)
|
|
133
|
+
parser (>= 3.3.7.2)
|
|
134
|
+
prism (~> 1.4)
|
|
135
|
+
rubocop-rake (0.7.1)
|
|
136
|
+
lint_roller (~> 1.1)
|
|
137
|
+
rubocop (>= 1.72.1)
|
|
138
|
+
rubocop-rspec (3.6.0)
|
|
139
|
+
lint_roller (~> 1.1)
|
|
140
|
+
rubocop (~> 1.72, >= 1.72.1)
|
|
135
141
|
ruby-progressbar (1.13.0)
|
|
136
142
|
ruby_git_crypt (0.1.0)
|
|
137
143
|
immutable-struct (~> 2.4)
|
|
138
144
|
lino (>= 4.1)
|
|
139
145
|
ruby_gpg2 (0.12.0)
|
|
140
146
|
lino (>= 4.1)
|
|
141
|
-
sawyer (0.9.
|
|
147
|
+
sawyer (0.9.3)
|
|
142
148
|
addressable (>= 2.3.5)
|
|
143
149
|
faraday (>= 0.17.3, < 3)
|
|
150
|
+
securerandom (0.4.1)
|
|
144
151
|
simplecov (0.22.0)
|
|
145
152
|
docile (~> 1.1)
|
|
146
153
|
simplecov-html (~> 0.11)
|
|
@@ -148,14 +155,16 @@ GEM
|
|
|
148
155
|
simplecov-html (0.12.3)
|
|
149
156
|
simplecov_json_formatter (0.1.4)
|
|
150
157
|
sshkey (2.0.0)
|
|
151
|
-
strscan (3.1.0)
|
|
152
158
|
tzinfo (2.0.6)
|
|
153
159
|
concurrent-ruby (~> 1.0)
|
|
154
|
-
unicode-display_width (
|
|
155
|
-
|
|
160
|
+
unicode-display_width (3.1.4)
|
|
161
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
|
162
|
+
unicode-emoji (4.0.4)
|
|
163
|
+
uri (1.1.1)
|
|
156
164
|
|
|
157
165
|
PLATFORMS
|
|
158
166
|
ruby
|
|
167
|
+
x86_64-linux
|
|
159
168
|
|
|
160
169
|
DEPENDENCIES
|
|
161
170
|
activesupport
|
|
@@ -163,12 +172,11 @@ DEPENDENCIES
|
|
|
163
172
|
gem-release
|
|
164
173
|
memfs
|
|
165
174
|
rake
|
|
166
|
-
rake_circle_ci
|
|
167
175
|
rake_git
|
|
168
176
|
rake_git_crypt
|
|
169
177
|
rake_github
|
|
170
178
|
rake_gpg
|
|
171
|
-
|
|
179
|
+
rake_slack
|
|
172
180
|
rake_template!
|
|
173
181
|
rspec
|
|
174
182
|
rubocop
|
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,60 +105,101 @@ 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_template.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_template'
|
|
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
|
-
RakeGithub.define_repository_tasks(
|
|
119
|
+
RakeGithub.define_repository_tasks( # rubocop:disable Metrics/BlockLength
|
|
147
120
|
namespace: :github,
|
|
148
121
|
repository: 'infrablocks/rake_template'
|
|
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 }
|
|
160
|
+
]
|
|
161
|
+
t.environments = [
|
|
162
|
+
{ name: 'release',
|
|
163
|
+
reviewers: [{ team: 'maintainers' }] }
|
|
159
164
|
]
|
|
160
165
|
end
|
|
161
166
|
|
|
162
167
|
namespace :pipeline do
|
|
163
|
-
desc 'Prepare
|
|
168
|
+
desc 'Prepare GitHub Actions pipeline'
|
|
164
169
|
task prepare: %i[
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
circle_ci:ssh_keys:ensure
|
|
168
|
-
github:deploy_keys:ensure
|
|
170
|
+
github:secrets:ensure
|
|
171
|
+
github:environments:ensure
|
|
169
172
|
]
|
|
170
173
|
end
|
|
171
174
|
|
|
175
|
+
namespace :slack do
|
|
176
|
+
RakeSlack.define_notification_tasks do |t|
|
|
177
|
+
t.bot_token = ENV.fetch('SLACK_BOT_TOKEN', nil)
|
|
178
|
+
t.routing_rules = [
|
|
179
|
+
{ when: { type: 'on_hold' },
|
|
180
|
+
channel: 'C038EDCRSQJ', format: :on_hold }, # release
|
|
181
|
+
{ when: { actor: 'dependabot[bot]', outcome: 'success' },
|
|
182
|
+
channel: 'C03N711HVDG', format: :success }, # builds-dependabot
|
|
183
|
+
{ when: { actor: 'dependabot[bot]' },
|
|
184
|
+
channel: 'C03N711HVDG', format: :failure }, # builds-dependabot
|
|
185
|
+
{ when: { outcome: 'success' },
|
|
186
|
+
channel: 'C023XUE76GH', format: :success }, # builds
|
|
187
|
+
# Failures go to builds, not team-dev (org default), to keep noise
|
|
188
|
+
# out of a popular channel while this pipeline beds in.
|
|
189
|
+
{ when: {},
|
|
190
|
+
channel: 'C023XUE76GH', format: :failure } # builds
|
|
191
|
+
]
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
namespace :repository do
|
|
196
|
+
desc 'Set the git author for CI'
|
|
197
|
+
task :set_ci_author do
|
|
198
|
+
sh 'git config --global user.name "InfraBlocks CI"'
|
|
199
|
+
sh 'git config --global user.email "ci@infrablocks.io"'
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
|
|
172
203
|
namespace :version do
|
|
173
204
|
desc 'Bump version for specified type (pre, major, minor, patch)'
|
|
174
205
|
task :bump, [:type] do |_, args|
|
|
@@ -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_template/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_template-#{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_template.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/rake_template.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 'rake_factory', '~> 0.33'
|
|
40
40
|
|
|
@@ -43,12 +43,11 @@ Gem::Specification.new do |spec|
|
|
|
43
43
|
spec.add_development_dependency 'gem-release'
|
|
44
44
|
spec.add_development_dependency 'memfs'
|
|
45
45
|
spec.add_development_dependency 'rake'
|
|
46
|
-
spec.add_development_dependency 'rake_circle_ci'
|
|
47
46
|
spec.add_development_dependency 'rake_git'
|
|
48
47
|
spec.add_development_dependency 'rake_git_crypt'
|
|
49
48
|
spec.add_development_dependency 'rake_github'
|
|
50
49
|
spec.add_development_dependency 'rake_gpg'
|
|
51
|
-
spec.add_development_dependency '
|
|
50
|
+
spec.add_development_dependency 'rake_slack'
|
|
52
51
|
spec.add_development_dependency 'rspec'
|
|
53
52
|
spec.add_development_dependency 'rubocop'
|
|
54
53
|
spec.add_development_dependency 'rubocop-rake'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rake_template
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.0.pre.2
|
|
4
|
+
version: 0.9.0.pre.2.pr158.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: rake_factory
|
|
@@ -94,20 +94,6 @@ dependencies:
|
|
|
94
94
|
- - ">="
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '0'
|
|
97
|
-
- !ruby/object:Gem::Dependency
|
|
98
|
-
name: rake_circle_ci
|
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
|
100
|
-
requirements:
|
|
101
|
-
- - ">="
|
|
102
|
-
- !ruby/object:Gem::Version
|
|
103
|
-
version: '0'
|
|
104
|
-
type: :development
|
|
105
|
-
prerelease: false
|
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
-
requirements:
|
|
108
|
-
- - ">="
|
|
109
|
-
- !ruby/object:Gem::Version
|
|
110
|
-
version: '0'
|
|
111
97
|
- !ruby/object:Gem::Dependency
|
|
112
98
|
name: rake_git
|
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -165,7 +151,7 @@ dependencies:
|
|
|
165
151
|
- !ruby/object:Gem::Version
|
|
166
152
|
version: '0'
|
|
167
153
|
- !ruby/object:Gem::Dependency
|
|
168
|
-
name:
|
|
154
|
+
name: rake_slack
|
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
|
170
156
|
requirements:
|
|
171
157
|
- - ">="
|
|
@@ -274,7 +260,7 @@ licenses:
|
|
|
274
260
|
- MIT
|
|
275
261
|
metadata:
|
|
276
262
|
rubygems_mfa_required: 'false'
|
|
277
|
-
post_install_message:
|
|
263
|
+
post_install_message:
|
|
278
264
|
rdoc_options: []
|
|
279
265
|
require_paths:
|
|
280
266
|
- lib
|
|
@@ -282,15 +268,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
282
268
|
requirements:
|
|
283
269
|
- - ">="
|
|
284
270
|
- !ruby/object:Gem::Version
|
|
285
|
-
version: '3.
|
|
271
|
+
version: '3.3'
|
|
286
272
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
287
273
|
requirements:
|
|
288
|
-
- - "
|
|
274
|
+
- - ">="
|
|
289
275
|
- !ruby/object:Gem::Version
|
|
290
|
-
version:
|
|
276
|
+
version: '0'
|
|
291
277
|
requirements: []
|
|
292
|
-
rubygems_version: 3.
|
|
293
|
-
signing_key:
|
|
278
|
+
rubygems_version: 3.5.22
|
|
279
|
+
signing_key:
|
|
294
280
|
specification_version: 4
|
|
295
281
|
summary: Rake tasks for rendering templates.
|
|
296
282
|
test_files: []
|