Skip to content

Commit c25a9a6

Browse files
committed
Add secrets management tasks. Add .tool-versions. Add GPG keys. Update dependencies.
1 parent 15880aa commit c25a9a6

File tree

11 files changed

+350
-52
lines changed

11 files changed

+350
-52
lines changed

.envrc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,11 @@
33
PROJECT_DIR="$(pwd)"
44

55
PATH_add "${PROJECT_DIR}"
6-
PATH_add "${PROJECT_DIR}"/vendor/terraform/bin
6+
PATH_add "${PROJECT_DIR}"/vendor/**/bin
7+
8+
if has asdf; then
9+
asdf install
10+
fi
11+
12+
layout ruby
13+
layout node

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ build/
1414
dist/
1515
.bundle
1616
.rakeTasks
17+
.direnv
1718

1819
# OS
1920
.DS_Store

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby 3.1.1

CODE_OF_CONDUCT.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ Project maintainers are responsible for clarifying the standards of acceptable
3737
behavior and are expected to take appropriate and fair corrective action in
3838
response to any instances of unacceptable behavior.
3939

40-
Project maintainers have the right and responsibility to remove, edit, or
41-
reject comments, commits, code, wiki edits, issues, and other contributions
42-
that are not aligned to this Code of Conduct, or to ban temporarily or
43-
permanently any contributor for other behaviors that they deem inappropriate,
44-
threatening, offensive, or harmful.
40+
Project maintainers have the right and responsibility to remove, edit, or reject
41+
comments, commits, code, wiki edits, issues, and other contributions that are
42+
not aligned to this Code of Conduct, or to ban temporarily or permanently any
43+
contributor for other behaviors that they deem inappropriate, threatening,
44+
offensive, or harmful.
4545

4646
## Scope
4747

@@ -72,4 +72,5 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
7272
version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
7373

7474
[homepage]: http://contributor-covenant.org
75-
[version]: http://contributor-covenant.org/version/1/4/
75+
76+
[version]: http://contributor-covenant.org/version/1/4/

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ gem 'git'
77
gem 'httparty'
88
gem 'rake'
99
gem 'rake_circle_ci'
10+
gem 'rake_git'
11+
gem 'rake_git_crypt'
1012
gem 'rake_github'
1113
gem 'rake_gpg'
1214
gem 'rake_ssh'

Gemfile.lock

Lines changed: 81 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,107 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (7.0.4)
4+
activesupport (7.1.1)
5+
base64
6+
bigdecimal
57
concurrent-ruby (~> 1.0, >= 1.0.2)
8+
connection_pool (>= 2.2.5)
9+
drb
610
i18n (>= 1.6, < 2)
711
minitest (>= 5.1)
12+
mutex_m
813
tzinfo (~> 2.0)
9-
addressable (2.8.1)
14+
addressable (2.8.5)
1015
public_suffix (>= 2.0.2, < 6.0)
1116
ast (2.4.2)
1217
aws-eventstream (1.2.0)
13-
aws-sigv4 (1.5.2)
18+
aws-sigv4 (1.6.1)
1419
aws-eventstream (~> 1, >= 1.0.2)
20+
base64 (0.1.1)
21+
bigdecimal (3.1.4)
1522
colored2 (3.1.2)
16-
concurrent-ruby (1.1.10)
23+
concurrent-ruby (1.2.2)
1724
confidante (0.28.0)
1825
activesupport (>= 4)
1926
hiera (~> 3.3)
2027
shikashi (~> 0.6)
2128
vault (~> 0.17)
29+
connection_pool (2.4.1)
2230
diff-lcs (1.5.0)
31+
down (5.4.1)
32+
addressable (~> 2.8)
33+
drb (2.1.1)
34+
ruby2_keywords
2335
evalhook (0.6.0)
2436
partialruby (~> 0.3)
2537
sexp_processor (~> 4.0)
26-
excon (0.95.0)
27-
faraday (2.7.2)
38+
excon (0.104.0)
39+
faraday (2.7.11)
40+
base64
2841
faraday-net_http (>= 2.0, < 3.1)
2942
ruby2_keywords (>= 0.0.4)
3043
faraday-net_http (3.0.2)
3144
getsource (0.2.2)
32-
git (1.13.0)
45+
git (1.18.0)
3346
addressable (~> 2.8)
3447
rchardet (~> 1.8)
3548
hamster (3.0.0)
3649
concurrent-ruby (~> 1.0)
37-
hiera (3.11.0)
50+
hiera (3.12.0)
3851
httparty (0.21.0)
3952
mini_mime (>= 1.0.0)
4053
multi_xml (>= 0.5.2)
41-
i18n (1.12.0)
54+
i18n (1.14.1)
4255
concurrent-ruby (~> 1.0)
4356
immutable-struct (2.4.1)
4457
json (2.6.3)
58+
language_server-protocol (3.17.0.3)
4559
lino (3.1.0)
4660
hamster (~> 3.0)
4761
open4 (~> 1.3)
48-
mini_mime (1.1.2)
62+
mini_mime (1.1.5)
4963
minitar (0.9)
50-
minitest (5.16.3)
64+
minitest (5.20.0)
5165
multi_xml (0.6.0)
52-
octokit (6.0.1)
66+
mutex_m (0.1.2)
67+
octokit (6.1.1)
5368
faraday (>= 1, < 3)
5469
sawyer (~> 0.9)
5570
open4 (1.3.4)
56-
parallel (1.22.1)
57-
parser (3.1.3.0)
71+
parallel (1.23.0)
72+
parser (3.2.2.4)
5873
ast (~> 2.4.1)
74+
racc
5975
partialruby (0.3.0)
6076
ruby2ruby (~> 2)
6177
ruby_parser (~> 3)
62-
public_suffix (5.0.1)
78+
public_suffix (5.0.3)
79+
racc (1.7.1)
6380
rainbow (3.1.1)
64-
rake (13.0.6)
81+
rake (13.1.0)
6582
rake_circle_ci (0.11.0)
6683
colored2 (~> 3.1)
6784
excon (~> 0.72)
6885
rake_factory (~> 0.23)
6986
sshkey (~> 2.0)
70-
rake_dependencies (3.1.0)
87+
rake_dependencies (3.5.0)
88+
down (~> 5.3)
7189
hamster (~> 3.0)
7290
minitar (~> 0.9)
7391
rake_factory (~> 0.23)
7492
rubyzip (>= 1.3)
75-
rake_factory (0.31.0)
93+
rake_factory (0.32.0.pre.2)
7694
activesupport (>= 4)
7795
rake (~> 13.0)
96+
rake_git (0.1.0.pre.9)
97+
colored2 (~> 3.1)
98+
git (~> 1.13, >= 1.13.2)
99+
rake_factory (= 0.32.0.pre.2)
100+
rake_git_crypt (0.1.0.pre.28)
101+
colored2 (~> 3.1)
102+
rake_factory (= 0.32.0.pre.2)
103+
ruby_git_crypt (= 0.1.0.pre.2)
104+
ruby_gpg2 (~> 0.6)
78105
rake_github (0.11.0)
79106
colored2 (~> 3.1)
80107
octokit (>= 4.16, < 7.0)
@@ -83,7 +110,7 @@ GEM
83110
rake_gpg (0.18.0)
84111
rake_factory (~> 0.23)
85112
ruby_gpg2 (~> 0.6)
86-
rake_ssh (0.8.0)
113+
rake_ssh (0.10.0)
87114
colored2 (~> 3.1)
88115
rake_factory (~> 0.23)
89116
sshkey (~> 2.0)
@@ -93,71 +120,84 @@ GEM
93120
rake_factory (~> 0.23)
94121
ruby-terraform (~> 1.4)
95122
rchardet (1.8.0)
96-
regexp_parser (2.6.1)
97-
rexml (3.2.5)
123+
regexp_parser (2.8.2)
124+
rexml (3.2.6)
98125
rspec (3.12.0)
99126
rspec-core (~> 3.12.0)
100127
rspec-expectations (~> 3.12.0)
101128
rspec-mocks (~> 3.12.0)
102-
rspec-core (3.12.0)
129+
rspec-core (3.12.2)
103130
rspec-support (~> 3.12.0)
104-
rspec-expectations (3.12.0)
131+
rspec-expectations (3.12.3)
105132
diff-lcs (>= 1.2.0, < 2.0)
106133
rspec-support (~> 3.12.0)
107-
rspec-mocks (3.12.0)
134+
rspec-mocks (3.12.6)
108135
diff-lcs (>= 1.2.0, < 2.0)
109136
rspec-support (~> 3.12.0)
110-
rspec-support (3.12.0)
137+
rspec-support (3.12.1)
111138
rspec-terraform (0.4.0)
112139
confidante (>= 0.27)
113140
rspec (>= 3.0)
114141
ruby-terraform (= 1.7.0.pre.18)
115-
rubocop (1.41.1)
142+
rubocop (1.57.2)
116143
json (~> 2.3)
144+
language_server-protocol (>= 3.17.0)
117145
parallel (~> 1.10)
118-
parser (>= 3.1.2.1)
146+
parser (>= 3.2.2.4)
119147
rainbow (>= 2.2.2, < 4.0)
120148
regexp_parser (>= 1.8, < 3.0)
121149
rexml (>= 3.2.5, < 4.0)
122-
rubocop-ast (>= 1.23.0, < 2.0)
150+
rubocop-ast (>= 1.28.1, < 2.0)
123151
ruby-progressbar (~> 1.7)
124-
unicode-display_width (>= 1.4.0, < 3.0)
125-
rubocop-ast (1.24.0)
126-
parser (>= 3.1.1.0)
152+
unicode-display_width (>= 2.4.0, < 3.0)
153+
rubocop-ast (1.30.0)
154+
parser (>= 3.2.1.0)
155+
rubocop-capybara (2.19.0)
156+
rubocop (~> 1.41)
157+
rubocop-factory_bot (2.24.0)
158+
rubocop (~> 1.33)
127159
rubocop-rake (0.6.0)
128160
rubocop (~> 1.0)
129-
rubocop-rspec (2.16.0)
130-
rubocop (~> 1.33)
131-
ruby-progressbar (1.11.0)
161+
rubocop-rspec (2.25.0)
162+
rubocop (~> 1.40)
163+
rubocop-capybara (~> 2.17)
164+
rubocop-factory_bot (~> 2.22)
165+
ruby-progressbar (1.13.0)
132166
ruby-terraform (1.7.0.pre.18)
133167
immutable-struct (~> 2.4)
134168
lino (~> 3.0)
135169
ruby2_keywords (0.0.5)
136170
ruby2ruby (2.5.0)
137171
ruby_parser (~> 3.1)
138172
sexp_processor (~> 4.6)
173+
ruby_git_crypt (0.1.0.pre.2)
174+
immutable-struct (~> 2.4)
175+
lino (~> 3.0)
139176
ruby_gpg2 (0.10.0)
140177
lino (~> 3.0)
141-
ruby_parser (3.19.2)
178+
ruby_parser (3.20.3)
142179
sexp_processor (~> 4.16)
143180
rubyzip (2.3.2)
144181
sawyer (0.9.2)
145182
addressable (>= 2.3.5)
146183
faraday (>= 0.17.3, < 3)
147184
semantic (1.6.1)
148-
sexp_processor (4.16.1)
185+
sexp_processor (4.17.0)
149186
shikashi (0.6.0)
150187
evalhook (>= 0.6.0)
151188
getsource (>= 0.1.0)
152189
sshkey (2.0.0)
153-
tzinfo (2.0.5)
190+
tzinfo (2.0.6)
154191
concurrent-ruby (~> 1.0)
155-
unicode-display_width (2.3.0)
156-
vault (0.17.0)
192+
unicode-display_width (2.5.0)
193+
vault (0.18.1)
157194
aws-sigv4
158195

159196
PLATFORMS
160197
arm64-darwin-21
198+
arm64-darwin-22
199+
x86_64-darwin-19
200+
x86_64-darwin-21
161201
x86_64-linux
162202

163203
DEPENDENCIES
@@ -166,6 +206,8 @@ DEPENDENCIES
166206
httparty
167207
rake
168208
rake_circle_ci
209+
rake_git
210+
rake_git_crypt
169211
rake_github
170212
rake_gpg
171213
rake_ssh

Rakefile

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
require 'confidante'
44
require 'git'
55
require 'rake_circle_ci'
6+
require 'rake_git'
7+
require 'rake_git_crypt'
68
require 'rake_github'
79
require 'rake_gpg'
810
require 'rake_ssh'
@@ -39,9 +41,32 @@ RakeTerraform.define_installation_tasks(
3941
version: '1.3.1'
4042
)
4143

44+
RakeGitCrypt.define_standard_tasks(
45+
namespace: :git_crypt,
46+
47+
provision_secrets_task_name: :'secrets:provision',
48+
destroy_secrets_task_name: :'secrets:destroy',
49+
50+
install_commit_task_name: :'git:commit',
51+
uninstall_commit_task_name: :'git:commit',
52+
53+
gpg_user_key_paths: %w[
54+
config/gpg
55+
config/secrets/ci/gpg.public
56+
]
57+
)
58+
59+
namespace :git do
60+
RakeGit.define_commit_task(
61+
argument_names: [:message]
62+
) do |t, args|
63+
t.message = args.message
64+
end
65+
end
66+
4267
namespace :encryption do
4368
namespace :directory do
44-
desc 'Ensure CI secrets directory exists'
69+
desc 'Ensure CI secrets directory exists.'
4570
task :ensure do
4671
FileUtils.mkdir_p('config/secrets/ci')
4772
end
@@ -92,13 +117,24 @@ namespace :secrets do
92117
end
93118
end
94119

95-
desc 'Regenerate all secrets'
96-
task regenerate: %w[
120+
desc 'Generate all generatable secrets.'
121+
task generate: %w[
97122
directory:ensure
98123
encryption:passphrase:generate
99124
keys:deploy:generate
100125
keys:secrets:generate
101126
]
127+
128+
desc 'Provision all secrets.'
129+
task provision: [:generate]
130+
131+
desc 'Delete all secrets.'
132+
task :destroy do
133+
rm_rf 'config/secrets'
134+
end
135+
136+
desc 'Rotate all secrets.'
137+
task rotate: [:'git_crypt:reinstall']
102138
end
103139

104140
RakeCircleCI.define_project_tasks(

0 commit comments

Comments
 (0)