docker_rails_proxy 0.2.4 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 873a065cab149074c38e094de0a69f8c7950c1e3a91d6caf7a4caee810e926a7
4
- data.tar.gz: c03370b0ae15790291cbd9ac9fd3f00290f181c2ad78aab345bce9a613104498
3
+ metadata.gz: c0a36f7252172ddf4b5cc4f2fe88555788bd9a7291242ac9c26379e7774a3470
4
+ data.tar.gz: 03fb2b8e5d68f72af9325e3c3c6d9385769ada6945bfda29a1e6b94681dfa603
5
5
  SHA512:
6
- metadata.gz: 1bba82f568174c4337fbadc1bc56326ec3d4d42a8845361838b171e9aad9faff53269fedb64e4ff88c99a0adeb23af890715799fb98708b415ae4c20d6630590
7
- data.tar.gz: 8281e2ccd0a694134903cf80de6e40b9533dcb12549a7ed0194657a2649bfcdbceb1349fa8aac5f49784783ad61fb2790fbeab7da40dea8a1561ca3593e3511c
6
+ metadata.gz: d8186d06f8038000538b95678e1d32d307999b2c65f3ab05efa6cd759b9882be4349131923a867bafc5bd73a88ad389dafd4805993b9e2d3d8580731b88fca8a
7
+ data.tar.gz: abf9d518993f79218142e17fa1d443f64e06b6fb81b9736188f8d224d68132cc6cabff3cdd0163d723683e97c979603bf5b34f727c236769736b433a39ef0c0e
@@ -34,7 +34,7 @@ module DockerRailsProxy
34
34
 
35
35
  before_process do
36
36
  self.from_scratch = if docker_compose?
37
- %x(docker-compose ps | grep -c #{APP_NAME}).to_i.zero?
37
+ %x(docker-compose ps -a | grep -c #{APP_NAME}).to_i.zero?
38
38
  elsif kubernetes?
39
39
  %x(kubectl get deployment #{APP_NAME} -o name).empty?
40
40
  end
@@ -0,0 +1,40 @@
1
+ module DockerRailsProxy
2
+ class Rails < SyncBack
3
+ class FhirApplicationCredentials < self
4
+ attr_accessor :options
5
+
6
+ after_initialize { self.options = {} }
7
+ after_initialize { opt_parser.parse!(arguments) }
8
+
9
+ validates { '--environment is required' if options[:environment].nil? }
10
+ validates { '--application is required' if options[:application].nil? }
11
+
12
+ def process
13
+ command = "RAILS_MASTER_KEY=$(<config/credentials/#{options[:environment]}.key) "\
14
+ "EDITOR=vim bin/rails encrypted:edit "\
15
+ "config/credentials/fhir_applications/" + options[:environment] + "/" + options[:application] + ".yml.enc"
16
+ execute "bash -c '#{command}'", tty: true
17
+ end
18
+
19
+ private
20
+
21
+ def opt_parser
22
+ @opt_parser ||= OptionParser.new do |opts|
23
+ opts.banner = "Usage: bin/#{APP_NAME} rails fhir_application_credentials [options]"
24
+ opts.on(
25
+ '--environment ENVIRONMENT', 'App environment'
26
+ ) { |environment| options[:environment] = environment }
27
+ opts.on(
28
+ '--application APPLICATION', 'App permalink'
29
+ ) { |application| options[:application] = application }
30
+
31
+ opts.on('-h', '--help', 'Display this screen') do
32
+ puts opts
33
+ exit
34
+ end
35
+ end
36
+ end
37
+
38
+ end
39
+ end
40
+ end
@@ -3,10 +3,12 @@ module DockerRailsProxy
3
3
  attr_reader :args
4
4
 
5
5
  autoload :Credentials, 'docker_rails_proxy/commands/rails/credentials'
6
+ autoload :FhirApplicationCredentials, 'docker_rails_proxy/commands/rails/fhir_application_credentials'
6
7
 
7
8
  builds ->(params:) do
8
9
  case params[:arguments].first
9
10
  when 'credentials' then Credentials
11
+ when 'fhir_application_credentials' then FhirApplicationCredentials
10
12
  else
11
13
  DockerRailsProxy::Rails
12
14
  end
@@ -1,3 +1,3 @@
1
1
  module DockerRailsProxy
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker_rails_proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jairo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-02-01 00:00:00.000000000 Z
12
+ date: 2023-07-03 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Configures docker-compose and provides rails command helpers
15
15
  email:
@@ -38,6 +38,7 @@ files:
38
38
  - lib/docker_rails_proxy/commands/kubectl/set_kubeconfig.rb
39
39
  - lib/docker_rails_proxy/commands/rails.rb
40
40
  - lib/docker_rails_proxy/commands/rails/credentials.rb
41
+ - lib/docker_rails_proxy/commands/rails/fhir_application_credentials.rb
41
42
  - lib/docker_rails_proxy/commands/rake.rb
42
43
  - lib/docker_rails_proxy/commands/rspec.rb
43
44
  - lib/docker_rails_proxy/commands/spring.rb
@@ -76,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
77
  - !ruby/object:Gem::Version
77
78
  version: '0'
78
79
  requirements: []
79
- rubygems_version: 3.2.15
80
+ rubygems_version: 3.4.10
80
81
  signing_key:
81
82
  specification_version: 4
82
83
  summary: docker, docker-compose and rails wrapper