Skip to content

Commit

Permalink
fix: use registry modules in standalone_single_project example (#33)
Browse files Browse the repository at this point in the history
* replace relative module ref with upstream registry
* add module-swapper in build pipeline
  • Loading branch information
gtsorbo authored Oct 11, 2022
1 parent df509c5 commit 1c032cc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

timeout: 3600s
steps:
- id: swap-module-refs
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && module-swapper']
- id: prepare
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && prepare_environment && sleep 120']
Expand Down
13 changes: 8 additions & 5 deletions examples/standalone_single_project/cicd.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ locals {

# Secure-CI
module "ci_pipeline" {
source = "../../modules/secure-ci"
source = "GoogleCloudPlatform/secure-cicd/google//modules/secure-ci"
version = "0.2.0"

project_id = var.project_id
app_source_repo = "${var.app_name}-source"
cloudbuild_cd_repo = "${var.app_name}-cloudbuild-cd-config"
Expand All @@ -68,7 +70,9 @@ module "ci_pipeline" {

# Secure-CD
module "cd_pipeline" {
source = "../../modules/secure-cd"
source = "GoogleCloudPlatform/secure-cicd/google//modules/secure-cd"
version = "0.2.0"

project_id = var.project_id
primary_location = var.region

Expand All @@ -86,7 +90,8 @@ module "cd_pipeline" {

# Cloud Build Private Pool
module "cloudbuild_private_pool" {
source = "../../modules/cloudbuild-private-pool"
source = "GoogleCloudPlatform/secure-cicd/google//modules/cloudbuild-private-pool"
version = "0.2.0"

project_id = var.project_id
network_project_id = var.project_id
Expand All @@ -99,5 +104,3 @@ module "cloudbuild_private_pool" {
worker_address = "10.39.0.0"
worker_range_name = "cloudbuild-worker-range"
}


3 changes: 2 additions & 1 deletion examples/standalone_single_project/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ resource "google_compute_network_peering_routes_config" "gke_peering_routes_conf

# Cloud Build Workerpool <-> GKE HA VPNs
module "gke_cloudbuild_vpn" {
source = "../../modules/workerpool-gke-ha-vpn"
source = "GoogleCloudPlatform/secure-cicd/google//modules/workerpool-gke-ha-vpn"
version = "0.2.0"

project_id = var.project_id
location = var.region
Expand Down

0 comments on commit 1c032cc

Please sign in to comment.