From 1b1d8fcdcd1bbe3a6787011b29530a2c2b101914 Mon Sep 17 00:00:00 2001 From: James Saryerwinnie Date: Wed, 5 Apr 2017 05:41:43 +1000 Subject: [PATCH] Add documentation for generate-pipeline command Note that I also had to add an ignore rule for pydocstyle: D301: Use r""" if any backslashes in a docstring The backslash style is required for click to preserve newlines (http://click.pocoo.org/5/documentation/). --- Makefile | 2 +- chalice/cli/__init__.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7b1b1e69c..37a57b3f9 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ check: # Proper docstring conventions according to pep257 # # - pydocstyle --add-ignore=D100,D101,D102,D103,D104,D105,D204 chalice/ + pydocstyle --add-ignore=D100,D101,D102,D103,D104,D105,D204,D301 chalice/ # # # diff --git a/chalice/cli/__init__.py b/chalice/cli/__init__.py index 8b2873b52..7273281ed 100644 --- a/chalice/cli/__init__.py +++ b/chalice/cli/__init__.py @@ -299,6 +299,21 @@ def package(ctx, single_file, stage, out): @click.pass_context def generate_pipeline(ctx, filename): # type: (click.Context, str) -> None + """Generate a cloudformation template for a starter CD pipeline. + + This command will write a starter cloudformation template to + the filename you provide. It contains a CodeCommit repo, + a CodeBuild stage for packaging your chalice app, and a + CodePipeline stage to deploy your application using cloudformation. + + You can use any AWS SDK or the AWS CLI to deploy this stack. + Here's an example using the AWS CLI: + + \b + $ chalice generate-pipeline pipeline.json + $ aws cloudformation deploy --stack-name mystack \b + --template-file pipeline.json --capabilities CAPABILITY_IAM + """ from chalice.pipeline import create_pipeline_template factory = ctx.obj['factory'] # type: CLIFactory config = factory.create_config_obj()