Skip to content

Commit

Permalink
Feature add GitHub token (#11)
Browse files Browse the repository at this point in the history
* Fix codebuild

* Fix timeout

* Fix timeout

* Update README

* Address comments

* Address comments

* Format
  • Loading branch information
goruha authored Nov 28, 2017
1 parent c659c17 commit 66ad1f7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module "build" {
| aws_account_id | "" | (Optional) AWS Account ID. Used as `CodeBuild` ENV variable when building Docker images |
| image_repo_name | "UNSET" | (Optional) ECR repository name to store the Docker image built by this module. Used as `CodeBuild` ENV variable when building Docker images |
| image_tag | "latest" | (Optional) Docker image tag in the ECR repository, _e.g._ `latest`. Used as `CodeBuild` ENV variable when building Docker images |
| github_token | "" | (Optional) GitHub auth token environment variable (`GITHUB_TOKEN`) |



Expand Down
5 changes: 5 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ resource "aws_codebuild_project" "default" {
"name" = "IMAGE_TAG"
"value" = "${signum(length(var.image_tag)) == 1 ? var.image_tag : "latest"}"
}

environment_variable {
"name" = "GITHUB_TOKEN"
"value" = "${var.github_token}"
}
}

source {
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ variable "privileged_mode" {
description = "(Optional) If set to true, enables running the Docker daemon inside a Docker container on the CodeBuild instance. Used when building Docker images"
}

variable "github_token" {
default = ""
description = "(Optional) GitHub auth token environment variable (`GITHUB_TOKEN`)"
}

variable "aws_region" {
type = "string"
default = ""
Expand Down

0 comments on commit 66ad1f7

Please sign in to comment.