Skip to content

Commit 87b1ea0

Browse files
Kaixiang-AWSskinny85
authored andcommittedApr 11, 2019
feat(codebuild): add support for more images (#2233)
Updates to the newest versions of the Ubuntu 14.04 images for Go, Java, Ruby and Python. Also adds the new Ubuntu 18.04 Standard image. BREAKING CHANGE: change the default image from UBUNTU_14_04_BASE to UBUNTU_18_04_STANDARD. Fixes #2079
1 parent 07812b2 commit 87b1ea0

15 files changed

+28
-20
lines changed
 

‎packages/@aws-cdk/aws-codebuild/lib/project.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ export class Project extends ProjectBase {
622622
props.cacheBucket.grantReadWrite(this.role);
623623
}
624624

625-
this.buildImage = (props.environment && props.environment.buildImage) || LinuxBuildImage.UBUNTU_14_04_BASE;
625+
this.buildImage = (props.environment && props.environment.buildImage) || LinuxBuildImage.UBUNTU_18_04_STANDARD_1_0;
626626

627627
// let source "bind" to the project. this usually involves granting permissions
628628
// for the code build role to interact with the source.
@@ -944,7 +944,7 @@ export interface BuildEnvironment {
944944
/**
945945
* The image used for the builds.
946946
*
947-
* @default LinuxBuildImage.UBUNTU_14_04_BASE
947+
* @default LinuxBuildImage.UBUNTU_18_04_STANDARD_1_0
948948
*/
949949
readonly buildImage?: IBuildImage;
950950

@@ -1026,23 +1026,31 @@ export interface IBuildImage {
10261026
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html
10271027
*/
10281028
export class LinuxBuildImage implements IBuildImage {
1029+
public static readonly UBUNTU_18_04_STANDARD_1_0 = new LinuxBuildImage('aws/codebuild/standard:1.0');
10291030
public static readonly UBUNTU_14_04_BASE = new LinuxBuildImage('aws/codebuild/ubuntu-base:14.04');
10301031
public static readonly UBUNTU_14_04_ANDROID_JAVA8_24_4_1 = new LinuxBuildImage('aws/codebuild/android-java-8:24.4.1');
10311032
public static readonly UBUNTU_14_04_ANDROID_JAVA8_26_1_1 = new LinuxBuildImage('aws/codebuild/android-java-8:26.1.1');
10321033
public static readonly UBUNTU_14_04_DOCKER_17_09_0 = new LinuxBuildImage('aws/codebuild/docker:17.09.0');
1034+
public static readonly UBUNTU_14_04_DOCKER_18_09_0 = new LinuxBuildImage('aws/codebuild/docker:18.09.0');
10331035
public static readonly UBUNTU_14_04_GOLANG_1_10 = new LinuxBuildImage('aws/codebuild/golang:1.10');
1036+
public static readonly UBUNTU_14_04_GOLANG_1_11 = new LinuxBuildImage('aws/codebuild/golang:1.11');
10341037
public static readonly UBUNTU_14_04_OPEN_JDK_8 = new LinuxBuildImage('aws/codebuild/java:openjdk-8');
10351038
public static readonly UBUNTU_14_04_OPEN_JDK_9 = new LinuxBuildImage('aws/codebuild/java:openjdk-9');
1039+
public static readonly UBUNTU_14_04_OPEN_JDK_11 = new LinuxBuildImage('aws/codebuild/java:openjdk-11');
1040+
public static readonly UBUNTU_14_04_NODEJS_10_14_1 = new LinuxBuildImage('aws/codebuild/nodejs:10.14.1');
10361041
public static readonly UBUNTU_14_04_NODEJS_10_1_0 = new LinuxBuildImage('aws/codebuild/nodejs:10.1.0');
10371042
public static readonly UBUNTU_14_04_NODEJS_8_11_0 = new LinuxBuildImage('aws/codebuild/nodejs:8.11.0');
10381043
public static readonly UBUNTU_14_04_NODEJS_6_3_1 = new LinuxBuildImage('aws/codebuild/nodejs:6.3.1');
10391044
public static readonly UBUNTU_14_04_PHP_5_6 = new LinuxBuildImage('aws/codebuild/php:5.6');
10401045
public static readonly UBUNTU_14_04_PHP_7_0 = new LinuxBuildImage('aws/codebuild/php:7.0');
1046+
public static readonly UBUNTU_14_04_PHP_7_1 = new LinuxBuildImage('aws/codebuild/php:7.1');
1047+
public static readonly UBUNTU_14_04_PYTHON_3_7_1 = new LinuxBuildImage('aws/codebuild/python:3.7.1');
10411048
public static readonly UBUNTU_14_04_PYTHON_3_6_5 = new LinuxBuildImage('aws/codebuild/python:3.6.5');
10421049
public static readonly UBUNTU_14_04_PYTHON_3_5_2 = new LinuxBuildImage('aws/codebuild/python:3.5.2');
10431050
public static readonly UBUNTU_14_04_PYTHON_3_4_5 = new LinuxBuildImage('aws/codebuild/python:3.4.5');
10441051
public static readonly UBUNTU_14_04_PYTHON_3_3_6 = new LinuxBuildImage('aws/codebuild/python:3.3.6');
10451052
public static readonly UBUNTU_14_04_PYTHON_2_7_12 = new LinuxBuildImage('aws/codebuild/python:2.7.12');
1053+
public static readonly UBUNTU_14_04_RUBY_2_5_3 = new LinuxBuildImage('aws/codebuild/ruby:2.5.3');
10461054
public static readonly UBUNTU_14_04_RUBY_2_5_1 = new LinuxBuildImage('aws/codebuild/ruby:2.5.1');
10471055
public static readonly UBUNTU_14_04_RUBY_2_3_1 = new LinuxBuildImage('aws/codebuild/ruby:2.3.1');
10481056
public static readonly UBUNTU_14_04_RUBY_2_2_5 = new LinuxBuildImage('aws/codebuild/ruby:2.2.5');

‎packages/@aws-cdk/aws-codebuild/test/integ.caching.expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
},
145145
"Environment": {
146146
"ComputeType": "BUILD_GENERAL1_SMALL",
147-
"Image": "aws/codebuild/ubuntu-base:14.04",
147+
"Image": "aws/codebuild/standard:1.0",
148148
"PrivilegedMode": false,
149149
"Type": "LINUX_CONTAINER"
150150
},

‎packages/@aws-cdk/aws-codebuild/test/integ.defaults.expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
},
9999
"Environment": {
100100
"ComputeType": "BUILD_GENERAL1_SMALL",
101-
"Image": "aws/codebuild/ubuntu-base:14.04",
101+
"Image": "aws/codebuild/standard:1.0",
102102
"PrivilegedMode": false,
103103
"Type": "LINUX_CONTAINER"
104104
},

‎packages/@aws-cdk/aws-codebuild/test/integ.defaults.lit.expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
},
109109
"Environment": {
110110
"ComputeType": "BUILD_GENERAL1_SMALL",
111-
"Image": "aws/codebuild/ubuntu-base:14.04",
111+
"Image": "aws/codebuild/standard:1.0",
112112
"PrivilegedMode": false,
113113
"Type": "LINUX_CONTAINER"
114114
},

‎packages/@aws-cdk/aws-codebuild/test/integ.project-bucket.expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
},
142142
"Environment": {
143143
"ComputeType": "BUILD_GENERAL1_LARGE",
144-
"Image": "aws/codebuild/ubuntu-base:14.04",
144+
"Image": "aws/codebuild/standard:1.0",
145145
"PrivilegedMode": false,
146146
"Type": "LINUX_CONTAINER"
147147
},

‎packages/@aws-cdk/aws-codebuild/test/integ.project-events.expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
},
187187
"Environment": {
188188
"ComputeType": "BUILD_GENERAL1_SMALL",
189-
"Image": "aws/codebuild/ubuntu-base:14.04",
189+
"Image": "aws/codebuild/standard:1.0",
190190
"PrivilegedMode": false,
191191
"Type": "LINUX_CONTAINER"
192192
},

‎packages/@aws-cdk/aws-codebuild/test/integ.project-secondary-sources-artifacts.expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
},
175175
"Environment": {
176176
"ComputeType": "BUILD_GENERAL1_SMALL",
177-
"Image": "aws/codebuild/ubuntu-base:14.04",
177+
"Image": "aws/codebuild/standard:1.0",
178178
"PrivilegedMode": false,
179179
"Type": "LINUX_CONTAINER"
180180
},

‎packages/@aws-cdk/aws-codebuild/test/integ.project-shell.expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@
219219
}
220220
}
221221
],
222-
"Image": "aws/codebuild/ubuntu-base:14.04",
222+
"Image": "aws/codebuild/standard:1.0",
223223
"PrivilegedMode": false,
224224
"Type": "LINUX_CONTAINER"
225225
},

‎packages/@aws-cdk/aws-codebuild/test/integ.project-vpc.expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@
489489
}
490490
}
491491
],
492-
"Image": "aws/codebuild/ubuntu-base:14.04",
492+
"Image": "aws/codebuild/standard:1.0",
493493
"PrivilegedMode": false,
494494
"Type": "LINUX_CONTAINER"
495495
},

‎packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export = {
128128
"Environment": {
129129
"Type": "LINUX_CONTAINER",
130130
"PrivilegedMode": false,
131-
"Image": "aws/codebuild/ubuntu-base:14.04",
131+
"Image": "aws/codebuild/standard:1.0",
132132
"ComputeType": "BUILD_GENERAL1_SMALL"
133133
}
134134
}
@@ -266,7 +266,7 @@ export = {
266266
},
267267
"Environment": {
268268
"ComputeType": "BUILD_GENERAL1_SMALL",
269-
"Image": "aws/codebuild/ubuntu-base:14.04",
269+
"Image": "aws/codebuild/standard:1.0",
270270
"PrivilegedMode": false,
271271
"Type": "LINUX_CONTAINER"
272272
},
@@ -766,7 +766,7 @@ export = {
766766
"Environment": {
767767
"Type": "LINUX_CONTAINER",
768768
"PrivilegedMode": false,
769-
"Image": "aws/codebuild/ubuntu-base:14.04",
769+
"Image": "aws/codebuild/standard:1.0",
770770
"ComputeType": "BUILD_GENERAL1_SMALL"
771771
}
772772
}));
@@ -797,7 +797,7 @@ export = {
797797
"Environment": {
798798
"Type": "LINUX_CONTAINER",
799799
"PrivilegedMode": false,
800-
"Image": "aws/codebuild/ubuntu-base:14.04",
800+
"Image": "aws/codebuild/standard:1.0",
801801
"ComputeType": "BUILD_GENERAL1_SMALL"
802802
}
803803
}));
@@ -1002,7 +1002,7 @@ export = {
10021002
}
10031003
],
10041004
"PrivilegedMode": false,
1005-
"Image": "aws/codebuild/ubuntu-base:14.04",
1005+
"Image": "aws/codebuild/standard:1.0",
10061006
"ComputeType": "BUILD_GENERAL1_SMALL"
10071007
}
10081008
}));

‎packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@
616616
},
617617
"Environment": {
618618
"ComputeType": "BUILD_GENERAL1_SMALL",
619-
"Image": "aws/codebuild/ubuntu-base:14.04",
619+
"Image": "aws/codebuild/standard:1.0",
620620
"PrivilegedMode": false,
621621
"Type": "LINUX_CONTAINER"
622622
},

‎packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-commit-build.expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
},
179179
"Environment": {
180180
"ComputeType": "BUILD_GENERAL1_SMALL",
181-
"Image": "aws/codebuild/ubuntu-base:14.04",
181+
"Image": "aws/codebuild/standard:1.0",
182182
"PrivilegedMode": false,
183183
"Type": "LINUX_CONTAINER"
184184
},

‎packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-events.expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@
506506
},
507507
"Environment": {
508508
"ComputeType": "BUILD_GENERAL1_SMALL",
509-
"Image": "aws/codebuild/ubuntu-base:14.04",
509+
"Image": "aws/codebuild/standard:1.0",
510510
"PrivilegedMode": false,
511511
"Type": "LINUX_CONTAINER"
512512
},

‎packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ export = {
296296
"Environment": {
297297
"Type": "LINUX_CONTAINER",
298298
"PrivilegedMode": false,
299-
"Image": "aws/codebuild/ubuntu-base:14.04",
299+
"Image": "aws/codebuild/standard:1.0",
300300
"ComputeType": "BUILD_GENERAL1_SMALL"
301301
}
302302
}));

‎packages/decdk/test/__snapshots__/synth.test.js.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,7 @@ Object {
16791679
},
16801680
"Environment": Object {
16811681
"ComputeType": "BUILD_GENERAL1_SMALL",
1682-
"Image": "aws/codebuild/ubuntu-base:14.04",
1682+
"Image": "aws/codebuild/standard:1.0",
16831683
"PrivilegedMode": false,
16841684
"Type": "LINUX_CONTAINER",
16851685
},

0 commit comments

Comments
 (0)