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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 163a0612fcb59636db008669eb27569e63fe1e4a3701fc211ae5ff92690be49e
4
- data.tar.gz: 3850ab3b22daedd286886373963807e46af14040d7a021d6dedb9968801c40e0
3
+ metadata.gz: 07ae098b20cac4d8ec86d5e48051d6c56da16dc277531457a477f27a8a96a9a5
4
+ data.tar.gz: f249eeeac5666263becc47793d265a35e2e44e528672c54a71a35549db9c9b7a
5
5
  SHA512:
6
- metadata.gz: dd2cb7901bc22a359f6cced93fafe7f28ee4f978ab798c85eb8d39365270e8fb34bd193efb7614f3a6f550c3c062e9d2740ab8e70a51cc8b821c6b21af999baa
7
- data.tar.gz: 1307838fc825c08cfc91b0f72bf4b28d0742c3c2594f4e3a7c07bd1e48058c323fe721c509cf9c1ca4657f4033e40ce100ca3ad123656fd94561ba175e3b7abf
6
+ metadata.gz: 11b4afc23bb847933b18a945a01dbda983986ecbcf6ebe38404998e045a884957a04b80364fdf23aeb97129be896829b61e155e8ff0377f23f7ab8cd03c2e557
7
+ data.tar.gz: 6178ab087eefc04c1860c142b8954a1e51ced120204f84ce197d368f3ebc323c0aba1219a99129344de674b96fc3cd1d85d81a48747db0aaba71ff673dc3bc0e
data/config/souls.rb ADDED
@@ -0,0 +1,4 @@
1
+ Souls.configure do |config|
2
+ config.app = "souls"
3
+ config.strain = "api"
4
+ end
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
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.17.9"
2
+ VERSION = "0.18.0"
3
3
  end
data/lib/souls.rb CHANGED
@@ -11,19 +11,19 @@ module Souls
11
11
  attr_accessor :configuration
12
12
 
13
13
  def run_psql
14
- `docker run --rm -d \
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
- puts `docker ps`
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
- `gcloud scheduler jobs create http #{app}-awake --schedule "0,10,20,30,40,50 * * * *" --uri "https://#{app}.el-soul.com" --http-method GET`
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.17.9
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/initializers/souls.rb
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