Skip to content

Commit 0650994

Browse files
chriswynnykaknysh
authored andcommitted
Support pass-through for variable report_build_status (#37)
* Expose the 'report_build_status' variable to support ingration with Github CI/CD pipelines. * Move report_build_status to the correct variable block. * Fixed formatting
1 parent 9d4a657 commit 0650994

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ Available targets:
137137
| name | Solution name, e.g. 'app' or 'jenkins' | string | `codebuild` | no |
138138
| namespace | Namespace, which could be your organization name, e.g. 'cp' or 'cloudposse' | string | `global` | no |
139139
| privileged_mode | (Optional) If set to true, enables running the Docker daemon inside a Docker container on the CodeBuild instance. Used when building Docker images | string | `false` | no |
140+
| report_build_status | Set to true to report the status of a build's start and finish to your source provider. This option is only valid when the source_type is BITBUCKET or GITHUB. | string | `false` | no |
140141
| source_location | The location of the source code from git or s3. | string | `` | no |
141142
| source_type | The type of repository that contains the source code to be built. Valid values for this parameter are: CODECOMMIT, CODEPIPELINE, GITHUB, GITHUB_ENTERPRISE, BITBUCKET or S3. | string | `CODEPIPELINE` | no |
142143
| stage | Stage, e.g. 'prod', 'staging', 'dev', or 'test' | string | `default` | no |

docs/terraform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
| name | Solution name, e.g. 'app' or 'jenkins' | string | `codebuild` | no |
2424
| namespace | Namespace, which could be your organization name, e.g. 'cp' or 'cloudposse' | string | `global` | no |
2525
| privileged_mode | (Optional) If set to true, enables running the Docker daemon inside a Docker container on the CodeBuild instance. Used when building Docker images | string | `false` | no |
26+
| report_build_status | Set to true to report the status of a build's start and finish to your source provider. This option is only valid when the source_type is BITBUCKET or GITHUB. | string | `false` | no |
2627
| source_location | The location of the source code from git or s3. | string | `` | no |
2728
| source_type | The type of repository that contains the source code to be built. Valid values for this parameter are: CODECOMMIT, CODEPIPELINE, GITHUB, GITHUB_ENTERPRISE, BITBUCKET or S3. | string | `CODEPIPELINE` | no |
2829
| stage | Stage, e.g. 'prod', 'staging', 'dev', or 'test' | string | `default` | no |

main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,10 @@ resource "aws_codebuild_project" "default" {
208208
}
209209

210210
source {
211-
buildspec = "${var.buildspec}"
212-
type = "${var.source_type}"
213-
location = "${var.source_location}"
211+
buildspec = "${var.buildspec}"
212+
type = "${var.source_type}"
213+
location = "${var.source_location}"
214+
report_build_status = "${var.report_build_status}"
214215
}
215216

216217
tags = "${module.label.tags}"

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,9 @@ variable "artifact_type" {
152152
default = "CODEPIPELINE"
153153
description = "The build output artifact's type. Valid values for this parameter are: CODEPIPELINE, NO_ARTIFACTS or S3."
154154
}
155+
156+
variable "report_build_status" {
157+
type = "string"
158+
default = "false"
159+
description = "Set to true to report the status of a build's start and finish to your source provider. This option is only valid when the source_type is BITBUCKET or GITHUB."
160+
}

0 commit comments

Comments
 (0)