Skip to content

Commit 86195c4

Browse files
committed
General updates
1 parent 527a41f commit 86195c4

25 files changed

+112
-80
lines changed

doc_source/auth-and-access-control-using-tags.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Conditions in IAM policy statements are part of the syntax that you can use to specify permissions to CodeBuild project\-based actions\. You can create a policy that allows or denies actions on projects based on the tags associated with those projects, and then apply those policies to the IAM groups you configure for managing IAM users\. For information about applying tags to a project using the console or AWS CLI, see [Create a build project in AWS CodeBuild](create-project.md)\. For information about applying tags using the CodeBuild SDK, see [CreateProject ](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_CreateProject.html#API_CreateProject_RequestSyntax) and [Tags](https://docs.aws.amazon.com/codebuild/latest/APIReference/API_Tag.html) in the *CodeBuild API Reference*\. For information about using tags to control access to AWS resources, see [Controlling Access to AWS Resources Using Resource Tags](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html) in the *IAM User Guide*\.
44

5-
**Example Example 1: Limit CodeBuild project actions based on resource tags**
5+
**Example 1: Limit CodeBuild project actions based on resource tags**
66
The following example denies all `BatchGetProjects` actions on projects tagged with the key `Environment` with the key value of `Production`\. A user's administrator must attach this IAM policy in addition to the managed user policy to unauthorized IAM users\. The `aws:ResourceTag` condition key is used to control access to resources based on their tags\.
77

88
```
@@ -25,7 +25,7 @@ Conditions in IAM policy statements are part of the syntax that you can use to s
2525
}
2626
```
2727

28-
**Example Example 2: Limit CodeBuild project actions based on request tags**
28+
**Example 2: Limit CodeBuild project actions based on request tags**
2929
The following policy denies users permission to the `CreateProject` action if the request contains a tag with the key `Environment` and the key value `Production`\. In addition, the policy prevents these unauthorized users from modifying projects by using the `aws:TagKeys` condition key to not allow `UpdateProject` if the request contains a tag with the key `Environment`\. An administrator must attach this IAM policy in addition to the managed user policy to users who are not authorized to perform these actions\. The `aws:RequestTag` condition key is used to control which tags can be passed in an IAM request
3030

3131
```
@@ -60,7 +60,7 @@ The following policy denies users permission to the `CreateProject` action if th
6060
}
6161
```
6262

63-
**Example Example 3: Deny or allow actions on report groups based on resource tags**
63+
**Example 3: Deny or allow actions on report groups based on resource tags**
6464
You can create a policy that allows or denies actions on CodeBuild resources \(projects and report groups\) based on the AWS tags associated with those resources, and then apply those policies to the IAM groups you configure for managing IAM users\. For example, you can create a policy that denies all CodeBuild actions on any report group with the AWS tag key `Status` and the key value of `Secret`, and then apply that policy to the IAM group you created for general developers \(*Developers*\)\. You then need to make sure that the developers working on those tagged report groups are not members of that general *Developers* group, but belong instead to a different IAM group that does not have the restrictive policy applied \(`SecretDevelopers`\)\.
6565
The following example denies all CodeBuild actions on report groups tagged with the key `Status` and the key value of `Secret`:
6666

@@ -87,7 +87,7 @@ The following example denies all CodeBuild actions on report groups tagged with
8787
}
8888
```
8989

90-
**Example Example 4: Limit CodeBuild actions to AWSCodeBuildDeveloperAccess based on resource tags**
90+
**Example 4: Limit CodeBuild actions to AWSCodeBuildDeveloperAccess based on resource tags**
9191
You can create policies that allow CodeBuild actions on all report groups and projects that are not tagged with specific tags\. For example, the following policy allows the equivalent of [AWSCodeBuildDeveloperAccess](auth-and-access-control-iam-identity-based-access-control.md#developer-access-policy) permissions for all report groups and projects except those tagged with the specified tags:
9292

9393
```

doc_source/build-env-ref-cmd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ You can specify any Shell Command Language \(sh\) command\. In buildspec version
1313

1414
If CodeBuild encounters an error, the error might be more difficult to troubleshoot compared to running a single command in its own instance of the default shell\.
1515

16-
Commands that are run in a Windows Server Core 2016 image use the PowerShell shell\.
16+
Commands that are run in a Windows Server Core image use the PowerShell shell\.

doc_source/build-env-ref-env-vars.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ An identifier for the version of a build's source code\. Its format depends on t
4242
+ For Amazon S3, this does not apply\.
4343

4444
CODEBUILD\_SOURCE\_REPO\_URL
45-
The URL to the input artifact or source code repository\. For Amazon S3, this is `s3://` followed by the bucket name and path to the input artifact\. For CodeCommit and GitHub, this is the repository's clone URL\. If a build originates from CodePipeline, then this might be empty\.
45+
The URL to the input artifact or source code repository\. For Amazon S3, this is `s3://` followed by the bucket name and path to the input artifact\. For CodeCommit and GitHub, this is the repository's clone URL\. If a build originates from CodePipeline, this environment variable may be empty\.
46+
For secondary sources, the environment variable for the secondary source repository URL is `CODEBUILD_SOURCE_REPO_URL_<sourceIdentifier>`, where `<sourceIdentifier>` is the source identifier you create\.
4647

4748
CODEBUILD\_SOURCE\_VERSION
4849
The value's format depends on the source repository\.
@@ -51,10 +52,11 @@ The value's format depends on the source repository\.
5152
+ For GitHub, GitHub Enterprise Server, and Bitbucket it is the commit ID, branch name, or tag name associated with the version of the source code to be built\.
5253
**Note**
5354
For a GitHub or GitHub Enterprise Server build that is triggered by a webhook pull request event, it is `pr/pull-request-number`\.
55+
For secondary sources, the environment variable for the secondary source version is `CODEBUILD_SOURCE_VERSION_<sourceIdentifier>`, where `<sourceIdentifier>` is the source identifier you create\. For more information, see [Multiple input sources and output artifacts sample](sample-multi-in-out.md)\.
5456

5557
CODEBUILD\_SRC\_DIR
5658
The directory path that CodeBuild uses for the build \(for example, `/tmp/src123456789/src`\)\.
57-
If you use a secondary source, the environment variable for its directory path is `CODEBUILD_SRC_DIR_sourceIdentifier`, where `sourceIdentifier` is the source identifier you create\. For more information, see [Multiple input sources and output artifacts sample](sample-multi-in-out.md)\.
59+
For secondary sources, the environment variable for the secondary source directory path is `CODEBUILD_SRC_DIR_<sourceIdentifier>`, where `<sourceIdentifier>` is the source identifier you create\. For more information, see [Multiple input sources and output artifacts sample](sample-multi-in-out.md)\.
5860

5961
CODEBUILD\_START\_TIME
6062
The start time of the build specified as a Unix timestamp in milliseconds\.

doc_source/build-spec-ref.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -294,17 +294,30 @@ Required sequence\. Represents the locations that contain the raw data of test r
294294
+ `my-subdirectory/**/*` represents all files recursively starting from a subdirectory named *my\-subdirectory*\.
295295

296296
reports/<report\-group>/**file\-format** <a name="build-spec.reports.file-format"></a>
297-
Optional mapping\. Represents the test report file format\. If not specified, `JunitXml` is used\. The following test report file formats are supported:
298-
+ `CucumberJson`
299-
+ `JunitXml`
300-
+ `NunitXml`
301-
+ `TestNGXml`
302-
+ `VisualStudioTrx`
303-
The following code coverage report formats are supported:
304-
+ `JaCoCoXml`
305-
+ `SimpleCov`
306-
+ `CloverXml`
307-
+ `CoberturaXml`
297+
Optional mapping\. Represents the report file format\. If not specified, `JUNITXML` is used\. This value is not case sensitive\. Possible values are:
298+
**Test reports**
299+
`CUCUMBERJSON`
300+
Cucumber JSON
301+
`JUNITXML`
302+
JUnit XML
303+
`NUNITXML`
304+
NUnit XML
305+
`NUNIT3XML`
306+
NUnit 3 XML
307+
`TESTNGXML`
308+
TestNG XML
309+
`VISUALSTUDIOTRX`
310+
Visual Studio TRX
311+
**Code coverage reports**
312+
`CLOVERXML`
313+
Clover XML
314+
`COBERTURAXML`
315+
Cobertura XML
316+
`JACOCOXML`
317+
JaCoCo XML
318+
`SIMPLECOV`
319+
SimpleCov JSON
320+
CodeBuild accepts JSON code coverage reports generated by [simplecov](https://github.com/simplecov-ruby/simplecov), not [simplecov\-json](https://github.com/vicentllongo/simplecov-json)\.
308321

309322
reports/<report\-group>/**base\-directory** <a name="build-spec.reports.base-directory"></a>
310323
Optional mapping\. Represents one or more top\-level directories, relative to the original build location, that CodeBuild uses to determine where to find the raw test files\.
@@ -533,7 +546,7 @@ reports:
533546
files:
534547
- 'cucumber/target/cucumber-tests.xml'
535548
discard-paths: yes
536-
file-format: CucumberJson # default is JunitXml
549+
file-format: CUCUMBERJSON # default is JUNITXML
537550
artifacts:
538551
files:
539552
- target/messageUtil-1.0.jar
@@ -555,7 +568,7 @@ cache:
555568
Here is an example of the preceding buildspec, expressed as a single string, for use with the AWS CLI, or the AWS SDKs\.
556569

557570
```
558-
"version: 0.2\n\nenv:\n variables:\n JAVA_HOME: \"/usr/lib/jvm/java-8-openjdk-amd64\\"\n parameter-store:\n LOGIN_PASSWORD: /CodeBuild/dockerLoginPassword\n phases:\n\n install:\n commands:\n - echo Entered the install phase...\n - apt-get update -y\n - apt-get install -y maven\n finally:\n - echo This always runs even if the update or install command fails \n pre_build:\n commands:\n - echo Entered the pre_build phase...\n - docker login –u User –p $LOGIN_PASSWORD\n finally:\n - echo This always runs even if the login command fails \n build:\n commands:\n - echo Entered the build phase...\n - echo Build started on `date`\n - mvn install\n finally:\n - echo This always runs even if the install command fails\n post_build:\n commands:\n - echo Entered the post_build phase...\n - echo Build completed on `date`\n\n reports:\n reportGroupJunitXml:\n files:\n - \"**/*\"\n base-directory: 'target/tests/reports'\n discard-paths: false\n reportGroupCucumberJson:\n files:\n - 'cucumber/target/cucumber-tests.xml'\n file-format: CucumberJson\n\nartifacts:\n files:\n - target/messageUtil-1.0.jar\n discard-paths: yes\n secondary-artifacts:\n artifact1:\n files:\n - target/messageUtil-1.0.jar\n discard-paths: yes\n artifact2:\n files:\n - target/messageUtil-1.0.jar\n discard-paths: yes\n cache:\n paths:\n - '/root/.m2/**/*'"
571+
"version: 0.2\n\nenv:\n variables:\n JAVA_HOME: \"/usr/lib/jvm/java-8-openjdk-amd64\\"\n parameter-store:\n LOGIN_PASSWORD: /CodeBuild/dockerLoginPassword\n phases:\n\n install:\n commands:\n - echo Entered the install phase...\n - apt-get update -y\n - apt-get install -y maven\n finally:\n - echo This always runs even if the update or install command fails \n pre_build:\n commands:\n - echo Entered the pre_build phase...\n - docker login –u User –p $LOGIN_PASSWORD\n finally:\n - echo This always runs even if the login command fails \n build:\n commands:\n - echo Entered the build phase...\n - echo Build started on `date`\n - mvn install\n finally:\n - echo This always runs even if the install command fails\n post_build:\n commands:\n - echo Entered the post_build phase...\n - echo Build completed on `date`\n\n reports:\n reportGroupJunitXml:\n files:\n - \"**/*\"\n base-directory: 'target/tests/reports'\n discard-paths: false\n reportGroupCucumberJson:\n files:\n - 'cucumber/target/cucumber-tests.xml'\n file-format: CUCUMBERJSON\n\nartifacts:\n files:\n - target/messageUtil-1.0.jar\n discard-paths: yes\n secondary-artifacts:\n artifact1:\n files:\n - target/messageUtil-1.0.jar\n discard-paths: yes\n artifact2:\n files:\n - target/messageUtil-1.0.jar\n discard-paths: yes\n cache:\n paths:\n - '/root/.m2/**/*'"
559572
```
560573

561574
Here is an example of the commands in the `build` phase, for use with the CodeBuild or CodePipeline consoles\.

doc_source/change-project-console.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ Choose to ignore SSL warnings while connecting to your GitHub Enterprise project
145145
By default, Docker containers do not allow access to any devices\. Privileged mode grants a build project's Docker container access to all devices\. For more information, see [Runtime Privilege and Linux Capabilities](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) on the Docker Docs website\.
146146

147147
```
148-
- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay&
149-
- timeout -t 15 sh -c "until docker info; do echo .; sleep 1; done"
148+
- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2
149+
- timeout -t 15 sh -c "until docker info; do echo .; sleep 1; done"
150150
```
151151

152152
1. To change information about the CodeBuild service role, in **Service role**, change the values for **New service role**, **Existing service role**, or **Role name**\.

doc_source/code-coverage-report.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ Branch coverage measures how many branches your tests cover out of every possibl
1414

1515
The following code coverage report file formats are supported:
1616
+ JaCoCo XML
17-
+ SimpleCov JSON
17+
+ SimpleCov JSON¹
1818
+ Clover XML
1919
+ Cobertura XML
2020

21+
¹ CodeBuild accepts JSON code coverage reports generated by [simplecov](https://github.com/simplecov-ruby/simplecov), not [simplecov\-json](https://github.com/vicentllongo/simplecov-json)\.
22+
2123
## Create a code coverage report<a name="code-coverage-report-create"></a>
2224

2325
To create a code coverage report, you run a build project that is configured with at least one code coverage report group in its buildspec file\. AWS CodeBuild will interpret the code coverage results and provide a code coverage report for the run\. A new test report is generated for each subsequent build that uses the same buildspec file\.
@@ -39,7 +41,7 @@ To create a code coverage report, you run a build project that is configured wit
3941
jacoco-report:
4042
files:
4143
- 'test-results/jacoco-coverage-report.xml'
42-
file-format: 'JaCoCoXml'
44+
file-format: 'JACOCOXML'
4345
```
4446
4547
1. In the `commands` section of the `build` or `post_build` sequence, specify the commands that run the code coverage analysis\. For more information, see [ Specify test commands ](report-group-test-case-commands.md)\.

doc_source/create-project-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ Set to `true` only if you plan to use this build project to build Docker images,
382382
By default, Docker containers do not allow access to any devices\. Privileged mode grants a build project's Docker container access to all devices\. For more information, see [Runtime Privilege and Linux Capabilities](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) on the Docker Docs website\.
383383

384384
```
385-
- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay&
385+
- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2
386386
- timeout -t 15 sh -c "until docker info; do echo .; sleep 1; done"
387387
```
388388

doc_source/create-project-console.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Do one of the following:
169169
By default, Docker containers do not allow access to any devices\. Privileged mode grants a build project's Docker container access to all devices\. For more information, see [Runtime Privilege and Linux Capabilities](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) on the Docker Docs website\.
170170

171171
```
172-
- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay&
172+
- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2
173173
- timeout -t 15 sh -c "until docker info; do echo .; sleep 1; done"
174174
```
175175

doc_source/create-project.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
You can use the AWS CodeBuild console, AWS CLI, or AWS SDKs to create a build project\.
44

5+
## Prerequisites<a name="create-project-prerequisites"></a>
6+
7+
Before creating a build project, answer the questions in [Plan a build](planning.md)\.
8+
59
**Topics**
610
+ [Prerequisites](#create-project-prerequisites)
711
+ [Create a build project \(console\)](create-project-console.md)
812
+ [Create a build project \(AWS CLI\)](create-project-cli.md)
913
+ [Create a build project \(AWS SDKs\)](create-project-sdks.md)
10-
+ [Create a build project \(AWS CloudFormation\)](create-project-cloud-formation.md)
11-
12-
## Prerequisites<a name="create-project-prerequisites"></a>
13-
14-
Answer the questions in [Plan a build](planning.md)\.
14+
+ [Create a build project \(AWS CloudFormation\)](create-project-cloud-formation.md)

doc_source/history.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The following table describes the important changes to the documentation since t
77
| Change | Description | Date |
88
| --- |--- |--- |
99
| [Code coverage reporting](#history) | CodeBuild now provides code coverage reports\. For more information, see [Code coverage reports](https://docs.aws.amazon.com/codebuild/latest/userguide/code-coverage-report.html)\. | July 30, 2020 |
10-
| [Batch builds](#history) | CodeBuild now supports the execution of concurrent and coordinated builds of a project\. For more information, see [Batch builds in CodeBuild\.](https://docs.aws.amazon.com/codebuild/latest/userguide/batch-build.html)\. | July 30, 2020 |
10+
| [Batch builds](#history) | CodeBuild now supports the execution of concurrent and coordinated builds of a project\. For more information, see [Batch builds in CodeBuild](https://docs.aws.amazon.com/codebuild/latest/userguide/batch-build.html)\. | July 30, 2020 |
1111
| [Windows Server 2019 image](#history) | CodeBuild now provides a Windows Server Core 2019 build image\. For more information, see [Docker images provided by CodeBuild](https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html)\. | July 20, 2020 |
1212
| [Session Manager](#history) | CodeBuild now allows you to pause a running build and then use AWS Systems Manager Session Manager to connect to the build container and view the state of the container\. For more information, see [Session Manager](https://docs.aws.amazon.com/codebuild/latest/userguide/session-manager.html)\. | July 20, 2020 |
1313
| [Updated topic](#history) | CodeBuild now supports specifying a shell to use in their build environments in the buildspec file\. For more information, see [Build specification reference](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html)\. | June 25, 2020 |

0 commit comments

Comments
 (0)