souls 1.8.17 → 1.9.3

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: a08f3642096849fe5c48e6db57dbee722573b0b222829043dbb43f94c3720696
4
- data.tar.gz: cda60b0e448c4567904a9e4d4ad1a0b148cb105f7cc2622fcf0b9a190b6f3d48
3
+ metadata.gz: b722ae9b809027ed3f277c78d1f317f2a7895f3dd5dad7e34d399bd6d50fd204
4
+ data.tar.gz: fe87897572e0abf64687f4401571c60c9ac2fe9ecb434862650392b61170492e
5
5
  SHA512:
6
- metadata.gz: 3c7f93df1bbaca884fd667294eea99e635f525c8394e734c1a9af7018e71a6fd23f66ef75958aeee2d2bee932541470d29bb2bee07db150094894bf09af2900b
7
- data.tar.gz: 3e06e81a5e6197dc728bfa0b81a637ab76c0c7733ae6e1669d7559712cfd88b0656ce01367e55434a882f59ea972626c6c6895dc482edbbc648b182864b0b855
6
+ metadata.gz: 01ce609f82f57560a167a62dbe4329b7a46db5a234a0dce2e4368fbf117a2a5e88e3d6cae3423a246f274de36e28adb9bb7497cda671bd7eb1296b1860aca54f
7
+ data.tar.gz: 9b45d88872e0d3ae5995511376d9fe6327d15f6c5a01807312a467a4e2c19c24bbfe6458d6cdb8b76528c6aa62be2d6a72d001964ba3b79685883d461b2bbad4
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,74 +1,133 @@
1
+
1
2
  # Contributor Covenant Code of Conduct
2
3
 
3
4
  ## Our Pledge
4
5
 
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
6
+ We as members, contributors, and leaders pledge to make participation in our
7
+ community a harassment-free experience for everyone, regardless of age, body
8
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
9
+ identity and expression, level of experience, education, socio-economic status,
10
+ nationality, personal appearance, race, caste, color, religion, or sexual
11
+ identity and orientation.
12
+
13
+ We pledge to act and interact in ways that contribute to an open, welcoming,
14
+ diverse, inclusive, and healthy community.
11
15
 
12
16
  ## Our Standards
13
17
 
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
18
+ Examples of behavior that contributes to a positive environment for our
19
+ community include:
16
20
 
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
21
+ * Demonstrating empathy and kindness toward other people
22
+ * Being respectful of differing opinions, viewpoints, and experiences
23
+ * Giving and gracefully accepting constructive feedback
24
+ * Accepting responsibility and apologizing to those affected by our mistakes,
25
+ and learning from the experience
26
+ * Focusing on what is best not just for us as individuals, but for the overall
27
+ community
22
28
 
23
- Examples of unacceptable behavior by participants include:
29
+ Examples of unacceptable behavior include:
24
30
 
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
31
+ * The use of sexualized language or imagery, and sexual attention or advances of
32
+ any kind
33
+ * Trolling, insulting or derogatory comments, and personal or political attacks
28
34
  * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
35
+ * Publishing others' private information, such as a physical or email address,
36
+ without their explicit permission
31
37
  * Other conduct which could reasonably be considered inappropriate in a
32
38
  professional setting
33
39
 
34
- ## Our Responsibilities
40
+ ## Enforcement Responsibilities
35
41
 
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
39
46
 
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
45
51
 
46
52
  ## Scope
47
53
 
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official e-mail address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
54
59
 
55
60
  ## Enforcement
56
61
 
57
62
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at fumitake.kawasaki@el-soul.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
+ reported to the community leaders responsible for enforcement at
64
+ [INSERT CONTACT METHOD].
65
+ All complaints will be reviewed and investigated promptly and fairly.
66
+
67
+ All community leaders are obligated to respect the privacy and security of the
68
+ reporter of any incident.
69
+
70
+ ## Enforcement Guidelines
71
+
72
+ Community leaders will follow these Community Impact Guidelines in determining
73
+ the consequences for any action they deem in violation of this Code of Conduct:
74
+
75
+ ### 1. Correction
76
+
77
+ **Community Impact**: Use of inappropriate language or other behavior deemed
78
+ unprofessional or unwelcome in the community.
79
+
80
+ **Consequence**: A private, written warning from community leaders, providing
81
+ clarity around the nature of the violation and an explanation of why the
82
+ behavior was inappropriate. A public apology may be requested.
83
+
84
+ ### 2. Warning
63
85
 
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
86
+ **Community Impact**: A violation through a single incident or series of
87
+ actions.
88
+
89
+ **Consequence**: A warning with consequences for continued behavior. No
90
+ interaction with the people involved, including unsolicited interaction with
91
+ those enforcing the Code of Conduct, for a specified period of time. This
92
+ includes avoiding interactions in community spaces as well as external channels
93
+ like social media. Violating these terms may lead to a temporary or permanent
94
+ ban.
95
+
96
+ ### 3. Temporary Ban
97
+
98
+ **Community Impact**: A serious violation of community standards, including
99
+ sustained inappropriate behavior.
100
+
101
+ **Consequence**: A temporary ban from any sort of interaction or public
102
+ communication with the community for a specified period of time. No public or
103
+ private interaction with the people involved, including unsolicited interaction
104
+ with those enforcing the Code of Conduct, is allowed during this period.
105
+ Violating these terms may lead to a permanent ban.
106
+
107
+ ### 4. Permanent Ban
108
+
109
+ **Community Impact**: Demonstrating a pattern of violation of community
110
+ standards, including sustained inappropriate behavior, harassment of an
111
+ individual, or aggression toward or disparagement of classes of individuals.
112
+
113
+ **Consequence**: A permanent ban from any sort of public interaction within the
114
+ community.
67
115
 
68
116
  ## Attribution
69
117
 
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
118
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119
+ version 2.1, available at
120
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121
+
122
+ Community Impact Guidelines were inspired by
123
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124
+
125
+ For answers to common questions about this code of conduct, see the FAQ at
126
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127
+ [https://www.contributor-covenant.org/translations][translations].
72
128
 
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
129
+ [homepage]: https://www.contributor-covenant.org
130
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131
+ [Mozilla CoC]: https://github.com/mozilla/diversity
132
+ [FAQ]: https://www.contributor-covenant.org/faq
133
+ [translations]: https://www.contributor-covenant.org/translations
@@ -170,6 +170,9 @@ end
170
170
  service_account_key: ${{ secrets.SOULS_GCP_SA_KEY }}
171
171
  export_default_credentials: true
172
172
 
173
+ - name: Sync Tasks
174
+ run: cd apps/#{worker_name} && souls gcloud scheduler sync_schedules
175
+
173
176
  - name: Configure Docker
174
177
  run: gcloud auth configure-docker --quiet
175
178
 
@@ -195,7 +198,7 @@ end
195
198
  --set-env-vars="SOULS_DB_USER=${{ secrets.SOULS_DB_USER }}" \\
196
199
  --set-env-vars="SOULS_DB_PW=${{ secrets.SOULS_DB_PW }}" \\
197
200
  --set-env-vars="SOULS_DB_HOST=${{ secrets.SOULS_DB_HOST }}" \\
198
- --set-env-vars="SOULS_TZ=${{ secrets.SOULS_TZ }}" \\
201
+ --set-env-vars="TZ=${{ secrets.TZ }}" \\
199
202
  --set-env-vars="SOULS_SECRET_KEY_BASE=${{ secrets.SOULS_SECRET_KEY_BASE }}" \\
200
203
  --set-env-vars="SOULS_PROJECT_ID=${{ secrets.SOULS_GCP_PROJECT_ID }}"
201
204
  TEXT
@@ -224,8 +227,6 @@ end
224
227
  end
225
228
  TEXT
226
229
  end
227
- rescue StandardError => e
228
- puts(e)
229
230
  end
230
231
 
231
232
  def souls_helper_rbs(worker_name: "mailer")
@@ -273,11 +274,12 @@ end
273
274
  version = Souls.get_latest_version_txt(service_name: "worker").join(".")
274
275
  file_name = "worker-v#{version}.tgz"
275
276
  url = "https://storage.googleapis.com/souls-bucket/boilerplates/workers/#{file_name}"
277
+ puts(url)
276
278
  system("curl -OL #{url}")
277
279
  system("tar -zxvf ./#{file_name}")
278
280
  system("mv ./worker apps/#{worker_name}")
279
281
  system("cp ./apps/api/config/database.yml ./apps/#{worker_name}/config/")
280
- FileUtils.rm(file_name)
282
+ FileUtils.rm_f(file_name)
281
283
  end
282
284
 
283
285
  def souls_worker_credit(worker_name: "mailer")
@@ -91,7 +91,8 @@ module Souls
91
91
  "roles/iam.serviceAccountUser",
92
92
  "roles/run.admin",
93
93
  "roles/storage.admin",
94
- "roles/storage.objectAdmin"
94
+ "roles/storage.objectAdmin",
95
+ "roles/cloudscheduler.admin"
95
96
  ]
96
97
  roles.each do |role|
97
98
  add_service_account_role(role: role)
@@ -3,6 +3,7 @@ require_relative "./pubsub/index"
3
3
  require_relative "./run/index"
4
4
  require_relative "./sql/index"
5
5
  require_relative "./compute/index"
6
+ require_relative "./scheduler/index"
6
7
  require_relative "../cli_exception"
7
8
 
8
9
  module Souls
@@ -22,13 +23,16 @@ module Souls
22
23
  desc "run [COMMAND]", "souls gcloud run Commands"
23
24
  subcommand "cloud_run", CloudRun
24
25
 
26
+ desc "scheduler [COMMAND]", "souls gcloud schedluer Commands"
27
+ subcommand "scheduler", CloudScheduler
28
+
25
29
  map run: "cloud_run"
26
30
 
27
31
  desc "auth_login", "gcloud config set and gcloud auth login"
28
32
  def auth_login
29
33
  project_id = Souls.configuration.project_id
30
34
  system("gcloud projects describe #{project_id}", out: File::NULL) or raise(Souls::GcloudException)
31
- system("gcloud config set project #{project_id}")
35
+ system("gcloud config set project #{project_id} >/dev/null 2>&1")
32
36
  system("gcloud auth login")
33
37
  end
34
38
 
@@ -36,7 +40,7 @@ module Souls
36
40
  def config_set
37
41
  project_id = Souls.configuration.project_id
38
42
  system("gcloud projects describe #{project_id}", out: File::NULL) or raise(Souls::GcloudException)
39
- system("gcloud config set project #{project_id}")
43
+ system("gcloud config set project #{project_id} >/dev/null 2>&1")
40
44
  end
41
45
 
42
46
  desc "enable_permissions", "Enable Google Cloud APIs for SOULs Framework"
@@ -50,6 +54,7 @@ module Souls
50
54
  system("gcloud services enable containerregistry.googleapis.com")
51
55
  system("gcloud services enable run.googleapis.com")
52
56
  system("gcloud services enable vpcaccess.googleapis.com")
57
+ system("gcloud services enable cloudscheduler.googleapis.com")
53
58
  end
54
59
  end
55
60
  end
@@ -1,15 +1,5 @@
1
1
  module Souls
2
2
  class CloudRun < Thor
3
- desc "awake", "Set Ping Every 15min by Google Cloud Scheduler"
4
- method_option :url, default: "https://souls.souls.nl", aliases: "--url", desc: "Set URL"
5
- def awake
6
- app_name = Souls.configuration.app
7
- system(
8
- "gcloud scheduler jobs create http #{app_name}-awake
9
- --schedule '0,10,20,30,40,50 * * * *' --uri #{url} --http-method GET"
10
- )
11
- end
12
-
13
3
  desc "list", "Show Google Cloud Run List"
14
4
  def list
15
5
  system("gcloud run services list --platform managed")
@@ -0,0 +1,28 @@
1
+ module Souls
2
+ class CloudScheduler < Thor
3
+ desc "awake", "Set Ping Every 15min by Google Cloud Scheduler"
4
+ method_option :url, default: "https://souls.souls.nl", aliases: "--url", desc: "Set URL"
5
+ def awake
6
+ app_name = Souls.configuration.app
7
+ system(
8
+ "gcloud scheduler jobs create http #{app_name}-awake
9
+ --schedule '0,10,20,30,40,50 * * * *' --uri #{options[:url]} --http-method GET"
10
+ )
11
+ end
12
+
13
+ desc "sync_schedules", "Collect schedules from queries and sync with GCloud"
14
+ def sync_schedules
15
+ require("./app")
16
+ Souls::Gcloud.new.config_set
17
+ Queries::BaseQuery.all_schedules.each do |k, v|
18
+ worker_name = FileUtils.pwd.split("/").last
19
+ job_name = "#{worker_name}_#{k.to_s.underscore}"
20
+ system("gcloud scheduler jobs delete #{job_name} -q >/dev/null 2>&1")
21
+ system(
22
+ <<~COMMAND)
23
+ gcloud scheduler jobs create pubsub #{job_name} --quiet --schedule="#{v}" --topic="#{k}" --attributes="" --message-body="#{k}"
24
+ COMMAND
25
+ end
26
+ end
27
+ end
28
+ end
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "1.8.17".freeze
2
+ VERSION = "1.9.3".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.8.17
1
+ 1.9.3
@@ -1 +1 @@
1
- 1.8.17
1
+ 1.9.3
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.17
4
+ version: 1.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
8
8
  - KishiTheMechanic
9
9
  - James Neve
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-11-23 00:00:00.000000000 Z
13
+ date: 2021-11-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -168,6 +168,7 @@ files:
168
168
  - lib/souls/cli/gcloud/pubsub/subscriptions.rb
169
169
  - lib/souls/cli/gcloud/pubsub/topics.rb
170
170
  - lib/souls/cli/gcloud/run/index.rb
171
+ - lib/souls/cli/gcloud/scheduler/index.rb
171
172
  - lib/souls/cli/gcloud/sql/index.rb
172
173
  - lib/souls/cli/generate/application.rb
173
174
  - lib/souls/cli/generate/connection.rb
@@ -226,7 +227,7 @@ licenses:
226
227
  - Apache-2.0
227
228
  metadata:
228
229
  rubygems_mfa_required: 'true'
229
- post_install_message:
230
+ post_install_message:
230
231
  rdoc_options: []
231
232
  require_paths:
232
233
  - lib
@@ -242,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
243
  version: '0'
243
244
  requirements: []
244
245
  rubygems_version: 3.2.22
245
- signing_key:
246
+ signing_key:
246
247
  specification_version: 4
247
248
  summary: Build Serverless Apps faster like Rails. Powered by Ruby GraphQL, RBS/Steep,
248
249
  Active Record, RSpec, RuboCop, and Google Cloud.