Skip to content

Commit

Permalink
Fix GCP AppEngine promotion (#37)
Browse files Browse the repository at this point in the history
* Remove some checks for argument existence

* Remove unsupported 'script' flag

* Fix --promote flag's equivalence check

* Update unit test script locations
  • Loading branch information
GavinFigueroa authored and billimek committed Feb 8, 2019
1 parent fdd47b1 commit d2a6d72
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ Please ensure that we don't tightly couple our classes together. Flow is meant
## Running Unit Tests on a Mac/Linux
* In an effort to make things simple, take a look at the `./unittest.sh` script. You should just be able to run this and it will setup everything. This can only be run after all of the Environment Setup is complete.
* In an effort to make things simple, take a look at the `scripts/unittest.sh` script. You should just be able to run this and it will setup everything. This can only be run after all of the Environment Setup is complete.
## Continuous Unit Testing on a Mac/Linux
* Run the `./unittest_continous.sh` script which just runs the `./unittest.sh` in a while loop for ever. ctrl-c to quit.
* Run the `scripts/unittest_continous.sh` script which just runs the `scripts/unittest.sh` in a while loop for ever. ctrl-c to quit.
* To continuously run tests while making code changes use the `pytest-watch` or if you don't feel like typing all of that then `ptw` will suffice
Expand Down
43 changes: 19 additions & 24 deletions flow/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def main():

is_script_run_successful = True

if 'script' in args and args.script is not None:
if args.script is not None:
commons.print_msg(clazz, method, 'Custom deploy script detected')
cf.download_cf_cli()
cf.download_custom_deployment_script(args.script)
Expand All @@ -214,12 +214,12 @@ def main():

force = False

if 'force' in args and args.force is not None and args.force.strip().lower() != 'false':
if args.force is not None and args.force.strip().lower() != 'false':
force = True

manifest = None

if 'manifest' in args and args.manifest is not None:
if args.manifest is not None:
commons.print_msg(clazz, method, "Setting manifest to {}".format(args.manifest))
manifest = args.manifest

Expand All @@ -241,33 +241,28 @@ def main():

is_script_run_successful = True

if 'script' in args and args.script is not None:
commons.print_msg(clazz, method, 'Custom deploy detected')
app_engine.download_custom_deployment_script(args.script)
is_script_run_successful = app_engine.run_deployment_script(args.script)
else:
commons.print_msg(clazz, method, 'No custom deploy script passed in. Calling standard AppEngine deployment.')

create_deployment_directory()
create_deployment_directory()

if BuildConfig.artifact_extension is None and BuildConfig.artifact_extensions is None:
commons.print_msg(clazz, method, 'Attempting to retrieve and deploy from GitHub.')
if BuildConfig.artifact_extension is None and BuildConfig.artifact_extensions is None:
commons.print_msg(clazz, method, 'Attempting to retrieve and deploy from GitHub.')

github.download_code_at_version()
else:
commons.print_msg(clazz, method, 'Attempting to retrieve and deploy from Artifactory.')
artifactory = Artifactory()
github.download_code_at_version()
else:
commons.print_msg(clazz, method, 'Attempting to retrieve and deploy from Artifactory.')
artifactory = Artifactory()

artifactory.download_and_extract_artifacts_locally(BuildConfig.push_location + '/')
artifactory.download_and_extract_artifacts_locally(BuildConfig.push_location + '/')

app_yaml = None
app_yaml = None

if 'app_yaml' in args and args.app_yaml is not None:
commons.print_msg(clazz, method, "Setting app yaml to {}".format(args.app_yaml))
app_yaml = args.app_yaml
if args.app_yaml is not None:
commons.print_msg(clazz, method, "Setting app yaml to {}".format(args.app_yaml))
app_yaml = args.app_yaml

if 'promote' in args and args.promote is not 'true':
app_engine.deploy(app_yaml=app_yaml, promote=False)
if args.promote is not None and args.promote.lower() != 'true':
app_engine.deploy(app_yaml=app_yaml, promote=False)
else:
app_engine.deploy(app_yaml=app_yaml)

# noinspection PyPep8Naming
SIGNAL = 'publish-deploy-complete'
Expand Down

0 comments on commit d2a6d72

Please sign in to comment.