Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions samcli/commands/pipeline/bootstrap/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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.
"""
),
)
Expand Down
16 changes: 8 additions & 8 deletions samcli/commands/pipeline/init/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""


Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions samcli/commands/pipeline/init/interactive_init_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
9 changes: 4 additions & 5 deletions tests/integration/testdata/pipeline/expected_jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down