-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CopyFile: support assets, archives, and recursive copying #423
Conversation
1d6106b
to
96cfa51
Compare
ee19349
to
c8c200f
Compare
a919ac1
to
33e531d
Compare
33e531d
to
0b11dc3
Compare
72c9b7b
to
4da0d5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good to me.
e156726
to
9fcee8b
Compare
@@ -469,22 +469,22 @@ | |||
"connection" | |||
] | |||
}, | |||
"command:remote:CopyFile": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include an alias for this rename? Probably not too significant because this resource doesn't really use state in any meaningful way, but might be nicer to avoid a delete/create on the next deploy after upgrading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to do some testing around this. It's not only the name of the resource that changes, the main input property for the source of the copy changes as well. I think a replace might be unavoidable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you'll be okay as that property doesn't cause replacements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another idea was to keep the CopyFile resource as-is, alongside the new Copy resource, with a deprecation warning, until v2 of the provider.
4228300
to
d96ea8f
Compare
Co-authored-by: Ian Wahbe <[email protected]>
e6e58a4
to
e4a848f
Compare
e4a848f
to
2d9ce57
Compare
This PR allows the CopyFile resource to recursively copy directories as well, similar to
scp -r
.This PR enhances the CopyFile resource in a few ways.
In light of these changes, I've renamed
CopyFile
to justCopy
which is a breaking change.Resolves #23
Resolves #33
Resolves #42
TODO
The current implementation fails as soon as a file or directory already exists on the remote, like the previousCopyFile
.CopyFile
toCopy
orRemoteCopy
or insert your proposal here?TestEc2RemoteTs
, which we should share instead. What would be a good way to do that, given the code is in the TS tests, not in the Go driver?Design considerations
The behavior of the copy operation was modeled after
cp
andscp
.Specifically:
Implementation notes
size.ts
file in both steps of the integration test is useless because it always has the same value. However, I found that without a TS file present in the additional step, it would not be run. Haven't debugged further.