souls 0.7.5 → 0.8.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: '0823980d65837aead6add63c442e3c750572c64289f926e5f1b0ed361ce634ab'
4
- data.tar.gz: be2292aa74d90857fffe33cc5b24af875311db2c25a94c16955c16515f57736d
3
+ metadata.gz: 560643126ebd83bbba6b537f3df4ff4dab5e071a4f5eaf95c4c80b41dfad178c
4
+ data.tar.gz: 82f2814417af32ed219cd812c5f3f03239f6e612bbe357b70b98f61e31570ca3
5
5
  SHA512:
6
- metadata.gz: 9a8fd3de8cd42aa0997d5f8691fcc028ecae4443443f712e40eb61a1fa412f04468e636acbaceeab19c84b3db7ef953a4b345c201a1e2b151cb82f438fe916d2
7
- data.tar.gz: a1c928ce66ef6dc9e240f5e96f5693fc9dc19a7c1193b763b94ebd1d4ff7ffafdaabf45d414a9b22236ce3990b6eaad4139d7fdc95d683dd8b6fe19a741a1201
6
+ metadata.gz: ee757a67e212e058cc07b35bc8d4c74af030e9e60a7e58312623349ea5c5a6bed113ff769dcdc2eb755a7445bad7e13ba5a069636be6be18f30bfe4f34f69486
7
+ data.tar.gz: 97327b26bba04c5f4c8699540fa6a4708084c7d01a34730fb463d66a1b70ee41833c306cf4d8a9c3cc6daeff7a3d7c835ea15a7146d96f93a5dafba415369045
data/.irbrc CHANGED
@@ -1,2 +0,0 @@
1
- require "souls"
2
- require "./config/initialize/souls"
@@ -194,4 +194,8 @@ Style/RedundantFileExtensionInRequire:
194
194
  Style/ClassMethodsDefinitions:
195
195
  Enabled: false
196
196
  Style/GlobalStdStream:
197
+ Enabled: false
198
+ Layout/IndentationConsistency:
199
+ Enabled: false
200
+ Layout/IndentationWidth:
197
201
  Enabled: false
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- souls (0.7.4)
4
+ souls (0.7.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/exe/souls CHANGED
@@ -47,13 +47,22 @@ begin
47
47
  `touch .gitignore`
48
48
  `touch .irbrc`
49
49
  when "t", "test"
50
- `bundle exec rspec`
50
+ case ARGV[1]
51
+ when "-r"
52
+ `bundle exec rspec`
53
+ when "-s"
54
+ `bundle exec steep check`
55
+ else
56
+ `bundle exec steep check`
57
+ `bundle exec rspec`
58
+ end
51
59
  when "deploy"
52
- `gcloud builds submit --config=cloudbuild.yml --project $PROJECT_ID`
60
+ project_id = Souls.configuration.project_id
61
+ `gcloud builds submit --config=cloudbuild.yml --project #{project_id}`
53
62
  else
54
63
  puts "Welcome to Souls!Yeah!"
55
64
  end
56
65
  rescue StandardError => error
57
66
  puts error
58
67
  puts "Thank you!Souls!"
59
- end
68
+ end
@@ -1,5 +1,6 @@
1
1
  require "souls/version"
2
2
  require "souls/init"
3
+ require "json"
3
4
 
4
5
  module Souls
5
6
  class Error < StandardError; end
@@ -192,8 +193,8 @@ module Souls
192
193
  end
193
194
 
194
195
  def create_namespace
195
- app = Souls.configuration.app
196
- system("kubectl create namespace #{app}")
196
+ namespace = Souls.configuration.namespace
197
+ system("kubectl create namespace #{namespace}")
197
198
  end
198
199
 
199
200
  def create_ip
@@ -245,13 +246,24 @@ module Souls
245
246
  app = Souls.configuration.app
246
247
  namespace = Souls.configuration.namespace
247
248
  domain = Souls.configuration.domain
248
- `echo "#{domain}. 300 IN A $(kubectl get ingress --namespace #{namespace} | grep #{app} | awk '{print $3}')" >> ./infra/config/dns_conf`
249
+ `echo "#{domain}. 300 IN A $(kubectl get ingress --namespace #{namespace} | grep #{app} | awk '{print $3}')" >> ./infra/dns_conf`
249
250
  "created dns file!"
250
251
  end
251
252
 
252
253
  def set_dns
253
- project_id = Souls.configuration.project_id
254
- `gcloud dns record-sets import -z=#{project_id} --zone-file-format ./infra/config/dns_conf`
254
+ project_id = Souls.configuration.main_project_id
255
+ `gcloud dns record-sets import -z=#{project_id} --zone-file-format ./infra/dns_conf`
256
+ end
257
+
258
+ def service_api_enable
259
+ `gcloud services enable iam.googleapis.com`
260
+ `gcloud services enable dns.googleapis.com`
261
+ `gcloud services enable container.googleapis.com`
262
+ `gcloud services enable containerregistry.googleapis.com`
263
+ `gcloud services enable servicenetworking.googleapis.com`
264
+ `gcloud services enable sqladmin.googleapis.com`
265
+ `gcloud services enable sql-component.googleapis.com`
266
+ `gcloud services enable cloudbuild.googleapis.com`
255
267
  end
256
268
 
257
269
  def update_container zone: :asia
@@ -362,13 +374,19 @@ module Souls
362
374
  -v postgres-tmp:/var/lib/postgresql/data \
363
375
  -e POSTGRES_USER=postgres \
364
376
  -e POSTGRES_PASSWORD=postgres \
365
- -e POSTGRES_DB=souls_dev \
366
- postgres:12-alpine`
367
- system "docker ps"
377
+ -e POSTGRES_DB=souls_test \
378
+ postgres:13-alpine`
379
+ `docker ps`
380
+ end
381
+
382
+ def run_awake
383
+ app = Souls.configuration.app
384
+ `gcloud scheduler jobs create http #{app}-awake --schedule "0,10,20,30,40,50 * * * *" --uri "https://#{app}.el-soul.com" --http-method GET`
368
385
  end
369
386
 
370
387
  def deploy_local
371
388
  `docker network create --driver bridge shared`
389
+
372
390
  `docker run -d --name proxy \
373
391
  -p 80:80 -p 443:443 \
374
392
  -v "/var/run/docker.sock:/tmp/docker.sock:ro" \
@@ -378,6 +396,7 @@ module Souls
378
396
  --network shared \
379
397
  --restart always \
380
398
  jwilder/nginx-proxy`
399
+
381
400
  `docker run -d --name letsencrypt \
382
401
  -v "/home/certs:/etc/nginx/certs" \
383
402
  -v "/var/run/docker.sock:/var/run/docker.sock:ro" \
@@ -385,6 +404,7 @@ module Souls
385
404
  --network shared \
386
405
  --restart always \
387
406
  jrcs/letsencrypt-nginx-proxy-companion`
407
+
388
408
  `docker run -d --name nginx \
389
409
  -p 80:80 \
390
410
  -e VIRTUAL_HOST=souls.el-soul.com \
@@ -392,11 +412,12 @@ module Souls
392
412
  -e LETSENCRYPT_EMAIL=info@gmail.com \
393
413
  --network shared \
394
414
  --link web \
395
- poppinfumi/nginx-http:latest`
415
+ poppinfumi/ruby-nginx:latest`
416
+
396
417
  `docker run -d --name web \
397
418
  -p 3000:3000 \
398
419
  --network shared \
399
- asia.gcr.io/kaien-elixir/kaien:v2`
420
+ poppinfumi/souls_api`
400
421
  end
401
422
  end
402
423
 
@@ -12,7 +12,7 @@ module Souls
12
12
  project[:main_project_id] == "" ? project[:main_project_id] = "elsoul2" : true
13
13
  puts "Google Cloud PROJECT_ID: (default: elsoul2)"
14
14
  project[:project_id] = STDIN.gets.chomp
15
- project[:project_id] == "" ? project[:project_id] = "elsoul2" : true
15
+ project[:project_id] = "elsoul2" if project[:project_id] == ""
16
16
  puts "VPC Network Name: (default: default)"
17
17
  project[:network] = STDIN.gets.chomp
18
18
  project[:network] == "" ? project[:network] = "default" : true
@@ -163,6 +163,7 @@ module Souls
163
163
  end
164
164
 
165
165
  def api_deploy
166
+ Souls.service_api_enable
166
167
  Souls.create_service_account
167
168
  Souls.create_service_account_key
168
169
  Souls.add_service_account_role
@@ -1,3 +1,3 @@
1
1
  module Souls
2
- VERSION = "0.7.5"
2
+ VERSION = "0.8.0"
3
3
  end
Binary file
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.7.5
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-01-04 00:00:00.000000000 Z
12
+ date: 2021-01-08 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: SOULS is a Web Application Framework for Microservices on Multi Cloud
15
15
  Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud.
@@ -45,6 +45,7 @@ files:
45
45
  - lib/souls/version.rb
46
46
  - rbs/init.rbs
47
47
  - souls.gemspec
48
+ - v0.0.8.tar.gz
48
49
  homepage: https://github.com/elsoul/souls
49
50
  licenses:
50
51
  - Apache-2.0