aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2017-07-31 17:51:16 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2017-07-31 17:51:16 -0500
commita9cb1968b6a01572a472a3df3aa750ebc022e076 (patch)
tree67041c959cbc65b99995c453f845ee96fc61f311
parentba12811db22de23e935b43f39cac8da523fa0ded (diff)
downloadrails-a9cb1968b6a01572a472a3df3aa750ebc022e076.tar.gz
rails-a9cb1968b6a01572a472a3df3aa750ebc022e076.tar.bz2
rails-a9cb1968b6a01572a472a3df3aa750ebc022e076.zip
Setup travis to be able to run CI tests against S3
-rw-r--r--.travis.yml2
-rw-r--r--activestorage/test/service/.gitignore1
-rw-r--r--activestorage/test/service/configurations-example.yml31
-rw-r--r--activestorage/test/service/configurations.yml30
-rw-r--r--activestorage/test/test_helper.rb2
5 files changed, 33 insertions, 33 deletions
diff --git a/.travis.yml b/.travis.yml
index 91ac7e8e5e..d1b384720a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -40,6 +40,8 @@ script: 'ci/travis.rb'
env:
global:
- "JRUBY_OPTS='--dev -J-Xmx1024M'"
+ - "AWS_ACCESS_KEY_ID=AKIAIDIA2E7SSMYGNB7A"
+ - secure: "XohvFnYff1yf8qlawCujI+CIqHK08KOw34pPprd4QYuG0SJCzBdNN7efBBj5gLX1PI6DwkDLNv51Oi31xPh7yJFuzRAkB0FPdyKM7UyYZ7BMaTqx8LVC89lZJ8VIu19kDP/8sdOm0HN/huOM5kO3jZJFLpi2Tj313TjmzWZFPq0="
matrix:
- "GEM=railties"
- "GEM=ap,ac"
diff --git a/activestorage/test/service/.gitignore b/activestorage/test/service/.gitignore
deleted file mode 100644
index c102131f3d..0000000000
--- a/activestorage/test/service/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-configurations.yml
diff --git a/activestorage/test/service/configurations-example.yml b/activestorage/test/service/configurations-example.yml
deleted file mode 100644
index 68f6ae4224..0000000000
--- a/activestorage/test/service/configurations-example.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copy this file to configurations.yml and edit the credentials to match your IAM test account and bucket
-s3:
- service: S3
- access_key_id:
- secret_access_key:
- region:
- bucket:
-
-gcs:
- service: GCS
- keyfile: {
- type: "service_account",
- project_id: "",
- private_key_id: "",
- private_key: "",
- client_email: "",
- client_id: "",
- auth_uri: "https://accounts.google.com/o/oauth2/auth",
- token_uri: "https://accounts.google.com/o/oauth2/token",
- auth_provider_x509_cert_url: "https://www.googleapis.com/oauth2/v1/certs",
- client_x509_cert_url: ""
- }
- project:
- bucket:
-
-azure:
- service: Azure
- path: ""
- storage_account_name: ""
- storage_access_key: ""
- container: ""
diff --git a/activestorage/test/service/configurations.yml b/activestorage/test/service/configurations.yml
new file mode 100644
index 0000000000..90b6baf0db
--- /dev/null
+++ b/activestorage/test/service/configurations.yml
@@ -0,0 +1,30 @@
+s3:
+ service: S3
+ access_key_id: <%= ENV["AWS_ACCESS_KEY_ID"] %>
+ secret_access_key: <%= ENV["AWS_SECRET_KEY"] %>
+ region: us-east-2
+ bucket: rails-ci-activestorage
+
+# gcs:
+# service: GCS
+# keyfile: {
+# type: "service_account",
+# project_id: "",
+# private_key_id: "",
+# private_key: "",
+# client_email: "",
+# client_id: "",
+# auth_uri: "https://accounts.google.com/o/oauth2/auth",
+# token_uri: "https://accounts.google.com/o/oauth2/token",
+# auth_provider_x509_cert_url: "https://www.googleapis.com/oauth2/v1/certs",
+# client_x509_cert_url: ""
+# }
+# project:
+# bucket:
+#
+# azure:
+# service: Azure
+# path: ""
+# storage_account_name: ""
+# storage_access_key: ""
+# container: ""
diff --git a/activestorage/test/test_helper.rb b/activestorage/test/test_helper.rb
index 9922c8685c..7826c1aeba 100644
--- a/activestorage/test/test_helper.rb
+++ b/activestorage/test/test_helper.rb
@@ -14,7 +14,7 @@ require "active_storage"
require "yaml"
SERVICE_CONFIGURATIONS = begin
- YAML.load_file(File.expand_path("../service/configurations.yml", __FILE__)).deep_symbolize_keys
+ YAML.load(ERB.new(Pathname.new(File.expand_path("../service/configurations.yml", __FILE__)).read).result).deep_symbolize_keys
rescue Errno::ENOENT
puts "Missing service configuration file in test/service/configurations.yml"
{}