diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-ecr-build-and-publish.js.snapshot/codepipeline-ecr-build-and-publish.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-ecr-build-and-publish.js.snapshot/codepipeline-ecr-build-and-publish.template.json index 898301822414c..ca295b9d66d23 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-ecr-build-and-publish.js.snapshot/codepipeline-ecr-build-and-publish.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-ecr-build-and-publish.js.snapshot/codepipeline-ecr-build-and-publish.template.json @@ -193,7 +193,7 @@ }, "Configuration": { "ConnectionArn": "MOCK", - "FullRepositoryId": "go-to-k/cdk-codepipeline-demo-1", + "FullRepositoryId": "MOCK/MOCK", "BranchName": "master" }, "Name": "CodeStarConnectionsSourceAction", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-ecr-build-and-publish.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-ecr-build-and-publish.js.snapshot/tree.json index e3b507513d977..2b43de1dcf6ef 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-ecr-build-and-publish.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-ecr-build-and-publish.js.snapshot/tree.json @@ -337,7 +337,7 @@ }, "configuration": { "ConnectionArn": "MOCK", - "FullRepositoryId": "go-to-k/cdk-codepipeline-demo-1", + "FullRepositoryId": "MOCK/MOCK", "BranchName": "master" }, "runOrder": 1, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-ecr-build-and-publish.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-ecr-build-and-publish.ts index 63567e9c25cd6..3e4d7c1afa027 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-ecr-build-and-publish.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.pipeline-ecr-build-and-publish.ts @@ -6,22 +6,31 @@ import { ExpectedResult, IntegTest, Match } from '@aws-cdk/integ-tests-alpha'; /* * To run this integ test, the following steps are required. - * 1. Create a test repository on GitHub (in the code below, it is 'cdk-codepipeline-demo-1') - * 2. Create a Dockerfile with any content at the path `./my-dir/Dockerfile` - * 3. Set the `owner` and `repo` of `CodeStarConnectionsSourceAction` to your GitHub account name and repository name - * 4. Create a Connections in the CodePipeline management console that accesses your GitHub account - * 5. Set the ARN of that Connections to the `CONNECTION_ARN` environment variable in the integ test execution environment - * 6. After running the integ test, replace the value of CONNECTION_ARN written in the file generated in CloudAssembly (integ.pipeline-ecr-build-and-publish.js.snapshot/*) with the string `MOCK` + * + * 1. Create a test repository with any repository name on your GitHub account + * 2. Create a Dockerfile with any content at the path `./my-dir/Dockerfile` in the repository, and push it to the repository + * 3. Create a Connections in the CodePipeline management console that accesses your GitHub account + * 4. Set the ARN of that Connections to the `CONNECTION_ARN` environment variable in the integ test execution environment + * 5. Set your GitHub account name and the repository name to the `REPO_OWNER` and `REPO_NAME` environment variables in the integ test execution environment + * 6. After running the integ test, replace the value of `CONNECTION_ARN`, `REPO_OWNER`, and `REPO_NAME` written in the file generated in CloudAssembly (integ.THIS_FILE.js.snapshot/*) with the string `MOCK` */ const app = new cdk.App(); const stack = new cdk.Stack(app, 'codepipeline-ecr-build-and-publish'); -// Make sure you specify a valid connection ARN. +// Make sure you specify your connection ARN, your repository owner and name. const connectionArn = process.env.CONNECTION_ARN || 'MOCK'; +const owner = process.env.REPO_OWNER || 'MOCK'; +const repo = process.env.REPO_NAME || 'MOCK'; if (connectionArn === 'MOCK') { - cdk.Annotations.of(stack).addWarningV2('integ:connection-arn', 'You must specify a valid connection ARN in the CONNECTION_ARN environment variable'); + cdk.Annotations.of(stack).addWarningV2('integ:connection-arn', 'You must specify your connection ARN in the CONNECTION_ARN environment variable'); +} +if (owner === 'MOCK') { + cdk.Annotations.of(stack).addWarningV2('integ:repo-owner', 'You must specify your repository owner in the REPO_OWNER environment variable'); +} +if (repo === 'MOCK') { + cdk.Annotations.of(stack).addWarningV2('integ:repo-name', 'You must specify your repository name in the REPO_NAME environment variable'); } const sourceOutput = new codepipeline.Artifact(); @@ -29,9 +38,8 @@ const sourceAction = new cpactions.CodeStarConnectionsSourceAction({ actionName: 'CodeStarConnectionsSourceAction', output: sourceOutput, connectionArn, - // Please change the owner and repo if you execute this test - owner: 'go-to-k', - repo: 'cdk-codepipeline-demo-1', + owner, + repo, }); const repository = new ecr.Repository(stack, 'Repository', {