Skip to content
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

Generate a normal copy when installing a symlink of a directory #4

Closed
wants to merge 1 commit into from

Conversation

spilist
Copy link

@spilist spilist commented Nov 21, 2018

Closes #3 and closes aws#152.

Summary

This PR makes the installer checks each file if it is a symlink of a directory, and generate normal_copy instead of directory_copy.

Description of changes:

When the installer(lib/instance_agent/plugins/codedeploy/installer.rb) runs, it generates instructions for copying source files to the deploy destination. The installer recursively generates mkdir for directory files and copy instructions for regular files.

The problem occurs when a src file is a symlink of a directory. Although the symlink IS a regular file, File.directory?(dir_symlink) still returns true. Since Dir.entries(dir_symlink) also works as if it is a normal directory, children files of the symlink are copied instead of the symlink itself.

This PR adds a symlink check as well as a directory check when generating instructions.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@spilist spilist self-assigned this Nov 21, 2018
@spilist spilist force-pushed the fix-directory-symlink branch 2 times, most recently from 0803ca1 to 5854945 Compare December 3, 2018 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

배포과정에서 심볼릭 링크가 보존되지 않는 이슈 Sym Links not preserved during deployment
1 participant