From 0b227ecd1f86217a5df844cee4c1589dc5af76c1 Mon Sep 17 00:00:00 2001 From: Sam Liu Date: Tue, 20 Jul 2021 17:42:40 -0700 Subject: [PATCH 01/10] Update --bucket help text --- samcli/commands/pipeline/bootstrap/cli.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/samcli/commands/pipeline/bootstrap/cli.py b/samcli/commands/pipeline/bootstrap/cli.py index 9e8b454992b..4682e6bdcae 100644 --- a/samcli/commands/pipeline/bootstrap/cli.py +++ b/samcli/commands/pipeline/bootstrap/cli.py @@ -60,8 +60,7 @@ ) @click.option( "--bucket", - help="The name of the S3 bucket where this command uploads your CloudFormation template. This is required for" - "deployments of templates sized greater than 51,200 bytes.", + help="The ARN of the Amazon S3 bucket to hold the AWS SAM artifacts.", required=False, ) @click.option( From d0fc4fea363796afdebb4ce643028b8ac9b8d560 Mon Sep 17 00:00:00 2001 From: Sam Liu Date: Tue, 20 Jul 2021 17:43:08 -0700 Subject: [PATCH 02/10] Update --stage help text --- samcli/commands/pipeline/bootstrap/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samcli/commands/pipeline/bootstrap/cli.py b/samcli/commands/pipeline/bootstrap/cli.py index 4682e6bdcae..5e880b018e1 100644 --- a/samcli/commands/pipeline/bootstrap/cli.py +++ b/samcli/commands/pipeline/bootstrap/cli.py @@ -39,7 +39,8 @@ ) @click.option( "--stage", - help="The name of the corresponding stage. It is used as a suffix for the created resources.", + help="The name of the corresponding deployment stage. " + "It is used as a suffix for the created AWS infrastructure resources.", required=False, ) @click.option( From 5a5e3ea16810afd5e1c6256449f10223615ee702 Mon Sep 17 00:00:00 2001 From: Sam Liu Date: Tue, 20 Jul 2021 17:49:41 -0700 Subject: [PATCH 03/10] Update help text --- samcli/commands/pipeline/bootstrap/cli.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/samcli/commands/pipeline/bootstrap/cli.py b/samcli/commands/pipeline/bootstrap/cli.py index 5e880b018e1..e4d5e265663 100644 --- a/samcli/commands/pipeline/bootstrap/cli.py +++ b/samcli/commands/pipeline/bootstrap/cli.py @@ -40,7 +40,7 @@ @click.option( "--stage", help="The name of the corresponding deployment stage. " - "It is used as a suffix for the created AWS infrastructure resources.", + "It is used as a suffix for the created AWS infrastructure resources.", required=False, ) @click.option( @@ -73,7 +73,9 @@ ) @click.option( "--image-repository", - help="ECR repo uri where this command uploads the image artifacts that are referenced in your template.", + help="Specify whether to create an Amazon ECR image repository if none is provided. " + "The Amazon ECR repository holds the container images of Lambda functions or layers " + "having a package type of Image. The default is --no-create-image-repository.", required=False, ) @click.option( From f2e8eef1043bdae9e0d4a3f9c35571fba4d9986b Mon Sep 17 00:00:00 2001 From: Sam Liu Date: Tue, 20 Jul 2021 17:50:19 -0700 Subject: [PATCH 04/10] Update help text --- samcli/commands/pipeline/bootstrap/cli.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samcli/commands/pipeline/bootstrap/cli.py b/samcli/commands/pipeline/bootstrap/cli.py index e4d5e265663..30a1de0d426 100644 --- a/samcli/commands/pipeline/bootstrap/cli.py +++ b/samcli/commands/pipeline/bootstrap/cli.py @@ -73,9 +73,9 @@ ) @click.option( "--image-repository", - help="Specify whether to create an Amazon ECR image repository if none is provided. " - "The Amazon ECR repository holds the container images of Lambda functions or layers " - "having a package type of Image. The default is --no-create-image-repository.", + help="The ARN of an Amazon ECR image repository to hold the container images of Lambda functions or " + "layers that have a package type of Image. If provided, the --create-image-repository options is ignored. " + "If not provided and --create-image-repository is specified, the command will create one.", required=False, ) @click.option( From b6a4a4d72ccad1e3b1192f93d519e3049471f05f Mon Sep 17 00:00:00 2001 From: Sam Liu Date: Tue, 20 Jul 2021 17:52:21 -0700 Subject: [PATCH 05/10] Update help text --- samcli/commands/pipeline/bootstrap/cli.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/samcli/commands/pipeline/bootstrap/cli.py b/samcli/commands/pipeline/bootstrap/cli.py index 30a1de0d426..75e140b05cd 100644 --- a/samcli/commands/pipeline/bootstrap/cli.py +++ b/samcli/commands/pipeline/bootstrap/cli.py @@ -45,18 +45,22 @@ ) @click.option( "--pipeline-user", - help="An IAM user generated or referenced by sam pipeline bootstrap in order to " - "allow the connected CI/CD system to connect to the SAM CLI.", + help="The Amazon Resource Name (ARN) of the IAM user having its access key ID and secret access key " + "shared with the CI/CD system. It is used to grant this IAM user permission to access the " + "corresponding AWS account. If not provided, the command will create one along with the access " + "key ID and secret access key credentials.", required=False, ) @click.option( "--pipeline-execution-role", - help="Execution role that the CI/CD system assumes in order to make changes to resources on your behalf.", + help="The ARN of the IAM role to be assumed by the pipeline user to operate on this stage. " + "Provide it only if you want to use your own role, otherwise this command will create one.", required=False, ) @click.option( "--cloudformation-execution-role", - help="Execution role that CloudFormation assumes in order to make changes to resources on your behalf", + help="The ARN of the IAM role to be assumed by the AWS CloudFormation service while deploying the " + "application's stack. Provide only if you want to use your own role, otherwise the command will create one.", required=False, ) @click.option( @@ -74,15 +78,15 @@ @click.option( "--image-repository", help="The ARN of an Amazon ECR image repository to hold the container images of Lambda functions or " - "layers that have a package type of Image. If provided, the --create-image-repository options is ignored. " - "If not provided and --create-image-repository is specified, the command will create one.", + "layers that have a package type of Image. If provided, the --create-image-repository options is ignored. " + "If not provided and --create-image-repository is specified, the command will create one.", required=False, ) @click.option( "--confirm-changeset/--no-confirm-changeset", default=True, is_flag=True, - help="Prompt to confirm if the resources is to be deployed by SAM CLI.", + help="Prompt to confirm if the resources are to be deployed.", ) @common_options @aws_creds_options From 0dc9be07e96ecad081ab3534f49f42e87c8b76a6 Mon Sep 17 00:00:00 2001 From: Sam Liu Date: Tue, 20 Jul 2021 17:53:35 -0700 Subject: [PATCH 06/10] Update help text --- samcli/commands/pipeline/bootstrap/cli.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/samcli/commands/pipeline/bootstrap/cli.py b/samcli/commands/pipeline/bootstrap/cli.py index 75e140b05cd..0830ae08821 100644 --- a/samcli/commands/pipeline/bootstrap/cli.py +++ b/samcli/commands/pipeline/bootstrap/cli.py @@ -17,12 +17,11 @@ from .guided_context import GuidedContext from ..external_links import CONFIG_AWS_CRED_ON_CICD_URL -SHORT_HELP = "Generates the necessary AWS resources to connect your CI/CD system." +SHORT_HELP = "Generates the required AWS resources to connect your CI/CD system." HELP_TEXT = """ -SAM Pipeline Bootstrap generates the necessary AWS resources to connect your -CI/CD system. This step must be completed for each pipeline stage prior to -running sam pipeline init +This command generates the required AWS infrastructure resources to connect to your CI/CD system. +This step must be run for each deployment stage in your pipeline, prior to running the sam pipline init command. """ PIPELINE_CONFIG_DIR = os.path.join(".aws-sam", "pipeline") From e16149d1d07c24b0bd18e21e4bdf63e15c457f74 Mon Sep 17 00:00:00 2001 From: Sam Liu Date: Tue, 20 Jul 2021 17:56:10 -0700 Subject: [PATCH 07/10] Update help text --- samcli/commands/pipeline/init/cli.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/samcli/commands/pipeline/init/cli.py b/samcli/commands/pipeline/init/cli.py index bcbe205c6a9..cd2cf5382db 100644 --- a/samcli/commands/pipeline/init/cli.py +++ b/samcli/commands/pipeline/init/cli.py @@ -10,14 +10,14 @@ from samcli.commands.pipeline.init.interactive_init_flow import InteractiveInitFlow from samcli.lib.telemetry.metric import track_command -SHORT_HELP = "Generates CI/CD pipeline configuration files." +SHORT_HELP = "Generates a CI/CD pipeline configuration file." HELP_TEXT = """ -sam pipeline init generates a pipeline configuration file that you can use to connect your -AWS account(s) to your CI/CD system. Before using sam pipeline init, you must -bootstrap the necessary resources for each stage in your pipeline. You can do this -by running sam pipeline init --bootstrap to be guided through the setup and configuration -file generation process, or refer to resources you have previously created with the -sam pipeline bootstrap command. +This command generates a pipeline configuration file that your CI/CD system can use to deploy +serverless applications using AWS SAM. + +Before using sam pipeline init, you must bootstrap the necessary resources for each stage in your pipeline. +You can do this by running sam pipeline init --bootstrap to be guided through the setup and configuration +file generation process, or refer to resources you have previously created with the sam pipeline bootstrap command. """ @@ -27,7 +27,7 @@ "--bootstrap", is_flag=True, default=False, - help="Allow bootstrapping resources.", + help="Enable interactive mode that walks the user through creating necessary AWS infrastructure resources.", ) @cli_framework_options @pass_context From c8b9911e0f8df98f2683f4a2af1f04bfdf696934 Mon Sep 17 00:00:00 2001 From: Sam Liu Date: Tue, 20 Jul 2021 17:57:45 -0700 Subject: [PATCH 08/10] Update jenkins generated files --- tests/integration/testdata/pipeline/expected_jenkinsfile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/integration/testdata/pipeline/expected_jenkinsfile b/tests/integration/testdata/pipeline/expected_jenkinsfile index 0271ca633ef..14adf3b92bf 100644 --- a/tests/integration/testdata/pipeline/expected_jenkinsfile +++ b/tests/integration/testdata/pipeline/expected_jenkinsfile @@ -145,11 +145,6 @@ pipeline { // } // } - // uncomment this to have a manual approval step before deployment to production - // stage('production-deployment-approval'){ - // input "Do you want to deploy to production environment?" - // } - stage('deploy-prod') { when { branch env.MAIN_BRANCH @@ -160,6 +155,10 @@ pipeline { } } steps { + // uncomment this to have a manual approval step before deployment to production + // timeout(time: 24, unit: 'HOURS') { + // input 'Please confirm before starting production deployment' + // } withAWS( credentials: env.PIPELINE_USER_CREDENTIAL_ID, region: env.PROD_REGION, From 952bc098a1845e82a898ef723774ac4852f36a84 Mon Sep 17 00:00:00 2001 From: Sam Liu Date: Tue, 20 Jul 2021 18:02:38 -0700 Subject: [PATCH 09/10] Update some intro texts --- samcli/commands/pipeline/bootstrap/cli.py | 10 ++++++---- samcli/commands/pipeline/init/interactive_init_flow.py | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/samcli/commands/pipeline/bootstrap/cli.py b/samcli/commands/pipeline/bootstrap/cli.py index 0830ae08821..1fac24f92a5 100644 --- a/samcli/commands/pipeline/bootstrap/cli.py +++ b/samcli/commands/pipeline/bootstrap/cli.py @@ -155,10 +155,12 @@ def do_cli( dedent( """\ - sam pipeline bootstrap generates the necessary AWS resources to connect a stage in - your CI/CD system. We will ask for [1] stage definition, [2] account details, and - [3] references to existing resources in order to bootstrap these pipeline - resources. + sam pipeline bootstrap generates the required AWS infrastructure resources to connect + to your CI/CD system. This step must be run for each deployment stage in your pipeline, + prior to running the sam pipeline init command. + + We will ask for [1] stage definition, [2] account details, and + [3] references to existing resources in order to bootstrap these pipeline resources. """ ), ) diff --git a/samcli/commands/pipeline/init/interactive_init_flow.py b/samcli/commands/pipeline/init/interactive_init_flow.py index 7504f3a66b4..4d824b8189a 100644 --- a/samcli/commands/pipeline/init/interactive_init_flow.py +++ b/samcli/commands/pipeline/init/interactive_init_flow.py @@ -57,10 +57,10 @@ def do_interactive(self) -> None: dedent( """\ - sam pipeline init generates a pipeline configuration file that you can use to connect your - AWS account(s) to your CI/CD system. We will guide you through the process to - bootstrap resources for each stage, then walk through the details necessary for - creating the pipeline config file. + sam pipeline init generates a pipeline configuration file that your CI/CD system + can use to deploy serverless applications using AWS SAM. + We will guide you through the process to bootstrap resources for each stage, + then walk through the details necessary for creating the pipeline config file. Please ensure you are in the root folder of your SAM application before you begin. """ From e9be714df20282ccc5c1b9f678731916f4b17cee Mon Sep 17 00:00:00 2001 From: Sam Liu Date: Tue, 20 Jul 2021 18:04:39 -0700 Subject: [PATCH 10/10] Remove trialing spaces --- samcli/commands/pipeline/bootstrap/cli.py | 2 +- samcli/commands/pipeline/init/cli.py | 2 +- samcli/commands/pipeline/init/interactive_init_flow.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samcli/commands/pipeline/bootstrap/cli.py b/samcli/commands/pipeline/bootstrap/cli.py index 1fac24f92a5..4c32ebc9b31 100644 --- a/samcli/commands/pipeline/bootstrap/cli.py +++ b/samcli/commands/pipeline/bootstrap/cli.py @@ -158,7 +158,7 @@ def do_cli( sam pipeline bootstrap generates the required AWS infrastructure resources to connect to your CI/CD system. This step must be run for each deployment stage in your pipeline, prior to running the sam pipeline init command. - + We will ask for [1] stage definition, [2] account details, and [3] references to existing resources in order to bootstrap these pipeline resources. """ diff --git a/samcli/commands/pipeline/init/cli.py b/samcli/commands/pipeline/init/cli.py index cd2cf5382db..a7223398c94 100644 --- a/samcli/commands/pipeline/init/cli.py +++ b/samcli/commands/pipeline/init/cli.py @@ -17,7 +17,7 @@ Before using sam pipeline init, you must bootstrap the necessary resources for each stage in your pipeline. You can do this by running sam pipeline init --bootstrap to be guided through the setup and configuration -file generation process, or refer to resources you have previously created with the sam pipeline bootstrap command. +file generation process, or refer to resources you have previously created with the sam pipeline bootstrap command. """ diff --git a/samcli/commands/pipeline/init/interactive_init_flow.py b/samcli/commands/pipeline/init/interactive_init_flow.py index 4d824b8189a..d4e989ebfa0 100644 --- a/samcli/commands/pipeline/init/interactive_init_flow.py +++ b/samcli/commands/pipeline/init/interactive_init_flow.py @@ -58,7 +58,7 @@ def do_interactive(self) -> None: """\ sam pipeline init generates a pipeline configuration file that your CI/CD system - can use to deploy serverless applications using AWS SAM. + can use to deploy serverless applications using AWS SAM. We will guide you through the process to bootstrap resources for each stage, then walk through the details necessary for creating the pipeline config file.