souls 1.2.0 → 1.3.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/lib/souls/cli/db/index.rb +0 -1
- data/lib/souls/cli/gcloud/sql/index.rb +19 -2
- data/lib/souls/cli/github/index.rb +1 -8
- data/lib/souls/cli/init/index.rb +1 -0
- data/lib/souls/version.rb +1 -1
- data/lib/souls/versions/.souls_api_version +1 -1
- data/lib/souls/versions/.souls_worker_version +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9586ab30b5189eaa4af5cbd037ad0650d78a0ce8c89fd1591528d7ec4da70d8a
|
4
|
+
data.tar.gz: 14087a6358389fdc3f0de14ac3cde00233add048add040f379e229239d0f954f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e28e330548810a8804c51b287e4991c973fc918a5c2b8dab694a9998e6d5e930dc7a53cff8b33fb23db5f4ba501bea42bd931fb0c6d769f7f1bd6f287b91a768
|
7
|
+
data.tar.gz: eafd2c306469f2685fa93acd474afd51c729469bcc0721b7157c269a760364d84271ba7698f3bb20fcdd1872c2bf9ea1c20ddf583f5ce6deff795e879769ad64
|
data/lib/souls/cli/db/index.rb
CHANGED
@@ -3,15 +3,26 @@ module Souls
|
|
3
3
|
desc "create_instance", "Create Google Cloud SQL - PostgreSQL13"
|
4
4
|
method_option :region, default: "", aliases: "--region", desc: "Google Cloud Platform Region"
|
5
5
|
method_option :root_password, default: "", aliases: "--root-password", desc: "Set Cloud SQL Root Password"
|
6
|
+
method_option :mysql, type: :boolean, default: false, aliases: "--mysql", desc: "Set Cloud SQL Type to MySQL"
|
6
7
|
def create_instance
|
7
|
-
instance_name = "
|
8
|
+
instance_name = "souls-#{Souls.configuration.app}-db" if instance_name.blank?
|
8
9
|
region = Souls.configuration.region if options[:region].blank?
|
10
|
+
db_type = options[:mysql] ? "MYSQL_8_0" : "POSTGRES_13"
|
11
|
+
|
9
12
|
zone = "#{region}-b"
|
10
13
|
system(
|
11
14
|
"gcloud sql instances create #{instance_name} \
|
12
|
-
--database-version
|
15
|
+
--database-version=#{db_type} --cpu=2 --memory=7680MB --zone=#{zone} \
|
13
16
|
--root-password='#{options[:root_password]}' --database-flags cloudsql.iam_authentication=on"
|
14
17
|
)
|
18
|
+
Dir.chdir(Souls.get_api_path.to_s) do
|
19
|
+
file_path = ".env"
|
20
|
+
lines = File.readlines(".env")
|
21
|
+
lines[0] = "DB_HOST=#{get_sql_ip.strip}\n"
|
22
|
+
lines[1] = "DB_PW=#{options[:root_password]}\n"
|
23
|
+
lines[2] = "DB_USER=postgres\n"
|
24
|
+
File.open(file_path, "w") { |f| f.write(lines.join) }
|
25
|
+
end
|
15
26
|
rescue Thor::Error => e
|
16
27
|
raise(Thor::Error, e)
|
17
28
|
end
|
@@ -94,5 +105,11 @@ module Souls
|
|
94
105
|
rescue Thor::Error => e
|
95
106
|
raise(Thor::Error, e)
|
96
107
|
end
|
108
|
+
|
109
|
+
private
|
110
|
+
|
111
|
+
def get_sql_ip
|
112
|
+
`gcloud sql instances list | grep james | awk '{print $5}'`
|
113
|
+
end
|
97
114
|
end
|
98
115
|
end
|
@@ -1,12 +1,5 @@
|
|
1
1
|
module Souls
|
2
2
|
class Github < Thor
|
3
|
-
desc "auth_login", "gcloud config set and gcloud auth login"
|
4
|
-
def auth_login
|
5
|
-
system("gh auth login")
|
6
|
-
rescue Thor::Error => e
|
7
|
-
raise(Thor::Error, e)
|
8
|
-
end
|
9
|
-
|
10
3
|
desc "secret_set", "Github Secret Set by Github CLI"
|
11
4
|
def secret_set
|
12
5
|
require("#{Souls.get_api_path}/config/souls")
|
@@ -14,7 +7,7 @@ module Souls
|
|
14
7
|
File.open(file_path, "r") do |file|
|
15
8
|
file.each_line do |line|
|
16
9
|
key_and_value = line.split("=")
|
17
|
-
system("gh secret set #{key_and_value[0]} -b \"#{key_and_value[1]}\"")
|
10
|
+
system("gh secret set #{key_and_value[0]} -b \"#{key_and_value[1].strip}\"")
|
18
11
|
end
|
19
12
|
end
|
20
13
|
end
|
data/lib/souls/cli/init/index.rb
CHANGED
@@ -159,6 +159,7 @@ module Souls
|
|
159
159
|
system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Procfile")
|
160
160
|
system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Steepfile")
|
161
161
|
system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/gitignore")
|
162
|
+
system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/.env.production.sample")
|
162
163
|
system("cd #{app_name} && mv gitignore .gitignore")
|
163
164
|
system("cd #{app_name} && bundle")
|
164
165
|
system("cd #{app_name}/apps/api && bundle")
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.1
|
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.3.1
|
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: 1.
|
4
|
+
version: 1.3.1
|
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: 2021-10-
|
13
|
+
date: 2021-10-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|