Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Configure S3 endpoint from env variable #93

Merged
merged 2 commits into from Mar 28, 2019
Merged

Conversation

michaeldwan
Copy link
Contributor

This PR lets you publish to any S3 compatible host (eg DigitalOcean Spaces) using AWS_S3_ENDPOINT. Existing behavior remains the same if unset.

@salesforce-cla
Copy link

Thanks for the contribution! Before we can merge this, we need @michaeldwan to sign the Salesforce.com Contributor License Agreement.

@codecov
Copy link

codecov bot commented Mar 27, 2019

Codecov Report

Merging #93 into master will increase coverage by 0.75%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #93      +/-   ##
==========================================
+ Coverage    35.4%   36.16%   +0.75%     
==========================================
  Files          19       18       -1     
  Lines         692      636      -56     
  Branches      120      113       -7     
==========================================
- Hits          245      230      -15     
+ Misses        418      377      -41     
  Partials       29       29
Impacted Files Coverage Δ
src/aws.ts 19.51% <0%> (ø) ⬆️
src/log.ts 66.66% <0%> (-8.34%) ⬇️
src/tarballs/node.ts 6.66% <0%> (-4.66%) ⬇️
src/tarballs/index.ts
src/tarballs/bin.ts 33.33% <0%> (+6.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4016728...9b13885. Read the comment docs.

return cache.s3 = cache.s3 || new (require('aws-sdk/clients/s3') as typeof S3)(this.creds)
return cache.s3 = cache.s3 || new (require('aws-sdk/clients/s3') as typeof S3)({
...this.creds,
endpoint: process.env.AWS_S3_ENDPOINT,
Copy link
Contributor

@jdx jdx Mar 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't this just go on line 26?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally yeah, but this.creds is also passed to the CloudFront constructor on line 43 and CloudFront also accepts an endpoint option that we wouldn't want to set.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, that makes sense

@jdx jdx merged commit 2ce9b39 into oclif:master Mar 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants