exercism-config 0.52.0 → 0.57.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: 483dc9efe209d092e0424e2e05eb0ca1992f29a187ff35a198e02fbf65e531d5
4
- data.tar.gz: b03b79b8f90694b75ec9d6702719180ec5aa83dccb5105b8b2244b1390a2759d
3
+ metadata.gz: dd3a2e75d9a25001f206eea0ebf0176e29feeb5f19e5a2452abe2e0727c59eeb
4
+ data.tar.gz: 4f941cdab42013d7b4e494d3b3e694adc10fc30824e76519ad4ed8abe8b88f1f
5
5
  SHA512:
6
- metadata.gz: 8e4a4374a93234a4d122c7bd1ed90de8cfc2943fafc2d96b764e348da4806ea978d7486de9631c075d3661079577c8c1fb1cc219f7cce2002fcd208d458d53c2
7
- data.tar.gz: 3eca657a69cb97b72e18deb94a07f36565267cd1d67ed19345da967bc0261cc10aa3c500d823d17a990c857e95e6dbf6d0306cb89739c4c2115b024a8a7d013f
6
+ metadata.gz: 25dab7f25a4e679c960a759b73eb7a2b701f80dbcf8127ff149dba8f5debf641c29131a8eea77989099385dce51b0eaee1d61ac46b90bb074599eef0b55c33c0
7
+ data.tar.gz: 5f971478ed4937d055c1563a974c8c884f52a1aee228ca8129b100bfa96473f9ee2d7d66d00d069ba6d2d9372fde7138b3fb84b18528ec8cf88c851ae6aa42f2
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  ## Usage
9
9
 
10
- This gem provides you with the following config and secrets:
10
+ This gem provides you with the following config, secrets and helper methods:
11
11
 
12
12
  ```ruby
13
13
  # Config
@@ -27,8 +27,14 @@ Exercism.config.language_server_url
27
27
  # Secrets
28
28
  Exercism.secrets.github_omniauth_app_id
29
29
  Exercism.secrets.github_omniauth_app_secret
30
+ Exercism.secrets.github_webhooks_secret
30
31
  Exercism.secrets.hcaptcha_site_key
31
32
  Exercism.secrets.hcaptcha_secret
33
+
34
+ # Helper methods (create new clients)
35
+ Exercism.dynamodb_client
36
+ Exercism.s3_client
37
+ Exercism.ecr_client
32
38
  ```
33
39
 
34
40
  ## Explaination
@@ -6,7 +6,6 @@ require "exercism-config"
6
6
  return if Exercism.env.production?
7
7
 
8
8
  puts "Create AWS/DynamoDB tables..."
9
-
10
9
  ##################
11
10
  # Setup local s3 #
12
11
  ##################
@@ -18,6 +17,8 @@ unless ENV["EXERCISM_SKIP_S3"]
18
17
  ].each do |bucket|
19
18
  begin
20
19
  Exercism.s3_client.create_bucket(bucket: bucket)
20
+ rescue Aws::S3::Errors::BucketAlreadyExists
21
+ # Bucket already exists
21
22
  rescue Seahorse::Client::NetworkingError => e
22
23
  puts "local S3 not up yet..."
23
24
  sleep 2 # slighty retry delaty
@@ -34,14 +35,14 @@ end
34
35
  Exercism.config.dynamodb_tooling_jobs_table + "-test"
35
36
  ].each do |table_name|
36
37
  begin
37
- Exercism.config.dynamodb_client.delete_table(
38
+ Exercism.dynamodb_client.delete_table(
38
39
  table_name: table_name
39
40
  )
40
41
  rescue Aws::DynamoDB::Errors::ResourceNotFoundException
41
42
  end
42
43
  puts "[x] #{table_name}"
43
44
 
44
- Exercism.config.dynamodb_client.create_table(
45
+ Exercism.dynamodb_client.create_table(
45
46
  table_name: table_name,
46
47
  attribute_definitions: [
47
48
  {
@@ -61,7 +62,7 @@ end
61
62
  }
62
63
  )
63
64
 
64
- Exercism.config.dynamodb_client.update_table(
65
+ Exercism.dynamodb_client.update_table(
65
66
  table_name: table_name,
66
67
  attribute_definitions: [
67
68
  {
@@ -99,7 +100,7 @@ end
99
100
  ]
100
101
  )
101
102
 
102
- Exercism.config.dynamodb_client.update_table(
103
+ Exercism.dynamodb_client.update_table(
103
104
  table_name: table_name,
104
105
  attribute_definitions: [
105
106
  {
@@ -147,14 +148,14 @@ end
147
148
  Exercism.config.dynamodb_tooling_language_groups_table + "-test"
148
149
  ].each do |table_name|
149
150
  begin
150
- Exercism.config.dynamodb_client.delete_table(
151
+ Exercism.dynamodb_client.delete_table(
151
152
  table_name: table_name
152
153
  )
153
154
  rescue Aws::DynamoDB::Errors::ResourceNotFoundException
154
155
  end
155
156
  puts "[x] #{table_name}"
156
157
 
157
- Exercism.config.dynamodb_client.create_table(
158
+ Exercism.dynamodb_client.create_table(
158
159
  table_name: table_name,
159
160
  attribute_definitions: [
160
161
  {
@@ -38,6 +38,6 @@ Gem::Specification.new do |spec|
38
38
  # This isn't a compulsary dependency
39
39
  # but can be used if someone puts it in their
40
40
  # own Gemfile when using this.
41
- spec.add_development_dependency 'aws-sdk-s3'
42
41
  spec.add_development_dependency 'aws-sdk-ecr'
42
+ spec.add_development_dependency 'aws-sdk-s3'
43
43
  end
@@ -3,13 +3,13 @@ module ExercismConfig
3
3
  include Mandate
4
4
 
5
5
  def call
6
- return generate_mock if Exercism.env.test?
6
+ return use_non_production_settings unless Exercism.env.production?
7
7
 
8
8
  retrieve_from_dynamodb
9
9
  end
10
10
 
11
11
  private
12
- def generate_mock
12
+ def use_non_production_settings
13
13
  require 'erb'
14
14
  require 'yaml'
15
15
 
@@ -43,6 +43,5 @@ module ExercismConfig
43
43
  'local'
44
44
  end
45
45
  end
46
-
47
46
  end
48
47
  end
@@ -3,20 +3,20 @@ module ExercismConfig
3
3
  include Mandate
4
4
 
5
5
  def call
6
- return generate_mock if Exercism.env.test?
6
+ return use_non_production_settings unless Exercism.env.production?
7
7
 
8
8
  retrieve_from_aws
9
9
  end
10
10
 
11
11
  private
12
- def generate_mock
12
+ def use_non_production_settings
13
13
  require 'erb'
14
14
  require 'yaml'
15
15
 
16
- settings_file = File.expand_path('../../settings/secrets.yml', __dir__)
17
- settings = YAML.safe_load(ERB.new(File.read(settings_file)).result)
16
+ secrets_file = File.expand_path('../../settings/secrets.yml', __dir__)
17
+ secrets = YAML.safe_load(ERB.new(File.read(secrets_file)).result)
18
18
 
19
- Exercism::Settings.new(settings, {})
19
+ Exercism::Secrets.new(secrets)
20
20
  end
21
21
 
22
22
  def retrieve_from_aws
@@ -1,3 +1,3 @@
1
1
  module ExercismConfig
2
- VERSION = '0.52.0'.freeze
2
+ VERSION = '0.57.0'.freeze
3
3
  end
@@ -1,12 +1,23 @@
1
+ # Anycable
1
2
  anycable_redis_url: redis://127.0.0.1:6379/1
2
3
  anycable_rpc_host: 127.0.0.1:50051
3
- aws_submissions_bucket: exercism-staging-submissions
4
- aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
4
+
5
+ # DynamoDB config
5
6
  dynamodb_tooling_jobs_table: tooling_jobs
6
7
  dynamodb_tooling_language_groups_table: tooling_language_groups
8
+
9
+ # Internal Routes
10
+ language_server_url: ws://127.0.0.1:3023
7
11
  spi_url: http://127.0.0.1:3020
8
12
  tooling_orchestrator_url: http://127.0.0.1:3021
9
- language_server_url: ws://127.0.0.1:3023
10
13
 
14
+ # MySQL
11
15
  mysql_master_endpoint: 127.0.0.1
12
16
  mysql_port: <%= ENV["MYSQL_PORT"] %>
17
+
18
+ # S3 Config
19
+ aws_submissions_bucket: exercism-staging-submissions
20
+ aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
21
+
22
+ # Sidekiq Config
23
+ sidekiq_redis_url: redis://127.0.0.1:6379/2
@@ -1,11 +1,23 @@
1
+ # Anycable
1
2
  anycable_redis_url: redis://redis:6379/1
2
3
  anycable_rpc_host: 0.0.0.0:50051
3
- aws_submissions_bucket: exercism-staging-submissions
4
- aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
4
+
5
+ # DynamoDB config
5
6
  dynamodb_tooling_jobs_table: tooling_jobs
6
7
  dynamodb_tooling_language_groups_table: tooling_language_groups
7
- mysql_master_endpoint: mysql
8
- mysql_port: 3306
8
+
9
+ # Internal Routes
9
10
  spi_url: http://website:3020
10
11
  tooling_orchestrator_url: http://tooling-orchestrator:3021
11
12
  language_server_url: ws://localhost:3023
13
+
14
+ # MySQL
15
+ mysql_master_endpoint: mysql
16
+ mysql_port: 3306
17
+
18
+ # S3 Config
19
+ aws_submissions_bucket: exercism-staging-submissions
20
+ aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
21
+
22
+ # Sidekiq Config
23
+ sidekiq_redis_url: redis://redis:6379/2
@@ -1,11 +1,23 @@
1
+ # Anycable
1
2
  anycable_redis_url: redis://127.0.0.1:6379/1
2
3
  anycable_rpc_host: 127.0.0.1:50051
3
- aws_submissions_bucket: exercism-staging-submissions
4
- aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
4
+
5
+ # DynamoDB config
5
6
  dynamodb_tooling_jobs_table: tooling_jobs
6
7
  dynamodb_tooling_language_groups_table: tooling_language_groups
7
- mysql_master_endpoint: localhost
8
- mysql_socket: /tmp/mysql.sock
8
+
9
+ # Internal Routes
10
+ language_server_url: ws://localhost:3023
9
11
  spi_url: http://localhost:3020
10
12
  tooling_orchestrator_url: http://localhost:3021
11
- language_server_url: ws://localhost:3023
13
+
14
+ # MySQL
15
+ mysql_master_endpoint: localhost
16
+ mysql_socket: /tmp/mysql.sock
17
+
18
+ # S3 Config
19
+ aws_submissions_bucket: exercism-staging-submissions
20
+ aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
21
+
22
+ # Sidekiq Config
23
+ sidekiq_redis_url: redis://127.0.0.1:6379/2
@@ -1,4 +1,5 @@
1
1
  github_omniauth_app_id: "some-github-app-id"
2
2
  github_omniauth_app_secret: "some-github-app-exercism-secret"
3
+ github_webhooks_secret: "some-github-webhooks-secret"
3
4
  hcaptcha_site_key: "some-hcaptcha-site-key"
4
5
  hcaptcha_secret: "some-hcaptcha-secret"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exercism-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.52.0
4
+ version: 0.57.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Walker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-01 00:00:00.000000000 Z
11
+ date: 2020-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-dynamodb
@@ -123,7 +123,7 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '12.3'
125
125
  - !ruby/object:Gem::Dependency
126
- name: aws-sdk-s3
126
+ name: aws-sdk-ecr
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -137,7 +137,7 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: aws-sdk-ecr
140
+ name: aws-sdk-s3
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ">="