Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spilist
Copy link
Contributor

@spilist spilist commented Dec 5, 2018

Closes #152.

Summary

This PR makes the installer checks each file if it is a symlink of a directory, and generates 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 itself 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.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 92.149% when pulling 0f4e34b on what-is-quality:fix-directory-symlink into 9dcc4d9 on aws:master.

@yacinehmito
Copy link

Thanks for solving this issue! This affects us at @Spendesk and we currently need to resort to recreating the symlinks manually in an AfterInstall hooks.

Is there something that's preventing the fix from being merged?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants