Skip to content

Commit

Permalink
feat(codebuild): add support for more image types
Browse files Browse the repository at this point in the history
Add support for aws/codebuild/golang:1.11 and aws/codebuild/standard:1.0
and default UBUNTU_18_04_STANDARD as the build image

Fixes aws#2079

BREAKING CHANGE: change the default image from UBUNTU_14_04_BASE to UBUNTU_18_04_STANDARD
If you want to keep the behavior as previous, please explicitly specify image as UBUNTU_14_04_BASE
  • Loading branch information
Kaixiang-AWS committed Apr 10, 2019
1 parent 109625d commit 1528941
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 15 deletions.
6 changes: 4 additions & 2 deletions packages/@aws-cdk/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ export class Project extends ProjectBase {
props.cacheBucket.grantReadWrite(this.role);
}

this.buildImage = (props.environment && props.environment.buildImage) || LinuxBuildImage.UBUNTU_14_04_BASE;
this.buildImage = (props.environment && props.environment.buildImage) || LinuxBuildImage.UBUNTU_18_04_STANDARD;

// let source "bind" to the project. this usually involves granting permissions
// for the code build role to interact with the source.
Expand Down Expand Up @@ -941,7 +941,7 @@ export interface BuildEnvironment {
/**
* The image used for the builds.
*
* @default LinuxBuildImage.UBUNTU_14_04_BASE
* @default LinuxBuildImage.UBUNTU_18_04_STANDARD
*/
readonly buildImage?: IBuildImage;

Expand Down Expand Up @@ -1023,11 +1023,13 @@ export interface IBuildImage {
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
*/
export class LinuxBuildImage implements IBuildImage {
public static readonly UBUNTU_18_04_STANDARD = new LinuxBuildImage('aws/codebuild/standard:1.0');
public static readonly UBUNTU_14_04_BASE = new LinuxBuildImage('aws/codebuild/ubuntu-base:14.04');
public static readonly UBUNTU_14_04_ANDROID_JAVA8_24_4_1 = new LinuxBuildImage('aws/codebuild/android-java-8:24.4.1');
public static readonly UBUNTU_14_04_ANDROID_JAVA8_26_1_1 = new LinuxBuildImage('aws/codebuild/android-java-8:26.1.1');
public static readonly UBUNTU_14_04_DOCKER_17_09_0 = new LinuxBuildImage('aws/codebuild/docker:17.09.0');
public static readonly UBUNTU_14_04_GOLANG_1_10 = new LinuxBuildImage('aws/codebuild/golang:1.10');
public static readonly UBUNTU_14_04_GOLANG_1_11 = new LinuxBuildImage('aws/codebuild/golang:1.11');
public static readonly UBUNTU_14_04_OPEN_JDK_8 = new LinuxBuildImage('aws/codebuild/java:openjdk-8');
public static readonly UBUNTU_14_04_OPEN_JDK_9 = new LinuxBuildImage('aws/codebuild/java:openjdk-9');
public static readonly UBUNTU_14_04_NODEJS_10_1_0 = new LinuxBuildImage('aws/codebuild/nodejs:10.1.0');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
},
"Environment": {
"ComputeType": "BUILD_GENERAL1_SMALL",
"Image": "aws/codebuild/ubuntu-base:14.04",
"Image": "aws/codebuild/standard:1.0",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
},
"Environment": {
"ComputeType": "BUILD_GENERAL1_SMALL",
"Image": "aws/codebuild/ubuntu-base:14.04",
"Image": "aws/codebuild/standard:1.0",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
},
"Environment": {
"ComputeType": "BUILD_GENERAL1_SMALL",
"Image": "aws/codebuild/ubuntu-base:14.04",
"Image": "aws/codebuild/standard:1.0",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
},
"Environment": {
"ComputeType": "BUILD_GENERAL1_LARGE",
"Image": "aws/codebuild/ubuntu-base:14.04",
"Image": "aws/codebuild/standard:1.0",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
},
"Environment": {
"ComputeType": "BUILD_GENERAL1_SMALL",
"Image": "aws/codebuild/ubuntu-base:14.04",
"Image": "aws/codebuild/standard:1.0",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
},
"Environment": {
"ComputeType": "BUILD_GENERAL1_SMALL",
"Image": "aws/codebuild/ubuntu-base:14.04",
"Image": "aws/codebuild/standard:1.0",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
}
}
],
"Image": "aws/codebuild/ubuntu-base:14.04",
"Image": "aws/codebuild/standard:1.0",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@
}
}
],
"Image": "aws/codebuild/ubuntu-base:14.04",
"Image": "aws/codebuild/standard:1.0",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export = {
"Environment": {
"Type": "LINUX_CONTAINER",
"PrivilegedMode": false,
"Image": "aws/codebuild/ubuntu-base:14.04",
"Image": "aws/codebuild/standard:1.0",
"ComputeType": "BUILD_GENERAL1_SMALL"
}
}
Expand Down Expand Up @@ -266,7 +266,7 @@ export = {
},
"Environment": {
"ComputeType": "BUILD_GENERAL1_SMALL",
"Image": "aws/codebuild/ubuntu-base:14.04",
"Image": "aws/codebuild/standard:1.0",
"PrivilegedMode": false,
"Type": "LINUX_CONTAINER"
},
Expand Down Expand Up @@ -766,7 +766,7 @@ export = {
"Environment": {
"Type": "LINUX_CONTAINER",
"PrivilegedMode": false,
"Image": "aws/codebuild/ubuntu-base:14.04",
"Image": "aws/codebuild/standard:1.0",
"ComputeType": "BUILD_GENERAL1_SMALL"
}
}));
Expand Down Expand Up @@ -797,7 +797,7 @@ export = {
"Environment": {
"Type": "LINUX_CONTAINER",
"PrivilegedMode": false,
"Image": "aws/codebuild/ubuntu-base:14.04",
"Image": "aws/codebuild/standard:1.0",
"ComputeType": "BUILD_GENERAL1_SMALL"
}
}));
Expand Down Expand Up @@ -1002,7 +1002,7 @@ export = {
}
],
"PrivilegedMode": false,
"Image": "aws/codebuild/ubuntu-base:14.04",
"Image": "aws/codebuild/standard:1.0",
"ComputeType": "BUILD_GENERAL1_SMALL"
}
}));
Expand Down

0 comments on commit 1528941

Please sign in to comment.