ocean-rails 2.4.1 → 2.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/initializers/aws_config.rb +40 -30
- data/lib/ocean/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d4700f58e4efcefda8d03924a2f00d42767ca1b
|
4
|
+
data.tar.gz: 6e471c7095d2471839111c092ecbd0d1656597e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb3406dd08bc094045841d5bde5bed442c233b0468834ea335c9075ac5fd02e36eec531ec2ca7d9a55428b59f9654e32724df731f68a7349a9c4f497c8694c59
|
7
|
+
data.tar.gz: 0354d7eac1d60908a00ce514aa0dd6c3fe0c9376f046c3252347569dbef6ebb0d2778421e569d889a788fb462daaef7464d33b135fdf232442e58d07393609de
|
@@ -1,35 +1,45 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# Check if the ENV vars are set; if so, don't read any file
|
2
|
+
if (ENV['AWS_ACCESS_KEY_ID'].present? &&
|
3
|
+
ENV['AWS_SECRET_ACCESS_KEY'].present? &&
|
4
|
+
ENV['AWS_REGION'].present?)
|
5
|
+
AWS.config if defined? AWS
|
6
|
+
Aws.config if defined? Aws
|
7
|
+
else
|
3
8
|
|
4
|
-
#
|
5
|
-
|
9
|
+
# The is the example file
|
10
|
+
ef = File.join(Rails.root, "config/aws.yml.example")
|
6
11
|
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
# If the tailored file doesn't exist, and we're running in test mode
|
11
|
-
# (which is the case under TeamCity), use the example file as-is.
|
12
|
-
unless File.exists?(f)
|
13
|
-
f = ENV['OCEAN_API_HOST'] ? ef : false
|
14
|
-
end
|
12
|
+
# Only load AWS data if there is an example file
|
13
|
+
if File.exists?(ef)
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
puts "-----------------------------------------------------------------------"
|
25
|
-
puts "AWS config file missing. Please copy config/aws.yml.example"
|
26
|
-
puts "to config/aws.yml and tailor its contents to suit your dev setup."
|
27
|
-
puts
|
28
|
-
puts "NB: aws.yml is excluded from git version control as it will contain"
|
29
|
-
puts " data private to your Ocean system."
|
30
|
-
puts "-----------------------------------------------------------------------"
|
31
|
-
puts
|
32
|
-
abort
|
33
|
-
end
|
15
|
+
# This is the tailored file, not under source control.
|
16
|
+
f = File.join(Rails.root, "config/aws.yml")
|
17
|
+
|
18
|
+
# If the tailored file doesn't exist, and we're running in test mode
|
19
|
+
# (which is the case under TeamCity), use the example file as-is.
|
20
|
+
unless File.exists?(f)
|
21
|
+
f = ENV['OCEAN_API_HOST'] ? ef : false
|
22
|
+
end
|
34
23
|
|
24
|
+
# If there is a file to process, do so
|
25
|
+
if f
|
26
|
+
options = YAML.load(File.read(f))[Rails.env]
|
27
|
+
AWS.config options if defined? AWS
|
28
|
+
Aws.config = options if defined? Aws
|
29
|
+
else
|
30
|
+
# Otherwise print an error message and abort.
|
31
|
+
puts
|
32
|
+
puts "-----------------------------------------------------------------------"
|
33
|
+
puts "AWS config file missing. Please copy config/aws.yml.example"
|
34
|
+
puts "to config/aws.yml and tailor its contents to suit your dev setup."
|
35
|
+
puts "Alternatively export environment variables AWS_ACCESS_KEY_ID,"
|
36
|
+
puts "AWS_SECRET_ACCESS_KEY, and AWS_REGION."
|
37
|
+
puts
|
38
|
+
puts "NB: aws.yml is excluded from git version control as it will contain"
|
39
|
+
puts " data private to your Ocean system."
|
40
|
+
puts "-----------------------------------------------------------------------"
|
41
|
+
puts
|
42
|
+
abort
|
43
|
+
end
|
44
|
+
end
|
35
45
|
end
|
data/lib/ocean/version.rb
CHANGED