Skip to content

Commit

Permalink
Build hammer in GCB
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Aug 22, 2024
1 parent 31474cd commit e325bb5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions deployment/modules/gcp/cloudbuild/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ resource "google_artifact_registry_repository" "docker" {
locals {
artifact_repo = "${var.region}-docker.pkg.dev/${var.project_id}/${google_artifact_registry_repository.docker.name}"
example_gcp_docker_image = "${local.artifact_repo}/example-gcp"
hammer_docker_image = "${local.artifact_repo}/hammer"
}

resource "google_cloudbuild_trigger" "docker" {
Expand All @@ -44,6 +45,19 @@ resource "google_cloudbuild_trigger" "docker" {

build {
step {
id = "docker_build_hammer"
name = "gcr.io/cloud-builders/docker"
args = [
"build",
"-t", "${local.hammer_docker_image}:$SHORT_SHA",
"-t", "${local.hammer_docker_image}:latest",
"-f", "./hammer/Dockerfile",
"."
]
wait_for = ["-"]
}
step {
id = "docker_build_example"
name = "gcr.io/cloud-builders/docker"
args = [
"build",
Expand All @@ -52,6 +66,7 @@ resource "google_cloudbuild_trigger" "docker" {
"-f", "./cmd/example-gcp/Dockerfile",
"."
]
wait_for = ["-"]
}
step {
name = "gcr.io/cloud-builders/docker"
Expand All @@ -60,6 +75,7 @@ resource "google_cloudbuild_trigger" "docker" {
"--all-tags",
local.example_gcp_docker_image
]
wait_for = ["docker_build_example"]
}
options {
logging = "CLOUD_LOGGING_ONLY"
Expand Down

0 comments on commit e325bb5

Please sign in to comment.