Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(codebuild): expose aws/windows/base:2.0 image #7004

Merged
merged 4 commits into from
Mar 25, 2020
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
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codebuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ The CodeBuild library supports both Linux and Windows images via the
`LinuxBuildImage` and `WindowsBuildImage` classes, respectively.

You can either specify one of the predefined Windows/Linux images by using one
of the constants such as `WindowsBuildImage.WIN_SERVER_CORE_2016_BASE` or
of the constants such as `WindowsBuildImage.WINDOWS_BASE_2_0` or
`LinuxBuildImage.STANDARD_2_0`.

Alternatively, you can specify a custom image using one of the static methods on
Expand Down
14 changes: 14 additions & 0 deletions packages/@aws-cdk/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1394,11 +1394,25 @@ interface WindowsBuildImageProps {
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
*/
export class WindowsBuildImage implements IBuildImage {
/**
* Corresponds to the standard CodeBuild image `aws/codebuild/windows-base:1.0`.
*
* @deprecated `WindowsBuildImage.WINDOWS_BASE_2_0` should be used instead.
*/
public static readonly WIN_SERVER_CORE_2016_BASE: IBuildImage = new WindowsBuildImage({
imageId: 'aws/codebuild/windows-base:1.0',
imagePullPrincipalType: ImagePullPrincipalType.CODEBUILD,
});

/**
* The standard CodeBuild image `aws/codebuild/windows-base:2.0`, which is
* based off Windows Server Core 2016.
*/
public static readonly WINDOWS_BASE_2_0: IBuildImage = new WindowsBuildImage({
imageId: 'aws/codebuild/windows-base:2.0',
imagePullPrincipalType: ImagePullPrincipalType.CODEBUILD,
});

/**
* @returns a Windows build image from a Docker Hub image.
*/
Expand Down
1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-codebuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@
"docs-public-apis:@aws-cdk/aws-codebuild.Source.gitHubEnterprise",
"docs-public-apis:@aws-cdk/aws-codebuild.Source.s3",
"docs-public-apis:@aws-cdk/aws-codebuild.StateChangeEvent.currentPhase",
"docs-public-apis:@aws-cdk/aws-codebuild.WindowsBuildImage.WIN_SERVER_CORE_2016_BASE",
"docs-public-apis:@aws-cdk/aws-codebuild.WindowsBuildImage.fromDockerRegistry",
"docs-public-apis:@aws-cdk/aws-codebuild.WindowsBuildImage.fromEcrRepository",
"props-default-doc:@aws-cdk/aws-codebuild.ArtifactsProps.identifier",
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export = {
path: 'path/to/source.zip',
}),
environment: {
buildImage: codebuild.WindowsBuildImage.WIN_SERVER_CORE_2016_BASE,
buildImage: codebuild.WindowsBuildImage.WINDOWS_BASE_2_0,
},
});

Expand Down Expand Up @@ -442,7 +442,7 @@ export = {
},
"Environment": {
"ComputeType": "BUILD_GENERAL1_MEDIUM",
"Image": "aws/codebuild/windows-base:1.0",
"Image": "aws/codebuild/windows-base:2.0",
"PrivilegedMode": false,
"Type": "WINDOWS_CONTAINER"
},
Expand Down Expand Up @@ -1280,7 +1280,7 @@ export = {
'using ComputeType.Small with a Windows image fails validation'(test: Test) {
const stack = new cdk.Stack();
const invalidEnvironment: codebuild.BuildEnvironment = {
buildImage: codebuild.WindowsBuildImage.WIN_SERVER_CORE_2016_BASE,
buildImage: codebuild.WindowsBuildImage.WINDOWS_BASE_2_0,
computeType: codebuild.ComputeType.SMALL,
};

Expand Down