stack_car 0.15.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +18 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +18 -0
- data/.github/workflows/rspec-action.yaml +35 -0
- data/lib/stack_car/cli.rb +10 -8
- data/lib/stack_car/version.rb +1 -1
- data/lib/stack_car.rb +10 -0
- data/stack_car.gemspec +3 -4
- data/templates/decrypt-secrets +1 -1
- metadata +18 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aed65228d5800ad11558a876bec39f0a8d39e7d26ee8f8129034b96dddce254b
|
4
|
+
data.tar.gz: 34d44f3b1b014a2a47d0b9bbbd2bfd811fbc60eb1a4b3918530742e716dc4757
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee8538051ee7aec8475b020825baa714f3044ed470d7bb65fee76a629667a442c91b38b6fbfa3d56284822b14f4b8b5ebc9bd3add7d09320c697c187b0aca0a6
|
7
|
+
data.tar.gz: 66642618c3291966017e0f22c3b7d1e3e504d12dbeb5f37fcefac3f68fb12dcd2fb454b7550e456f32ee7f42e05fa976266b3a6005f2aad3724511198e8613ff
|
@@ -0,0 +1,35 @@
|
|
1
|
+
name: Test
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- main
|
6
|
+
pull_request:
|
7
|
+
branches:
|
8
|
+
- main
|
9
|
+
jobs:
|
10
|
+
rspec:
|
11
|
+
name: Run rspec with ruby
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- name: Checkout code
|
15
|
+
uses: actions/checkout@v3
|
16
|
+
- name: Cache
|
17
|
+
uses: actions/cache@v2.1.3
|
18
|
+
with:
|
19
|
+
path: vendor/bundle
|
20
|
+
key: '2.3'
|
21
|
+
- name: Setup Ruby
|
22
|
+
uses: ruby/setup-ruby@v1.59.1
|
23
|
+
with:
|
24
|
+
ruby-version: '2.3'
|
25
|
+
- name: Dependencies
|
26
|
+
run: |
|
27
|
+
bundle config path vendor/bundle
|
28
|
+
bundle install
|
29
|
+
- name: Rspec
|
30
|
+
run: 'bundle exec rspec'
|
31
|
+
- name: Publish Test Report
|
32
|
+
uses: mikepenz/action-junit-report@v3
|
33
|
+
if: always() # always run even if the previous step fails
|
34
|
+
with:
|
35
|
+
report_paths: '**/build/test-results/test/TEST-*.xml'
|
data/lib/stack_car/cli.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'thor'
|
2
2
|
require 'erb'
|
3
|
-
require 'dotenv
|
3
|
+
require 'dotenv'
|
4
4
|
require 'json'
|
5
|
-
|
5
|
+
|
6
6
|
module StackCar
|
7
7
|
class HammerOfTheGods < Thor
|
8
8
|
include Thor::Actions
|
@@ -166,12 +166,13 @@ module StackCar
|
|
166
166
|
|
167
167
|
desc "release ENVIRONTMENT", "tag and push and image to the registry"
|
168
168
|
def release(environment)
|
169
|
+
Dotenv.load(".env.#{environment}", '.env')
|
169
170
|
setup
|
170
171
|
timestamp = Time.now.strftime("%Y%m%d%I%M%S")
|
171
172
|
sha = `git rev-parse HEAD`[0..8]
|
172
173
|
registry = "#{ENV['REGISTRY_HOST']}#{ENV['REGISTRY_URI']}"
|
173
174
|
tag = ENV["TAG"] || 'latest'
|
174
|
-
unless File.
|
175
|
+
unless File.exist?("#{ENV['HOME']}/.docker/config.json") && File.readlines("#{ENV['HOME']}/.docker/config.json").grep(/#{ENV['REGISTRY_HOST']}/).size > 0
|
175
176
|
run_with_exit("#{dotenv(environment)} docker login #{ENV['REGISTRY_HOST']}")
|
176
177
|
end
|
177
178
|
run_with_exit("#{dotenv(environment)} docker tag #{registry}:#{tag} #{registry}:#{environment}-#{timestamp}")
|
@@ -193,6 +194,7 @@ module StackCar
|
|
193
194
|
|
194
195
|
desc "ssh ENVIRONMENT", "log in to a running instance - requires PRODUCTION_SSH to be set"
|
195
196
|
def ssh(environment)
|
197
|
+
Dotenv.load(".env.#{environment}", '.env')
|
196
198
|
setup
|
197
199
|
target = ENV["#{environment.upcase}_SSH"]
|
198
200
|
if target
|
@@ -281,8 +283,8 @@ module StackCar
|
|
281
283
|
template("solrcloud-upload-configset.sh", "bin/solrcloud-upload-configset.sh")
|
282
284
|
template("solrcloud-assign-configset.sh", "bin/solrcloud-assign-configset.sh")
|
283
285
|
end
|
284
|
-
|
285
|
-
if File.
|
286
|
+
|
287
|
+
if File.exist?('README.md')
|
286
288
|
prepend_to_file "README.md" do
|
287
289
|
File.read("#{self.class.source_root}/README.md")
|
288
290
|
end
|
@@ -383,7 +385,7 @@ module StackCar
|
|
383
385
|
|
384
386
|
def find_config(dir)
|
385
387
|
path = File.join(dir, '.stackcar_rc')
|
386
|
-
if File.
|
388
|
+
if File.exist?(path)
|
387
389
|
return path
|
388
390
|
elsif dir == "/"
|
389
391
|
return nil
|
@@ -393,7 +395,7 @@ module StackCar
|
|
393
395
|
end
|
394
396
|
|
395
397
|
def ensure_development_env
|
396
|
-
if !File.
|
398
|
+
if !File.exist?('.env.development')
|
397
399
|
template(".env.development.erb", ".env.development")
|
398
400
|
end
|
399
401
|
end
|
@@ -403,7 +405,7 @@ module StackCar
|
|
403
405
|
end
|
404
406
|
|
405
407
|
def setup
|
406
|
-
if File.
|
408
|
+
if File.exist?('stack_car')
|
407
409
|
@sc_dir = true
|
408
410
|
Dir.chdir('stack_car')
|
409
411
|
self.destination_root += "/stack_car"
|
data/lib/stack_car/version.rb
CHANGED
data/lib/stack_car.rb
CHANGED
@@ -2,6 +2,16 @@ require "stack_car/version"
|
|
2
2
|
require "stack_car/cli"
|
3
3
|
require "stack_car/dot_rc"
|
4
4
|
|
5
|
+
##
|
6
|
+
# Ruby 3.x removed {File.exists?} in favor of {File.exist?}. This shim ensures that we can run
|
7
|
+
# stack_car in both Ruby 2.7 and Ruby 3.x land.
|
8
|
+
unless File.respond_to?(:exists?)
|
9
|
+
# We're aliasing the class method exist?, hence the `class << File` antics.
|
10
|
+
class << File
|
11
|
+
alias exists? exist?
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
5
15
|
module StackCar
|
6
16
|
# Your code goes here...
|
7
17
|
end
|
data/stack_car.gemspec
CHANGED
@@ -19,14 +19,13 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_development_dependency "bundler"
|
23
|
-
spec.add_development_dependency "
|
24
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
22
|
+
spec.add_development_dependency "bundler"
|
23
|
+
spec.add_development_dependency "rake"
|
25
24
|
spec.add_development_dependency "rspec", "~> 3.0"
|
26
25
|
spec.add_development_dependency "yard"
|
27
26
|
spec.add_development_dependency "yard-thor"
|
28
27
|
spec.add_development_dependency "pry"
|
29
|
-
spec.add_runtime_dependency "dotenv"
|
28
|
+
spec.add_runtime_dependency "dotenv"
|
30
29
|
spec.add_runtime_dependency "json", "~> 2.3"
|
31
30
|
spec.add_runtime_dependency "thor", "~> 0.19"
|
32
31
|
end
|
data/templates/decrypt-secrets
CHANGED
@@ -13,7 +13,7 @@ Dir.chdir(File.join(parent_dir))
|
|
13
13
|
].each do |files|
|
14
14
|
Dir.glob(files).each do |file|
|
15
15
|
if file.match(/enc/)
|
16
|
-
next unless File.
|
16
|
+
next unless File.exist?(file)
|
17
17
|
cmd = "sops --decrypt #{file} > #{file.gsub(/.enc$/, '')}"
|
18
18
|
puts cmd
|
19
19
|
`#{cmd}`
|
metadata
CHANGED
@@ -1,31 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stack_car
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Kaufman
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.13'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.13'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: byebug
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - ">="
|
@@ -42,16 +28,16 @@ dependencies:
|
|
42
28
|
name: rake
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
|
-
- - "
|
31
|
+
- - ">="
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
33
|
+
version: '0'
|
48
34
|
type: :development
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
|
-
- - "
|
38
|
+
- - ">="
|
53
39
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
40
|
+
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rspec
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,16 +98,16 @@ dependencies:
|
|
112
98
|
name: dotenv
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
|
-
- - "
|
101
|
+
- - ">="
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
103
|
+
version: '0'
|
118
104
|
type: :runtime
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
|
-
- - "
|
108
|
+
- - ">="
|
123
109
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
110
|
+
version: '0'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
112
|
name: json
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,7 +136,7 @@ dependencies:
|
|
150
136
|
- - "~>"
|
151
137
|
- !ruby/object:Gem::Version
|
152
138
|
version: '0.19'
|
153
|
-
description:
|
139
|
+
description:
|
154
140
|
email:
|
155
141
|
- rob@notch8.com
|
156
142
|
executables:
|
@@ -159,6 +145,9 @@ executables:
|
|
159
145
|
extensions: []
|
160
146
|
extra_rdoc_files: []
|
161
147
|
files:
|
148
|
+
- ".github/ISSUE_TEMPLATE.md"
|
149
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
150
|
+
- ".github/workflows/rspec-action.yaml"
|
162
151
|
- ".gitignore"
|
163
152
|
- ".gitlab-ci.yml"
|
164
153
|
- ".rspec"
|
@@ -251,7 +240,7 @@ files:
|
|
251
240
|
homepage: https://gitlab.com/notch8/stack_car
|
252
241
|
licenses: []
|
253
242
|
metadata: {}
|
254
|
-
post_install_message:
|
243
|
+
post_install_message:
|
255
244
|
rdoc_options: []
|
256
245
|
require_paths:
|
257
246
|
- lib
|
@@ -266,8 +255,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
266
255
|
- !ruby/object:Gem::Version
|
267
256
|
version: '0'
|
268
257
|
requirements: []
|
269
|
-
rubygems_version: 3.
|
270
|
-
signing_key:
|
258
|
+
rubygems_version: 3.4.19
|
259
|
+
signing_key:
|
271
260
|
specification_version: 4
|
272
261
|
summary: A tool to make rails + docker easy
|
273
262
|
test_files: []
|