laurilehmijoki / s3_website

Manage an S3 website: sync, deliver via CloudFront, benefit from advanced S3 website features.
Other
2.24k stars 186 forks source link

.env not being picked up #139

Closed dominiclovell closed 9 years ago

dominiclovell commented 9 years ago

I have created a .env in the root directory.

The structure of the file:

AWS_ACCESS_KEY_ID=MY_ACCESS_KEY
AWS_SECRET_ACCESS_KEY=MY_SECRET
S3_BUCKET_NAME=my_bucket_name

However, when I try to push I continually receive the following error:

$ s3_website push --dry-run
[info] Simulating the deployment of /Users/Dom/my_site/_site/* to my_bucket
[fail] Failed to fetch an object listing (The AWS Access Key Id you provided does not exist in our records. (Service: Amazon S3; Status Code: 403; Error Code: InvalidAccessKeyId; Request ID: B4F271DAF53A88C9))
[info] Summary: 2 operations failed.
[fail] Failed to push the website to http://my_bucket.s3-website-us-east-1.amazonaws.com

Note, I have removed the real values from the output above.

If I hardcode the real values in the s3_website.yml everything works fine.

laurilehmijoki commented 9 years ago

Hi @dominiclovell

Do you use the environmental values in your _s3website.yml file?

When I have the following lines in the config file, the .env file works fine for me:

s3_id: <%= ENV['my_aws_key'] %>
s3_secret: <%= ENV['my_aws_secret'] %>
laurilehmijoki commented 9 years ago

Closing the issue, since it has been inactive for a long period of time. Please re-open if needed.