You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc_source/auth-and-access-control-using-tags.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
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*\.
4
4
5
-
**Example Example 1: Limit CodeBuild project actions based on resource tags**
5
+
**Example 1: Limit CodeBuild project actions based on resource tags**
6
6
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\.
7
7
8
8
```
@@ -25,7 +25,7 @@ Conditions in IAM policy statements are part of the syntax that you can use to s
25
25
}
26
26
```
27
27
28
-
**Example Example 2: Limit CodeBuild project actions based on request tags**
28
+
**Example 2: Limit CodeBuild project actions based on request tags**
29
29
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
30
30
31
31
```
@@ -60,7 +60,7 @@ The following policy denies users permission to the `CreateProject` action if th
60
60
}
61
61
```
62
62
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**
64
64
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`\)\.
65
65
The following example denies all CodeBuild actions on report groups tagged with the key `Status` and the key value of `Secret`:
66
66
@@ -87,7 +87,7 @@ The following example denies all CodeBuild actions on report groups tagged with
87
87
}
88
88
```
89
89
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**
91
91
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:
Copy file name to clipboardExpand all lines: doc_source/build-env-ref-cmd.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,4 +13,4 @@ You can specify any Shell Command Language \(sh\) command\. In buildspec version
13
13
14
14
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\.
15
15
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\.
Copy file name to clipboardExpand all lines: doc_source/build-env-ref-env-vars.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,8 @@ An identifier for the version of a build's source code\. Its format depends on t
42
42
+ For Amazon S3, this does not apply\.
43
43
44
44
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\.
46
47
47
48
CODEBUILD\_SOURCE\_VERSION
48
49
The value's format depends on the source repository\.
@@ -51,10 +52,11 @@ The value's format depends on the source repository\.
51
52
+ 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\.
52
53
**Note**
53
54
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)\.
54
56
55
57
CODEBUILD\_SRC\_DIR
56
58
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)\.
58
60
59
61
CODEBUILD\_START\_TIME
60
62
The start time of the build specified as a Unix timestamp in milliseconds\.
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)\.
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:
533
546
files:
534
547
- 'cucumber/target/cucumber-tests.xml'
535
548
discard-paths: yes
536
-
file-format: CucumberJson # default is JunitXml
549
+
file-format: CUCUMBERJSON # default is JUNITXML
537
550
artifacts:
538
551
files:
539
552
- target/messageUtil-1.0.jar
@@ -555,7 +568,7 @@ cache:
555
568
Here is an example of the preceding buildspec, expressed as a single string, for use with the AWS CLI, or the AWS SDKs\.
556
569
557
570
```
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/**/*'"
559
572
```
560
573
561
574
Here is an example of the commands in the `build` phase, for use with the CodeBuild or CodePipeline consoles\.
Copy file name to clipboardExpand all lines: doc_source/change-project-console.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,8 +145,8 @@ Choose to ignore SSL warnings while connecting to your GitHub Enterprise project
145
145
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\.
- timeout -t 15 sh -c "until docker info; do echo .; sleep 1; done"
150
150
```
151
151
152
152
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**\.
Copy file name to clipboardExpand all lines: doc_source/code-coverage-report.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,10 +14,12 @@ Branch coverage measures how many branches your tests cover out of every possibl
14
14
15
15
The following code coverage report file formats are supported:
16
16
+ JaCoCo XML
17
-
+ SimpleCov JSON
17
+
+ SimpleCov JSON¹
18
18
+ Clover XML
19
19
+ Cobertura XML
20
20
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
+
21
23
## Create a code coverage report<aname="code-coverage-report-create"></a>
22
24
23
25
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
39
41
jacoco-report:
40
42
files:
41
43
- 'test-results/jacoco-coverage-report.xml'
42
-
file-format: 'JaCoCoXml'
44
+
file-format: 'JACOCOXML'
43
45
```
44
46
45
47
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)\.
Copy file name to clipboardExpand all lines: doc_source/create-project-cli.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -382,7 +382,7 @@ Set to `true` only if you plan to use this build project to build Docker images,
382
382
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\.
Copy file name to clipboardExpand all lines: doc_source/create-project-console.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -169,7 +169,7 @@ Do one of the following:
169
169
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\.
Copy file name to clipboardExpand all lines: doc_source/history.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ The following table describes the important changes to the documentation since t
7
7
| Change | Description | Date |
8
8
| --- |--- |--- |
9
9
|[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 |
11
11
|[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 |
12
12
|[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 |
13
13
|[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