Skip to content

Commit

Permalink
Fixes#69: Add url after create in json, also changing to return json …
Browse files Browse the repository at this point in the history
…object instead of string

Fixes#95: Updating the default version of Node

Fixes:Azure#75:Remove generated zip file after the creating and deploying the app

Updating index.json
  • Loading branch information
panchagnula committed Mar 7, 2018
1 parent 3487da2 commit 4e37afa
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@
],
"webapp": [
{
"filename": "webapp-0.1.1-py2.py3-none-any.whl",
"sha256Digest": "65b976e57f766b0b8dcb31e13903f7a05515a80dcafcb03a6b5dce64bc8a5594",
"downloadUrl": "https://github.com/panchagnula/azure-cli-extensions/raw/sisirap-extensions-whl/dist/webapp-0.1.1-py2.py3-none-any.whl",
"filename": "webapp-0.1.2-py2.py3-none-any.whl",
"sha256Digest": "6fb8a59aa38dff6b0d3a878742290cacac0eb0e50dc0fae2e6fbf7bd5c38f37b",
"downloadUrl": "https://github.com/panchagnula/azure-cli-extensions/raw/sisirap-extensions-whl/dist/webapp-0.1.2-py2.py3-none-any.whl",
"metadata": {
"classifiers": [
"Development Status :: 4 - Beta",
Expand Down Expand Up @@ -409,7 +409,7 @@
"metadata_version": "2.0",
"name": "webapp",
"summary": "An Azure CLI Extension to manage appservice resources",
"version": "0.1.1"
"version": "0.1.2"
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion src/webapp/azext_webapp/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

NODE_VERSION_DEFAULT = "8.1"
NODE_VERSION_DEFAULT = "8.9"
NETCORE_VERSION_DEFAULT = "2.0"
# TODO: Remove this once we have the api returning the versions
NODE_VERSIONS = ['4.4', '4.5', '6.2', '6.6', '6.9', '6.11', '8.0', '8.1']
Expand Down
21 changes: 14 additions & 7 deletions src/webapp/azext_webapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,12 @@ def create_deploy_webapp(cmd, name, location=None, dryrun=False):
}
""" % (name, asp, rg_str, full_sku, os_val, location, src_path,
detected_version, runtime_version)
create_json = json.loads(dry_run_str)

create_json = json.dumps(json.loads(dry_run_str), indent=4, sort_keys=True)
if dryrun:
logger.warning("Web app will be created with the below configuration,re-run command "
"without the --dryrun flag to create & deploy a new app")
logger.warning(create_json)
return None
return create_json

# create RG if the RG doesn't already exist
if not check_resource_group_exists(cmd, rg_name):
Expand All @@ -139,7 +138,10 @@ def create_deploy_webapp(cmd, name, location=None, dryrun=False):
# create the app
if not check_app_exists(cmd, rg_name, name):
logger.warning("Creating app '%s' ....", name)
create_webapp(cmd, rg_name, name, asp, runtime_version if is_linux else None)
app_created = create_webapp(cmd, rg_name, name, asp, runtime_version if is_linux else None)
# update create_json to include the app_url
url = app_created.enabled_host_names[0] # picks the custom domain URL incase a domain is assigned
url = 'https://' + url
logger.warning("Webapp creation complete")
else:
logger.warning("App '%s' already exists", name)
Expand All @@ -166,8 +168,13 @@ def create_deploy_webapp(cmd, name, location=None, dryrun=False):
logger.warning("Deploying and building contents to app."
"This operation can take some time to finish...")
enable_zip_deploy(cmd, rg_name, name, zip_file_path)
# Remove the file afer deployment, handling exception if user removed the file manually
try:
os.remove(zip_file_path)
except OSError:
pass
else:
logger.warning("No 'NODE' or 'DOTNETCORE' package detected, skipping zip and deploy process")

logger.warning("All done. %s", create_json)
return None
create_json.update({'app_url': url})
logger.warning("All done.")
return create_json
2 changes: 1 addition & 1 deletion src/webapp/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from codecs import open
from setuptools import setup, find_packages

VERSION = "0.1.1"
VERSION = "0.1.2"

CLASSIFIERS = [
'Development Status :: 4 - Beta',
Expand Down

0 comments on commit 4e37afa

Please sign in to comment.