Skip to content

Commit

Permalink
feat: Add skip_gcloud_download flag (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
bharathkkb committed Jun 30, 2020
1 parent 853b511 commit 0e06b29
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Make will use bash instead of sh
SHELL := /usr/bin/env bash

DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0.6.0
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 0.11.0
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
REGISTRY_URL := gcr.io/cloud-foundation-cicd

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ For the cloudbuild submodule, see the README [cloudbuild](./modules/cloudbuild).
| project\_prefix | Name prefix to use for projects created. | string | `"cft"` | no |
| sa\_enable\_impersonation | Allow org_admins group to impersonate service account & enable APIs required. | bool | `"false"` | no |
| sa\_org\_iam\_permissions | List of permissions granted to Terraform service account across the GCP organization. | list(string) | `<list>` | no |
| skip\_gcloud\_download | Whether to skip downloading gcloud (assumes gcloud is already available outside the module) | bool | `"true"` | no |
| storage\_bucket\_labels | Labels to apply to the storage bucket. | map(string) | `<map>` | no |

## Outputs
Expand Down
2 changes: 1 addition & 1 deletion build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ tags:
- 'integration'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0.6.0'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0.11.0'
2 changes: 1 addition & 1 deletion build/lint.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ tags:
- 'lint'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0.1.0'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0.11.0'
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ resource "google_organization_iam_member" "tmp_project_creator" {

module "seed_project" {
source = "terraform-google-modules/project-factory/google"
version = "~> 7.0"
version = "~> 8.0"
name = local.seed_project_id
random_project_id = true
disable_services_on_destroy = false
Expand All @@ -55,6 +55,7 @@ module "seed_project" {
billing_account = var.billing_account
activate_apis = local.activate_apis
labels = var.project_labels
skip_gcloud_download = var.skip_gcloud_download
}

/******************************************
Expand Down
1 change: 1 addition & 0 deletions modules/cloudbuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Functional examples and sample Cloud Build definitions are included in the [exam
| project\_labels | Labels to apply to the project. | map(string) | `<map>` | no |
| project\_prefix | Name prefix to use for projects created. | string | `"cft"` | no |
| sa\_enable\_impersonation | Allow org_admins group to impersonate service account & enable APIs required. | bool | `"false"` | no |
| skip\_gcloud\_download | Whether to skip downloading gcloud (assumes gcloud is already available outside the module) | bool | `"true"` | no |
| storage\_bucket\_labels | Labels to apply to the storage bucket. | map(string) | `<map>` | no |
| terraform\_sa\_email | Email for terraform service account. | string | n/a | yes |
| terraform\_sa\_name | Fully-qualified name of the terraform service account. | string | n/a | yes |
Expand Down
3 changes: 2 additions & 1 deletion modules/cloudbuild/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ data "google_organization" "org" {

module "cloudbuild_project" {
source = "terraform-google-modules/project-factory/google"
version = "~> 7.0"
version = "~> 8.0"
name = local.cloudbuild_project_id
random_project_id = true
disable_services_on_destroy = false
Expand All @@ -45,6 +45,7 @@ module "cloudbuild_project" {
billing_account = var.billing_account
activate_apis = local.activate_apis
labels = var.project_labels
skip_gcloud_download = var.skip_gcloud_download
}

resource "google_project_service" "cloudbuild_apis" {
Expand Down
6 changes: 6 additions & 0 deletions modules/cloudbuild/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,9 @@ variable "terraform_version_sha256sum" {
type = string
default = "602d2529aafdaa0f605c06adb7c72cfb585d8aa19b3f4d8d189b42589e27bf11"
}

variable "skip_gcloud_download" {
description = "Whether to skip downloading gcloud (assumes gcloud is already available outside the module)"
type = bool
default = true
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,9 @@ variable "org_project_creators" {
type = list(string)
default = []
}

variable "skip_gcloud_download" {
description = "Whether to skip downloading gcloud (assumes gcloud is already available outside the module)"
type = bool
default = true
}

0 comments on commit 0e06b29

Please sign in to comment.