diff --git a/samcli/commands/pipeline/bootstrap/cli.py b/samcli/commands/pipeline/bootstrap/cli.py index 9e8b454992..4c32ebc9b3 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") @@ -39,29 +38,33 @@ ) @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( "--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( "--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( @@ -73,14 +76,16 @@ ) @click.option( "--image-repository", - help="ECR repo uri where this command uploads the image artifacts that are referenced in your template.", + 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( "--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 @@ -150,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/cli.py b/samcli/commands/pipeline/init/cli.py index bcbe205c6a..a7223398c9 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 diff --git a/samcli/commands/pipeline/init/interactive_init_flow.py b/samcli/commands/pipeline/init/interactive_init_flow.py index 7504f3a66b..d4e989ebfa 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. """ diff --git a/tests/integration/testdata/pipeline/expected_jenkinsfile b/tests/integration/testdata/pipeline/expected_jenkinsfile index 0271ca633e..14adf3b92b 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,