souls 4.0.0 → 4.0.2

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: 45f0c640f8db0b677a7836a20cb4f0a2f4afbd7c154ff1ee7a2ad51e3ca4afdd
4
- data.tar.gz: 9ed914c80f91894dd80c86a221161d99288976c12fef515e1d525a35c2147067
3
+ metadata.gz: 7d2cd85b864251dcf53d9d6e1194097a4dbdb97567d67e849a0c018bf3d4a1b3
4
+ data.tar.gz: 77b19a0a8d7b768ed294285fd165f6c60baf3160ab0ca21183e2756722f4252a
5
5
  SHA512:
6
- metadata.gz: bfa290d33d6d56610dcb5cff34537f9e2655a0e13bc907792ca2e1b8073f8db867d7b5c2a7f96f1612fef7f08a9427ab8abeba7c7489032f0c203b9ddc7bc82d
7
- data.tar.gz: dfd65269355ca5ea00a69f6df5c6aa58ffffc6ab06b5144ca7ff30d01126184b1138100bdcac3f33fed9fc952ef0c186c0447802d08c4072fd8d27f96e748626
6
+ metadata.gz: c9b8930fe34f0ddf0367e15fe4360c9dac64c9feb87479ee94732388a294baa9d4afada65876cd405e94726f50cbb8594a1656a31b5e335cfad23702313d8eee
7
+ data.tar.gz: f9238ac61a3544de43c22a4273a1836593b99e9fc1d43db23a5f70c20eb31e0ba75276e0db404ccebbc28d8d0df9a0f78d271c6ac0d49d816a9bbe0ea3aeb651
data/lib/souls/cli.rb CHANGED
@@ -55,6 +55,11 @@ module SOULs
55
55
  system("bundle exec rspec")
56
56
  end
57
57
 
58
+ desc "secret", "Generate Secure Random String"
59
+ def secret
60
+ puts(SecureRandom.alphanumeric(85))
61
+ end
62
+
58
63
  desc "build", "Run Docker Build"
59
64
  def build
60
65
  app = SOULs.configuration.app
@@ -65,8 +70,7 @@ module SOULs
65
70
  def tag
66
71
  souls_config = SOULs.configuration
67
72
  app = souls_config.app
68
- region = souls_config.region
69
- gcr = region_to_container_url(region:)
73
+ gcr = souls_config.gcr_region
70
74
  project_id = souls_config.project_id
71
75
  system("docker tag #{app}:latest #{gcr}/#{project_id}/#{app}:latest")
72
76
  end
@@ -75,8 +79,7 @@ module SOULs
75
79
  def push
76
80
  souls_config = SOULs.configuration
77
81
  app = souls_config.app
78
- region = souls_config.region
79
- gcr = region_to_container_url(region:)
82
+ gcr = souls_config.gcr_region
80
83
  project_id = souls_config.project_id
81
84
  system("docker push #{gcr}/#{project_id}/#{app}:latest")
82
85
  end
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module SOULs
2
- VERSION = "4.0.0".freeze
2
+ VERSION = "4.0.2".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 4.0.0
1
+ 4.0.2
@@ -1 +1 @@
1
- 4.0.0
1
+ 4.0.2
data/lib/souls.rb CHANGED
@@ -40,5 +40,19 @@ module SOULs
40
40
  def instance_name
41
41
  "souls-#{@app}-db"
42
42
  end
43
+
44
+ def gcr_region
45
+ if @region.include?("asia")
46
+ "asia.gcr.io"
47
+ elsif @region.include?("eu")
48
+ "eu.gcr.io"
49
+ else
50
+ "gcr.io"
51
+ end
52
+ end
53
+
54
+ def gcp_db_host
55
+ "/cloudsql/#{@project_id}:#{@region}:#{instance_name}"
56
+ end
43
57
  end
44
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-09-12 00:00:00.000000000 Z
13
+ date: 2022-09-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport