Skip to content

Commit

Permalink
webapp: az webapp up detects the 'env' folder for python & removes th…
Browse files Browse the repository at this point in the history
…is from the zip folder used for deployment (#10172)

* Adding logic to detect env if python & remove it from zip deployment

style fixes & adding .azure & .git to ignore path for zip

Modifying such that env directory is not deleted but simply removed from the zip

* Rebasign to the latest released CLI & updating history
  • Loading branch information
panchagnula authored Aug 19, 2019
1 parent 1639f71 commit 8381add
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/azure-cli/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

**AppService**

* az webapp up detects env folder and removes it from compressed file used for deployment

**keyvault**

* Fix the bug in secret set command that igores the expires argument
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ def zip_contents_from_dir(dirPath, lang):
with zipfile.ZipFile("{}".format(zip_file_path), "w", zipfile.ZIP_DEFLATED) as zf:
for dirname, subdirs, files in os.walk(dirPath):
# skip node_modules folder for Node apps,
# since zip_deployment will perfom the build operation
if lang.lower() == NODE_RUNTIME_NAME and 'node_modules' in subdirs:
subdirs.remove('node_modules')
# since zip_deployment will perform the build operation
if lang.lower() == NODE_RUNTIME_NAME:
subdirs[:] = [d for d in subdirs if 'node_modules' not in d]
elif lang.lower() == NETCORE_RUNTIME_NAME:
if 'bin' in subdirs:
subdirs.remove('bin')
elif 'obj' in subdirs:
subdirs.remove('obj')
subdirs[:] = [d for d in subdirs if d not in ['obj', 'bin']]
elif lang.lower() == PYTHON_RUNTIME_NAME:
subdirs[:] = [d for d in subdirs if 'env' not in d] # Ignores dir that contain env
for filename in files:
absname = os.path.abspath(os.path.join(dirname, filename))
arcname = absname[len(abs_src) + 1:]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ def load_arguments(self, _):

with self.argument_context('webapp up') as c:
c.argument('name', arg_type=webapp_name_arg_type)
c.argument('resource_group_name', arg_type=resource_group_name_type)
c.argument('plan', options_list=['--plan', '-p'], configured_default='appserviceplan',
completer=get_resource_name_completion_list('Microsoft.Web/serverFarms'),
help="name of the appserviceplan associated with the webapp")
Expand Down

0 comments on commit 8381add

Please sign in to comment.