Skip to content

Commit

Permalink
[ACR] Ignore files in vcs (eg, .git) direcotry (Azure#7087)
Browse files Browse the repository at this point in the history
  • Loading branch information
inorthtyphoon authored and troydai committed Aug 20, 2018
1 parent c39f733 commit 4038a5e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/command_modules/azure-cli-acr/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

2.1.4
+++++
* Exclude version control files (eg, .git, .gitignore) from uploaded tar by default in build command.

2.1.3
+++++
* Add content-trust policy commands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,13 @@ def _pack_source_code(source_location, tar_file_path, docker_file_path):
def _ignore_check(tarinfo, parent_ignored, parent_matching_rule_index):
# ignore common vcs dir or file
if tarinfo.name in common_vcs_ignore_list:
logger.debug(".dockerignore: ignore vcs file '%s'", tarinfo.name)
logger.warning("Excluding '%s' based on default ignore rules", tarinfo.name)
return True, parent_matching_rule_index

if ignore_list is None:
return False, parent_matching_rule_index
# if .dockerignore doesn't exists, inherit from parent
# eg, it will ignore the files under .git folder.
return parent_ignored, parent_matching_rule_index

# always include docker file
# file path comparision is case-sensitive
Expand Down
2 changes: 1 addition & 1 deletion src/command_modules/azure-cli-acr/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass = {}

VERSION = "2.1.3"
VERSION = "2.1.4"
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
Expand Down

0 comments on commit 4038a5e

Please sign in to comment.