souls 0.17.9 → 0.18.0
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/config/souls.rb +4 -0
- data/exe/souls +6 -2
- data/lib/souls/init.rb +13 -0
- data/lib/souls/version.rb +1 -1
- data/lib/souls.rb +5 -5
- metadata +2 -2
- data/config/initializers/souls.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07ae098b20cac4d8ec86d5e48051d6c56da16dc277531457a477f27a8a96a9a5
|
4
|
+
data.tar.gz: f249eeeac5666263becc47793d265a35e2e44e528672c54a71a35549db9c9b7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11b4afc23bb847933b18a945a01dbda983986ecbcf6ebe38404998e045a884957a04b80364fdf23aeb97129be896829b61e155e8ff0377f23f7ab8cd03c2e557
|
7
|
+
data.tar.gz: 6178ab087eefc04c1860c142b8954a1e51ced120204f84ce197d368f3ebc323c0aba1219a99129344de674b96fc3cd1d85d81a48747db0aaba71ff673dc3bc0e
|
data/config/souls.rb
ADDED
data/exe/souls
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require "souls"
|
3
3
|
STRAINS = ["graph", "worker", "media", "admin"]
|
4
|
+
begin
|
5
|
+
require "./config/souls" unless ARGV[0] == "new" || ARGV[0] == "i"
|
6
|
+
rescue
|
7
|
+
Souls::Init.config_init
|
8
|
+
end
|
4
9
|
begin
|
5
10
|
case ARGV[0]
|
6
11
|
when "new"
|
@@ -12,6 +17,7 @@ begin
|
|
12
17
|
strain = STDIN.gets.chomp.to_i
|
13
18
|
(1..4).include?(strain) ? puts("Generating SOULs.. \n") : raise(StandardError, "Choose Number 1..4")
|
14
19
|
Souls::Init.download_souls app_name: ARGV[1], repository_name: "souls_#{STRAINS[strain.to_i - 1]}"
|
20
|
+
initial_config_init app_name: "souls", project: { strain: STRAINS[strain.to_i - 1] }
|
15
21
|
when "s", "server"
|
16
22
|
strain = Souls.configuration.strain
|
17
23
|
case strain
|
@@ -37,8 +43,6 @@ begin
|
|
37
43
|
end
|
38
44
|
when "i", "infra"
|
39
45
|
Souls.send ARGV[1]
|
40
|
-
when "init"
|
41
|
-
Souls::Init.config_init
|
42
46
|
when "-v", "--version"
|
43
47
|
puts Souls::VERSION
|
44
48
|
when "add"
|
data/lib/souls/init.rb
CHANGED
@@ -8,6 +8,19 @@ module Souls
|
|
8
8
|
data[0]["tag_name"]
|
9
9
|
end
|
10
10
|
|
11
|
+
def initial_config_init app_name: "souls", project: {}
|
12
|
+
`touch "#{app_name}/config/souls.rb"`
|
13
|
+
file_path = "#{app_name}/config/souls.rb"
|
14
|
+
File.open(file_path, "w") do |f|
|
15
|
+
f.write <<~EOS
|
16
|
+
Souls.configure do |config|
|
17
|
+
config.app = "#{app_name}"
|
18
|
+
config.strain = "#{project[:strain]}"
|
19
|
+
end
|
20
|
+
EOS
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
11
24
|
def download_souls app_name: "souls", repository_name: "souls_service"
|
12
25
|
version = get_version repository_name: repository_name
|
13
26
|
system "curl -OL https://github.com/elsoul/#{repository_name}/archive/#{version}.tar.gz"
|
data/lib/souls/version.rb
CHANGED
data/lib/souls.rb
CHANGED
@@ -11,19 +11,19 @@ module Souls
|
|
11
11
|
attr_accessor :configuration
|
12
12
|
|
13
13
|
def run_psql
|
14
|
-
|
14
|
+
system "docker run --rm -d \
|
15
15
|
-p 5433:5432 \
|
16
16
|
-v postgres-tmp:/var/lib/postgresql/data \
|
17
17
|
-e POSTGRES_USER=postgres \
|
18
18
|
-e POSTGRES_PASSWORD=postgres \
|
19
19
|
-e POSTGRES_DB=souls_test \
|
20
|
-
postgres:13-alpine
|
21
|
-
|
20
|
+
postgres:13-alpine"
|
21
|
+
system "docker ps"
|
22
22
|
end
|
23
23
|
|
24
|
-
def run_awake
|
24
|
+
def run_awake url
|
25
25
|
app = Souls.configuration.app
|
26
|
-
|
26
|
+
system "gcloud scheduler jobs create http #{app}-awake --schedule '0,10,20,30,40,50 * * * *' --uri #{url} --http-method GET"
|
27
27
|
end
|
28
28
|
|
29
29
|
def deploy_local
|
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: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
@@ -40,7 +40,7 @@ files:
|
|
40
40
|
- Steepfile
|
41
41
|
- bin/console
|
42
42
|
- bin/setup
|
43
|
-
- config/
|
43
|
+
- config/souls.rb
|
44
44
|
- exe/souls
|
45
45
|
- lib/souls.rb
|
46
46
|
- lib/souls/generate.rb
|
@@ -1,14 +0,0 @@
|
|
1
|
-
Souls.configure do |config|
|
2
|
-
config.main_project_id = ""
|
3
|
-
config.project_id = ""
|
4
|
-
config.app = "souls"
|
5
|
-
config.namespace = ""
|
6
|
-
config.service_name = ""
|
7
|
-
config.network = ""
|
8
|
-
config.machine_type = ""
|
9
|
-
config.zone = ""
|
10
|
-
config.domain = ""
|
11
|
-
config.google_application_credentials = ""
|
12
|
-
config.strain = ""
|
13
|
-
config.proto_package_name = "souls"
|
14
|
-
end
|