exercism_config 0.17.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +0 -5
- data/bin/setup +1 -1
- data/bin/setup_exercism_config +84 -0
- data/exercism_config.gemspec +2 -2
- data/lib/exercism_config/version.rb +1 -1
- metadata +5 -4
- data/bin/run +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 555be062390d82c5998c347d504b0e158388bdc4cd6be78b696b05d6e64a4583
|
4
|
+
data.tar.gz: 4379e460085f1a7024ebf93a96380ec7bcd68392c7117cf9c3e13d7cac527944
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd335e5943218e1316c45c598d45940f4da31f193d30d6f2b7c271081553d770ecc886f59ebd6ab27be5a04088e84ea5d450adb2c3a7b2190e404c508d709968
|
7
|
+
data.tar.gz: e80961c8c6ff6a55f3eb272027611e6b575c5c365fb81b7f8a901694997dfb4628b8ec7d96943621bf6cae9063e8cf496274a5eef1e21cfae513e680d258e78f
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/bin/setup
CHANGED
@@ -0,0 +1,84 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "exercism_config"
|
5
|
+
require 'yaml'
|
6
|
+
|
7
|
+
env = ExercismConfig::DetermineEnvironment.()
|
8
|
+
if env == :production
|
9
|
+
puts "Aborted! This script should not be run in production."
|
10
|
+
exit
|
11
|
+
end
|
12
|
+
|
13
|
+
def create_table(client)
|
14
|
+
client.create_table(
|
15
|
+
table_name: :config,
|
16
|
+
attribute_definitions: [
|
17
|
+
{
|
18
|
+
attribute_name: "id",
|
19
|
+
attribute_type: "S",
|
20
|
+
},
|
21
|
+
],
|
22
|
+
key_schema: [
|
23
|
+
{
|
24
|
+
attribute_name: "id",
|
25
|
+
key_type: "HASH",
|
26
|
+
}
|
27
|
+
],
|
28
|
+
provisioned_throughput: {
|
29
|
+
read_capacity_units: 1,
|
30
|
+
write_capacity_units: 1,
|
31
|
+
}
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
def delete_table(client)
|
36
|
+
client.delete_table(
|
37
|
+
table_name: :config,
|
38
|
+
)
|
39
|
+
end
|
40
|
+
|
41
|
+
def set_config_value(client, id, value)
|
42
|
+
client.put_item(
|
43
|
+
table_name: :config,
|
44
|
+
item: {
|
45
|
+
id: id,
|
46
|
+
value: value
|
47
|
+
}
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
client = ExercismConfig::SetupDynamoDBClient.()
|
52
|
+
|
53
|
+
begin
|
54
|
+
create_table(client)
|
55
|
+
rescue Aws::DynamoDB::Errors::ResourceInUseException => e
|
56
|
+
if ARGV.include?("--force")
|
57
|
+
puts "Table exists. Recreating..."
|
58
|
+
delete_table(client)
|
59
|
+
create_table(client)
|
60
|
+
puts "Table recreated."
|
61
|
+
else
|
62
|
+
puts "Table exists. Not recreating."
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
settings_file_arg = ARGV.select{|arg|arg.start_with?("--settings-file=")}.first
|
67
|
+
if settings_file_arg
|
68
|
+
settings_file = settings_file_arg.split("=").last
|
69
|
+
settings = YAML.load(File.read(settings_file))
|
70
|
+
else
|
71
|
+
settings = {
|
72
|
+
aws_iterations_bucket: "exercism-staging-iterations",
|
73
|
+
dynamodb_tooling_jobs_table: "tooling_jobs",
|
74
|
+
tooling_orchestrator_url: "http://127.0.0.1:3021",
|
75
|
+
anycable_redis_url: 'redis://127.0.0.1:6379/1',
|
76
|
+
anycable_rpc_host: '127.0.0.1:50051',
|
77
|
+
rds_master_endpoint: "localhost",
|
78
|
+
mysql_socket: "/tmp/mysql.sock"
|
79
|
+
}
|
80
|
+
end
|
81
|
+
|
82
|
+
settings.each do |key, value|
|
83
|
+
set_config_value(client, key, value)
|
84
|
+
end
|
data/exercism_config.gemspec
CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
19
19
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
20
|
end
|
21
|
-
spec.bindir = "
|
22
|
-
spec.executables =
|
21
|
+
spec.bindir = "bin"
|
22
|
+
spec.executables = ["setup_exercism_config"]
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
25
|
spec.add_dependency "aws-sdk-dynamodb", "~> 1.0"
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exercism_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Walker
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2020-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
@@ -111,7 +111,8 @@ dependencies:
|
|
111
111
|
description:
|
112
112
|
email:
|
113
113
|
- jez.walker@gmail.com
|
114
|
-
executables:
|
114
|
+
executables:
|
115
|
+
- setup_exercism_config
|
115
116
|
extensions: []
|
116
117
|
extra_rdoc_files: []
|
117
118
|
files:
|
@@ -122,8 +123,8 @@ files:
|
|
122
123
|
- README.md
|
123
124
|
- Rakefile
|
124
125
|
- bin/console
|
125
|
-
- bin/run
|
126
126
|
- bin/setup
|
127
|
+
- bin/setup_exercism_config
|
127
128
|
- exercism_config.gemspec
|
128
129
|
- lib/exercism/config.rb
|
129
130
|
- lib/exercism_config.rb
|