Skip to content

Commit 3537e22

Browse files
committed
Fix dev pipeline deployment bug
1 parent 775eeed commit 3537e22

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

tests/ci/cdk/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
AWS-LC CI uses AWS CDK to define and deploy AWS resources (e.g. AWS CodeBuild, ECR).
44

55
## Table of Contents
6-
- [CI Setup](#ci-setup)
6+
- [CDK Setup](#cdk-setup)
77
- [Before running CDK command](#before-running-cdk-command)
88
- [Minimal permissions](#minimal-permissions)
99
- [Pipeline Commands](#pipeline-commands)
@@ -104,7 +104,7 @@ To deploy dev pipeline to the same account as your CI:
104104

105105
To deploy dev pipeline but pipeline is hosted in a separate account:
106106
```
107-
./run-cdk.sh --github-repo-owner ${GITHUB_REPO_OWNER} --github-source-version ${GITHUB_SOURCE_VERSION} --pipeline-acount ${PIPELINE_ACCOUNT_ID} --deploy-account ${DEPLOY_ACCOUNT_ID} --action deploy-dev-pipeline
107+
./run-cdk.sh --github-repo-owner ${GITHUB_REPO_OWNER} --github-source-version ${GITHUB_SOURCE_VERSION} --pipeline-account ${PIPELINE_ACCOUNT_ID} --deploy-account ${DEPLOY_ACCOUNT_ID} --action deploy-dev-pipeline
108108
```
109109

110110
To deploy production pipeline using default parameters:

tests/ci/cdk/cdk/windows_docker_image_build_stack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,5 @@ def __init__(
136136
Tags.of(instance).add(WIN_EC2_TAG_KEY, WIN_EC2_TAG_VALUE)
137137

138138
self.output = {
139-
"s3_bucket_name": bucket.bucket_name,
139+
"s3_bucket_name": bucket._generate_physical_name(),
140140
}

tests/ci/cdk/pipeline/ci_stage.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
from cdk.aws_lc_github_ci_stack import AwsLcGitHubCIStack
1414
from cdk.aws_lc_github_fuzz_ci_stack import AwsLcGitHubFuzzCIStack
1515
from pipeline.codebuild_batch_step import CodeBuildBatchStep
16-
from util.metadata import PRE_PROD_ACCOUNT
16+
from util.metadata import PRE_PROD_ACCOUNT, GITHUB_TOKEN_SECRET_NAME, STAGING_GITHUB_REPO_OWNER, \
17+
STAGING_GITHUB_REPO_NAME
1718

1819

1920
class CiStage(Stage):
@@ -183,7 +184,7 @@ def add_stage_to_pipeline(
183184
environment_variables={
184185
"GITHUB_PAT": codebuild.BuildEnvironmentVariable(
185186
type=codebuild.BuildEnvironmentVariableType.SECRETS_MANAGER,
186-
value="aws-lc/ci/github/token",
187+
value=GITHUB_TOKEN_SECRET_NAME,
187188
),
188189
}
189190
),
@@ -198,8 +199,8 @@ def add_stage_to_pipeline(
198199
# "git push origin main",
199200
],
200201
env={
201-
"STAGING_GITHUB_REPO_OWNER": "aws",
202-
"STAGING_GITHUB_REPO_NAME": "private-aws-lc-staging",
202+
"STAGING_GITHUB_REPO_OWNER": STAGING_GITHUB_REPO_OWNER,
203+
"STAGING_GITHUB_REPO_NAME": STAGING_GITHUB_REPO_NAME,
203204
},
204205
role=role,
205206
timeout=Duration.minutes(60),

tests/ci/cdk/pipeline/windows_docker_image_build_stage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0 OR ISC
33
import typing
44

5-
from aws_cdk import Stage, Environment, Stack, Duration, aws_iam as iam, pipelines, Fn
5+
from aws_cdk import Stage, Environment, Stack, Duration, aws_iam as iam, pipelines
66
from aws_cdk.pipelines import CodeBuildStep
77
from constructs import Construct
88

tests/ci/cdk/run-cdk.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ function deploy_production_pipeline() {
230230
}
231231

232232
function deploy_dev_pipeline() {
233-
if [[ -z "${DEPLOY_ACCOUNT:+x}" || -z "${PIPELINE_ACCOUNT}" ]]; then
233+
if [[ -z "${DEPLOY_ACCOUNT:+x}" || -z "${DEPLOY_ACCOUNT}" ]]; then
234234
echo "The pipeline needs a deployment acount to know where to deploy the CI to."
235235
exit 1
236236
fi
@@ -241,7 +241,7 @@ function deploy_dev_pipeline() {
241241
fi
242242

243243
if [[ -z "${PIPELINE_ACCOUNT+x}" || -z "${PIPELINE_ACCOUNT}" ]]; then
244-
export PIPELINE_ACCOUNT=DEPLOY_ACCOUNT
244+
export PIPELINE_ACCOUNT=${DEPLOY_ACCOUNT}
245245
fi
246246

247247
if [[ ${PIPELINE_ACCOUNT+x} == '774305600158' ]]; then

0 commit comments

Comments
 (0)