Skip to content

Commit

Permalink
Add a no-download option for CF deploy (#46)
Browse files Browse the repository at this point in the history
Co-authored-by: Conder, Cody W <CODY_W_CONDER@homedepot.com>
  • Loading branch information
eldirinice and Conder, Cody W committed Mar 10, 2020
1 parent 57a6dd8 commit 1b4f13d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -236,6 +236,8 @@ deploy - push application to Pivotal Cloud Foundry

-metrics MANIFEST, --manifest MANIFEST (optional) Custom manifest name if you choose not to follow standard pattern of{environment}.manifest.yml

--no-download (optional) Skips downloading and extraction of artifact. Useful if the artifact was downloaded and extracted previously.

**Environment Variables:**

GITHUB_TOKEN (Required) for access to your project API _NOTE: Requires repo access only._
Expand Down
21 changes: 12 additions & 9 deletions flow/aggregator.py
Expand Up @@ -199,18 +199,18 @@ def main():
commons.print_msg(clazz, method, 'No custom deploy script passed in. Cloud Foundry detected in '
'buildConfig. Calling standard CloudFoundry deployment.')

# TODO make this configurable in case they are using
create_deployment_directory()
if not args.no_download:
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 + '/')

force = False

Expand Down Expand Up @@ -360,6 +360,9 @@ def load_task_parsers(subparsers):
'deploy script here.')
cfdeploy_parser.add_argument('-metrics', '--manifest', help='(optional) Custom manifest name if you choose not to '
' follow standard pattern of{environment}.manifest.yml')
cfdeploy_parser.add_argument('--no-download', help='(optional) Skips downloading and extraction of artifact.'
'Useful if the artifact was downloaded previously.',
action='store_true')

zipship_parser = subparsers.add_parser('zipit', help='Support for zipping directory contents and shipping it '
'somewhere', formatter_class=RawTextHelpFormatter)
Expand Down

0 comments on commit 1b4f13d

Please sign in to comment.