Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Added the PrivilegedMode parameter Issue #20 #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ The app has the following parameters:
| SourceCodeProvider | Optional | Whether the Git repository is hosted on GitHub or CodeCommit. Allowed values: GitHub, CodeCommit. Default: GitHub |
| ComputeType | Optional | AWS CodeBuild project compute type. See [the documentation](https://docs.aws.amazon.com/codebuild/latest/userguide/create-project.html#create-project-cli) for details. Default: BUILD_GENERAL1_SMALL |
| EnvironmentType | Optional | Environment type used by AWS CodeBuild. See [the documentation](https://docs.aws.amazon.com/codebuild/latest/userguide/create-project.html#create-project-cli) for details. Default: LINUX_CONTAINER |
| PrivilegedMode | Optional | Run build in privileged mode. See [the documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.html#cfn-codebuild-project-environment-privilegedmode) |
| BuildSpecFilePath | Optional | CodeBuild build spec file name for build stage. See [Build Specification Reference for CodeBuild](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html). Default: buildspec.yaml |
| IntegTestRoleName | Optional | IAM role name for test stage. This role needs to be configured to allow codebuild.amazonaws.com and cloudformation.amazonaws.com to assume it. Test stage will not be added if default value is used. Default: '' |
| IntegTestBuildSpecFilePath | Optional | CodeBuild build spec file name for test stage. This parameter is only used if you provide the `IntegTestRoleName` parameter. See [the documentation](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html). Default: integ-test-buildspec.yaml |
Expand Down
13 changes: 13 additions & 0 deletions sam/app/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ Parameters:
Default: LINUX_CONTAINER
Description: Environment type used by AWS CodeBuild. See the documentation for details (https://docs.aws.amazon.com/codebuild/latest/userguide/create-project.html#create-project-cli).
Type: String
PrivilegedMode:
AllowedValues:
- true
- false
Default: false
Description: Run build in privileged mode. Enables running the Docker daemon inside a Docker container See the documentation for details (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-environment.html#cfn-codebuild-project-environment-privilegedmode and https://docs.aws.amazon.com/codebuild/latest/userguide/troubleshooting.html)
Type: String
SourceCodeProvider:
Type: String
Description: Location of your source code repository
Expand Down Expand Up @@ -125,6 +132,8 @@ Conditions:
!Equals [!Ref SourceCodeProvider, 'CodeCommit']
UseGitHub:
!Equals [!Ref SourceCodeProvider, 'GitHub']
HasPrivilegedMode:
!Equals [!Ref PrivilegedMode, 'true']

Rules:
ValidateGitHub:
Expand Down Expand Up @@ -404,6 +413,8 @@ Resources:
ComputeType: !Ref ComputeType
Image: 'aws/codebuild/standard:2.0'
Type: !Ref EnvironmentType
PrivilegedMode:
!If [HasPrivilegedMode, true, false]
EnvironmentVariables:
- Name: PACKAGE_BUCKET
Value: !Ref Artifacts
Expand Down Expand Up @@ -435,6 +446,8 @@ Resources:
ComputeType: !Ref ComputeType
Image: 'aws/codebuild/standard:2.0'
Type: !Ref EnvironmentType
PrivilegedMode:
!If [HasPrivilegedMode, true, false]
EnvironmentVariables:
- Name: PACKAGE_BUCKET
Value: !Ref Artifacts
Expand Down