question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.ebignore includes symlinked files in ignored directories

See original GitHub issue

Description

Having specified .ebignore to ignore a whole directory, if that directory contains a symlink, that symlink is not ignored and included in the source bundle that eb cli creates.

Steps to reproduce

With an eb application and environment set up - where the project contains a directory called ignore and, within that, one standard directory dir and one symlinked directory symlink; and the project’s .ebignore file contains an entry to ignore that whole directory from the created artifact - run eb deploy env-name.

.ebignore file:

/bin/ignore/

Observed result

The artifact created and uploaded to S3 will contain symlinked directory ignore/symlink, but not ignore/dir.

Structure of example project eb-bug:

image

Actual (partial) output from eb deploy env-name --debug shows no entry at all for ./bin/ignore/symlink:

...
2021-03-21 08:28:27,522 (INFO) eb : Found .ebignore, using system zip.
2021-03-21 08:28:27,522 (DEBUG) ebcli.core.fileoperations : Project root found at: /path/2/eb-bug
2021-03-21 08:28:27,522 (INFO) eb : Zipping up folder at location: /path/2/eb-bug
2021-03-21 08:28:27,523 (INFO) eb :  +adding: .//
2021-03-21 08:28:27,523 (INFO) eb :   +adding: ./.envrc
2021-03-21 08:28:27,524 (INFO) eb :   +adding: ./Issue.md
2021-03-21 08:28:27,524 (INFO) eb :   +adding: ./.gitignore
2021-03-21 08:28:27,524 (INFO) eb :   -skipping: ./.ebignore
2021-03-21 08:28:27,524 (INFO) eb :  +adding: ./bin/
2021-03-21 08:28:27,525 (INFO) eb :   +adding: ./bin/cli
2021-03-21 08:28:27,525 (INFO) eb :   -skipping: ./bin/ignore/dir/file
2021-03-21 08:28:27,525 (INFO) eb :   -skipping: ./.elasticbeanstalk
2021-03-21 08:28:27,525 (INFO) eb :   -skipping: ./.elasticbeanstalk/app_versions
2021-03-21 08:28:27,525 (INFO) eb :  +adding: ./.git/
...

Expected result

The artifact created and uploaded to S3 should not contain directory ignore.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: macos 11.2.3
  2. EBCLI version: EB CLI 3.19.3 (Python 3.9.2)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:14

github_iconTop GitHub Comments

6reactions
Palakpatel67commented, Mar 22, 2021

@tomchkk thanks for reporting this issue. We will look into it and post any updates here.

3reactions
vince1995commented, Sep 13, 2021

I’ve opened a PR with the fix for that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I make Git ignore symlink? - Stack Overflow
Git considers symlinks to be files, not directories. You need to remove the / at the end of each .gitignore line:
Read more >
AWS Elastic Beanstalk deploys ".venv" directory even ... - Reddit
ebignore file is set to ignore the .venv directory, it's still deployed to Elastic Beanstalk. My .ebignore file reads as follows: migrations ...
Read more >
Configure the EB CLI - AWS Elastic Beanstalk
You can tell the EB CLI to ignore certain files in your project directory by adding the file .ebignore to the directory. This...
Read more >
gitignore Documentation - Git
gitignore - Specifies intentionally untracked files to ignore ... It is not possible to re-include a file if a parent directory of that...
Read more >
gitignore - Specifies intentionally untracked files to ignore
Patterns read from a .gitignore file in the same directory as the path, ... A project normally includes such .gitignore files in its...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found