From a9cb1968b6a01572a472a3df3aa750ebc022e076 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 31 Jul 2017 17:51:16 -0500 Subject: [PATCH] Setup travis to be able to run CI tests against S3 --- .travis.yml | 2 ++ activestorage/test/service/.gitignore | 1 - .../test/service/configurations-example.yml | 31 ------------------- activestorage/test/service/configurations.yml | 30 ++++++++++++++++++ activestorage/test/test_helper.rb | 2 +- 5 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 activestorage/test/service/.gitignore delete mode 100644 activestorage/test/service/configurations-example.yml create mode 100644 activestorage/test/service/configurations.yml 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 "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" {} -- GitLab