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
1 change: 0 additions & 1 deletion packages/aws-cdk-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,6 @@
"./region-info": "./region-info/index.js",
"./triggers": "./triggers/index.js"
},
"preferredCdkCliVersion": "2",
"publishConfig": {
"tag": "latest"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { GraphNodeCollection, isGraph, AGraphNode, PipelineGraph } from '../help
import { PipelineBase } from '../main';
import { AssetSingletonRole } from '../private/asset-singleton-role';
import { CachedFnSub } from '../private/cached-fnsub';
import { preferredCliVersion } from '../private/cli-version';
import { appOf, assemblyBuilderOf, embeddedAsmPath, obtainScope } from '../private/construct-internals';
import { CDKP_DEFAULT_CODEBUILD_IMAGE } from '../private/default-codebuild-image';
import { toPosixPath } from '../private/fs';
Expand Down Expand Up @@ -425,7 +424,7 @@ export class CodePipeline extends PipelineBase {
this.selfMutationEnabled = props.selfMutation ?? true;
this.dockerCredentials = props.dockerCredentials ?? [];
this.singlePublisherPerAssetType = !(props.publishAssetsInParallel ?? true);
this.cliVersion = props.cliVersion ?? preferredCliVersion();
this.cliVersion = props.cliVersion ?? '2';
this.cdkAssetsCliVersion = props.cdkAssetsCliVersion ?? 'latest';
this.useChangeSets = props.useChangeSets ?? true;
this.stackOutputs = new StackOutputsMap(this);
Expand Down
41 changes: 0 additions & 41 deletions packages/aws-cdk-lib/pipelines/lib/private/cli-version.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,32 @@ test('CodeBuild asset role has the right Principal with the feature enabled', ()
);
});

test.each([
[undefined, '2'],
['9.9.9', '9.9.9'],
])('When I request CLI version version %p I get %p', (requested, expected) => {
const pipelineStack = new cdk.Stack(app, 'PipelineStack', { env: PIPELINE_ENV });
const pipe = new ModernTestGitHubNpmPipeline(pipelineStack, 'Cdk', {
cliVersion: requested,
});

pipe.addStage(new FileAssetApp(pipelineStack, 'App', {}));

Template.fromStack(pipelineStack).hasResourceProperties('AWS::CodeBuild::Project', {
Source: {
BuildSpec: Match.serializedJson(Match.objectLike({
phases: {
install: {
commands: [
`npm install -g aws-cdk@${expected}`,
],
},
},
})),
},
});
});

test('CodeBuild asset role has the right Principal with the feature disabled', () => {
const stack = new cdk.Stack();
stack.node.setContext(cxapi.PIPELINE_REDUCE_ASSET_ROLE_TRUST_SCOPE, false);
Expand Down
Loading