souls 0.21.7 → 0.21.8

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: 499a395ac34e3e202310dbe492af5735bf57244af647ca9aea839c29636ca1b8
4
- data.tar.gz: 0122ccd831be8640e4ba0faa010a9bc3229dbe0dcefb9eedc42a5d5a33cb2ad9
3
+ metadata.gz: ad1aa6db8ea97d9d94379f2f595edb466b255be7a715f324512950dd77d9b2e8
4
+ data.tar.gz: 4d379959eda286c89a0169c01766dd30d559e2ac49a74a3a6f48740ea8703e56
5
5
  SHA512:
6
- metadata.gz: 0f31eda96afd418bb9dbb61cf020c3518f1183ce019aa28fa977755f1c0074f806b4ced0b0355727cf59b9cd9e1c287e734769aff632f17b722846e54570ddf2
7
- data.tar.gz: 2b1d1774879089a7dd4584751508a2831bc914219dc68d680f92ae5d75371204875c239393d7dafad7eb9086e1341aaa2dc0b51319e0ae9c14de2b856eaefe27
6
+ metadata.gz: b13ee8853a57c8e14a6cc00be653003496c94290c534564fb09aae5cb5bc7e58d148a44f4dda24faa4127b603e2ac4f70af85c81cd1d5b10fa3cc306c53a100d
7
+ data.tar.gz: 1aa3c2be1087787354a0ec9033f81eba87ba37fdbb1860587deb093c9a85c34f1f921af668ea16eb9d9a79c3b7dfdd52061f669aa30fca9cfe24280ca9500ca6
data/.irbrc CHANGED
@@ -1 +1,2 @@
1
1
  require "./lib/souls"
2
+ require "./config/souls"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.21.6)
4
+ souls (0.21.8)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/config/souls.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  Souls.configure do |config|
2
- config.app = "souls"
2
+ config.app = "souls-app"
3
+ config.project_id = "souls-app-319212"
3
4
  config.strain = "api"
4
5
  end
data/exe/souls CHANGED
@@ -43,6 +43,8 @@ begin
43
43
  end
44
44
  when "i", "infra"
45
45
  Souls.send ARGV[1]
46
+ when "gcloud"
47
+ Souls::Gcloud.send ARGV[1]
46
48
  when "-v", "--version"
47
49
  puts Souls::VERSION
48
50
  when "add"
data/lib/souls.rb CHANGED
@@ -2,6 +2,7 @@ require_relative "souls/version"
2
2
  require "active_support/core_ext/string/inflections"
3
3
  require_relative "souls/init"
4
4
  require_relative "souls/generate"
5
+ require_relative "souls/gcloud"
5
6
  require "json"
6
7
  require "fileutils"
7
8
 
@@ -35,6 +36,17 @@ module Souls
35
36
  system "docker ps"
36
37
  end
37
38
 
39
+ def run_mysql
40
+ system "docker run --rm -d \
41
+ -p 3306:3306 \
42
+ -v mysql-tmp:/var/lib/mysqlql/data \
43
+ -e MYSQL_USER=mysql \
44
+ -e MYSQL_PASSWORD=mysql \
45
+ -e MYSQL_DB=souls_test \
46
+ mysql:latest"
47
+ system "docker ps"
48
+ end
49
+
38
50
  def run_awake url
39
51
  app = Souls.configuration.app
40
52
  system "gcloud scheduler jobs create http #{app}-awake --schedule '0,10,20,30,40,50 * * * *' --uri #{url} --http-method GET"
@@ -47,10 +59,11 @@ module Souls
47
59
  end
48
60
 
49
61
  class Configuration
50
- attr_accessor :app, :strain
62
+ attr_accessor :app, :strain, :project_id
51
63
 
52
64
  def initialize
53
65
  @app = nil
66
+ @project_id = nil
54
67
  @strain = nil
55
68
  end
56
69
  end
@@ -0,0 +1,6 @@
1
+ require_relative "./gcloud/compute"
2
+
3
+ module Souls
4
+ module Gcloud
5
+ end
6
+ end
@@ -0,0 +1,47 @@
1
+ module Souls
2
+ module Gcloud
3
+ class << self
4
+ def enable_permissions
5
+ system "gcloud services enable compute.googleapis.com"
6
+ puts "Operating permission to compute.googleapis.com ..."
7
+ system "gcloud services enable sqladmin.googleapis.com"
8
+ puts "Operating permission to sqladmin.googleapis.com ..."
9
+ system "gcloud services enable sql-component.googleapis.com"
10
+ puts "Operating permission to sql-component.googleapis.com ..."
11
+ system "gcloud services enable servicenetworking.googleapis.com"
12
+ puts "Operating permission to servicenetworking.googleapis.com ..."
13
+ end
14
+
15
+ def create_network
16
+ return "Error: Please Set Souls.configuration" if Souls.configuration.app.nil?
17
+ network = Souls.configuration.app
18
+ system "gcloud compute networks create #{network}"
19
+ rescue StandardError => e
20
+ raise StandardError, e
21
+ end
22
+
23
+ def create_firewall ip_range: "10.140.0.0/20"
24
+ network = Souls.configuration.app
25
+ system "gcloud compute firewall-rules create #{network} --network #{network} --allow tcp,udp,icmp --source-ranges #{ip_range}"
26
+ system "gcloud compute firewall-rules create #{network}-ssh --network #{network} --allow tcp:22,tcp:3389,icmp"
27
+ end
28
+
29
+ def create_private_access
30
+ network = Souls.configuration.app
31
+ project_id = Souls.configuration.project_id
32
+ system "gcloud compute addresses create #{network}-my-network \
33
+ --global \
34
+ --purpose=VPC_PEERING \
35
+ --prefix-length=16 \
36
+ --description='peering range for SOULs' \
37
+ --network=#{network} \
38
+ --project=#{project_id}"
39
+ end
40
+
41
+ def create_sql_instance root_pass: "Postgre123!", zone: "asia-northeast1-b"
42
+ app = "#{Souls.configuration.app}-db"
43
+ system "gcloud sql instances create #{app} --database-version=POSTGRES_13 --cpu=2 --memory=7680MB --zone=#{zone} --root-password='#{root_pass}' --database-flags cloudsql.iam_authentication=on"
44
+ end
45
+ end
46
+ end
47
+ end
data/lib/souls/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.21.7"
2
+ VERSION = "0.21.8"
3
3
  end
data/souls.gemspec CHANGED
@@ -6,8 +6,8 @@ Gem::Specification.new do |spec|
6
6
  spec.authors = ["POPPIN-FUMI", "KishiTheMechanic", "James Neve"]
7
7
  spec.email = ["f.kawasaki@elsoul.nl", "s.kishi@elsoul.nl", "jamesoneve@gmail.com"]
8
8
 
9
- spec.summary = "SOULS is a GraphQL Based Web Application Framework for Microservices on Multi Cloud Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud. Auto deploy with scalable condition. You can focus on business logic. No more infra problems."
10
- spec.description = "SOULS is a GraphQL Based Web Application Framework for Microservices on Multi Cloud Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud. Auto deploy with scalable condition. You can focus on business logic. No more infra problems."
9
+ spec.summary = "SOULs is a Serverless Application Framework. SOULs has four strains, API, Worker, Console, Media, and can be used in combination according to the purpose. SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google Cloud and Amazon Web Services"
10
+ spec.description = "SOULs is a Serverless Application Framework. SOULs has four strains, API, Worker, Console, Media, and can be used in combination according to the purpose. SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google Cloud and Amazon Web Services"
11
11
  spec.homepage = "https://github.com/elsoul/souls"
12
12
  spec.license = "Apache-2.0"
13
13
  spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
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.21.7
4
+ version: 0.21.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -10,12 +10,12 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-07-07 00:00:00.000000000 Z
13
+ date: 2021-07-12 00:00:00.000000000 Z
14
14
  dependencies: []
15
- description: SOULS is a GraphQL Based Web Application Framework for Microservices
16
- on Multi Cloud Platform such as Google Cloud Platform, Amazon Web Services, and
17
- Alibaba Cloud. Auto deploy with scalable condition. You can focus on business logic.
18
- No more infra problems.
15
+ description: SOULs is a Serverless Application Framework. SOULs has four strains,
16
+ API, Worker, Console, Media, and can be used in combination according to the purpose.
17
+ SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google
18
+ Cloud and Amazon Web Services
19
19
  email:
20
20
  - f.kawasaki@elsoul.nl
21
21
  - s.kishi@elsoul.nl
@@ -44,6 +44,8 @@ files:
44
44
  - db/schema.rb
45
45
  - exe/souls
46
46
  - lib/souls.rb
47
+ - lib/souls/gcloud.rb
48
+ - lib/souls/gcloud/compute.rb
47
49
  - lib/souls/generate.rb
48
50
  - lib/souls/generate/application.rb
49
51
  - lib/souls/generate/model.rb
@@ -87,8 +89,8 @@ requirements: []
87
89
  rubygems_version: 3.2.15
88
90
  signing_key:
89
91
  specification_version: 4
90
- summary: SOULS is a GraphQL Based Web Application Framework for Microservices on Multi
91
- Cloud Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud.
92
- Auto deploy with scalable condition. You can focus on business logic. No more infra
93
- problems.
92
+ summary: SOULs is a Serverless Application Framework. SOULs has four strains, API,
93
+ Worker, Console, Media, and can be used in combination according to the purpose.
94
+ SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google
95
+ Cloud and Amazon Web Services
94
96
  test_files: []