Skip to content

Commit

Permalink
Support pass-through for variable report_build_status (#37)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
chriswynnyk authored and aknysh committed Feb 28, 2019
1 parent 9d4a657 commit 0650994
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Available targets:
| name | Solution name, e.g. 'app' or 'jenkins' | string | `codebuild` | no |
| namespace | Namespace, which could be your organization name, e.g. 'cp' or 'cloudposse' | string | `global` | no |
| 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 |
| 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 |
| source_location | The location of the source code from git or s3. | string | `` | no |
| 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 |
| stage | Stage, e.g. 'prod', 'staging', 'dev', or 'test' | string | `default` | no |
Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
| name | Solution name, e.g. 'app' or 'jenkins' | string | `codebuild` | no |
| namespace | Namespace, which could be your organization name, e.g. 'cp' or 'cloudposse' | string | `global` | no |
| 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 |
| 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 |
| source_location | The location of the source code from git or s3. | string | `` | no |
| 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 |
| stage | Stage, e.g. 'prod', 'staging', 'dev', or 'test' | string | `default` | no |
Expand Down
7 changes: 4 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,10 @@ resource "aws_codebuild_project" "default" {
}

source {
buildspec = "${var.buildspec}"
type = "${var.source_type}"
location = "${var.source_location}"
buildspec = "${var.buildspec}"
type = "${var.source_type}"
location = "${var.source_location}"
report_build_status = "${var.report_build_status}"
}

tags = "${module.label.tags}"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,9 @@ variable "artifact_type" {
default = "CODEPIPELINE"
description = "The build output artifact's type. Valid values for this parameter are: CODEPIPELINE, NO_ARTIFACTS or S3."
}

variable "report_build_status" {
type = "string"
default = "false"
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."
}

0 comments on commit 0650994

Please sign in to comment.