Skip to content

Codepipeline V2

0

Please provide a example for codepipeline V2. Like where can we pass the parameters that we create? Can we use those parameters inside buildspec files?

asked 2 years ago1.3K views

1 Answer
0

Hello.

You can reference pipeline level variables in buildspec.yml by configuring the following document.
Set environment variables in the build phase settings when configuring CodePipeline.
Set the buildspec.yml to refer to that environment variable.
https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-pipeline-variables.html

Under Environment variables - optional, to create an environment variable as an input variable for the build action that will be resolved by the pipeline-level variable, choose Add environment variable. This will create the variable specified in the buildspec as $CUSTOM_VAR1. In Name, enter CUSTOM_VAR1. In Value, enter #{variables.timeout}. In Type, choose Plaintext.

The #{variables.timeout} value for the environment variable is based on the pipeline-level variable namespace variables and the pipeline-level variable timeout created for the pipeline in step 5.

Pipeline level variables are set in the following parts.

Under Variables, choose Add variable. In Name, enter timeout. In Default, enter 1000. In description, enter the following description: Timeout.

EXPERT

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.