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 +4 -4
- data/.irbrc +1 -0
- data/Gemfile.lock +1 -1
- data/config/souls.rb +2 -1
- data/exe/souls +2 -0
- data/lib/souls.rb +14 -1
- data/lib/souls/gcloud.rb +6 -0
- data/lib/souls/gcloud/compute.rb +47 -0
- data/lib/souls/version.rb +1 -1
- data/souls.gemspec +2 -2
- metadata +12 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad1aa6db8ea97d9d94379f2f595edb466b255be7a715f324512950dd77d9b2e8
|
4
|
+
data.tar.gz: 4d379959eda286c89a0169c01766dd30d559e2ac49a74a3a6f48740ea8703e56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b13ee8853a57c8e14a6cc00be653003496c94290c534564fb09aae5cb5bc7e58d148a44f4dda24faa4127b603e2ac4f70af85c81cd1d5b10fa3cc306c53a100d
|
7
|
+
data.tar.gz: 1aa3c2be1087787354a0ec9033f81eba87ba37fdbb1860587deb093c9a85c34f1f921af668ea16eb9d9a79c3b7dfdd52061f669aa30fca9cfe24280ca9500ca6
|
data/.irbrc
CHANGED
data/Gemfile.lock
CHANGED
data/config/souls.rb
CHANGED
data/exe/souls
CHANGED
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
|
data/lib/souls/gcloud.rb
ADDED
@@ -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
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 = "
|
10
|
-
spec.description = "
|
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.
|
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-
|
13
|
+
date: 2021-07-12 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
|
-
description:
|
16
|
-
|
17
|
-
|
18
|
-
|
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:
|
91
|
-
|
92
|
-
|
93
|
-
|
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: []
|