피가로를 사용하여 Travis와 AWS S3를 함께 사용하려고 할 때 완전히 혼란스러워졌습니다.Rails - Travis CI가 S3 자격 증명을 얻을 수 없습니다.
이 모두 dev에 모드에서 잘 작동 :
picture.rb
class Picture < ApplicationRecord
acts_as_list
belongs_to :imageable, polymorphic: true
has_attached_file :image,
:storage => :s3,
:bucket => Figaro.env.s3_bucket,
:s3_region => 'eu-west-1',
:s3_credentials => {
:access_key_id => Figaro.env.aws_access_key_id,
:secret_access_key => Figaro.env.aws_secret_access_key
}
do_not_validate_attachment_file_type :image
end
application.yml
aws_access_key_id: 'xxx'
aws_secret_access_key: 'xxx'
aws_region: 'eu-west-1'
development:
s3_bucket: 'company-name-dev'
production:
s3_bucket: 'company-name-prod'
분명히 트래비스이 키에 액세스 할 필요가 :
을 .travis .yml 내가 AWS 누락 된 자격 증명 오류 또는 트래비스의 피가로 MissingKeys 오류를 받고 계속
language: ruby
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
rvm:
- 2.4.0
bundler_args: "--jobs=2"
script:
- bundle exec rake db:setup
- bundle exec rake spec
cache: bundler
services:
- postgresql
addons:
postgresql: '9.4'
deploy:
provider: heroku
api_key:
secure: verlongherokukey
app: imkerij
on:
repo: MyGitHub/MyRepoName
skip_cleanup: true
env:
matrix:
- s3_bucket='company-name-dev'
global:
- secure: verylongkey
- secure: anotherverylongkey
.
Figaro.require_keys("aws_access_key_id", "aws_secret_access_key")
을 내가 AWS 자격 증명, 모든 시간을 없거나 뭔가있어 그 전에 : 만 추가 한 후 BTW 무슨 일이 있었
Figaro::MissingKeys: Missing required configuration keys: ["aws_access_key_id", "aws_secret_access_key"]
.
키가 통과하지 않는 것 같습니다. ENV 양식을 쓸 때도 사용하지 마십시오. 그렇다면 개발 단계에서도 더 이상 작동하지 않습니다.
도움이 되었습니까? 날 동안 붙어있어. 또 다른 해결책은 비밀을 사용하는 것입니다.