Skip to content

Commit

Permalink
Warmup test
Browse files Browse the repository at this point in the history
  • Loading branch information
romanini-ciandt committed Oct 24, 2024
1 parent 3da389f commit 250e8ec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ resource "null_resource" "pkcs11_docker_image_build_template" {
provisioner "local-exec" {
when = create
command = <<EOF
gcloud builds submit --project=${var.project_id} --config=${path.module}/cloudbuild.yaml --impersonate-service-account=${local.custom_sa_email} --substitutions=_LOCATION="${var.artifact_location}",_REPOSITORY="${var.artifact_repository}-${local.default_suffix}",_IMAGE="${var.artifact_image}",_VERSION="${var.artifact_version}",_KMS_KEYRING="${var.keyring}-${local.default_suffix}",_KMS_KEY="${var.key}-${local.default_suffix}",_KMS_LOCATION="${var.location}",_PKCS11_LIB_VERSION="${var.pkcs11_lib_version}",_SERVICE_ACCOUNT="${local.custom_sa_email}",_CERTIFICATE_FILE="${local.certificate_file_string}",_DIGEST_FLAG="${var.digest_flag}",_CERTIFICATE_NAME="${var.certificate_name}" ${var.docker_file_path} || sleep 45 &&
gcloud builds submit --project=${var.project_id} --config=${path.module}/cloudbuild.yaml --impersonate-service-account=${local.custom_sa_email} --substitutions=_LOCATION="${var.artifact_location}",_REPOSITORY="${var.artifact_repository}-${local.default_suffix}",_IMAGE="${var.artifact_image}",_VERSION="${var.artifact_version}",_KMS_KEYRING="${var.keyring}-${local.default_suffix}",_KMS_KEY="${var.key}-${local.default_suffix}",_KMS_LOCATION="${var.location}",_PKCS11_LIB_VERSION="${var.pkcs11_lib_version}",_SERVICE_ACCOUNT="${local.custom_sa_email}",_CERTIFICATE_FILE="${local.certificate_file_string}",_DIGEST_FLAG="${var.digest_flag}",_CERTIFICATE_NAME="${var.certificate_name}" ${var.docker_file_path}
EOF
}
Expand Down
3 changes: 3 additions & 0 deletions test/setup/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Dockerfile
FROM alpine:latest
CMD echo "Hello World"
13 changes: 13 additions & 0 deletions test/setup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,16 @@ resource "terracurl_request" "poke" {
]
}
}


resource "null_resource" "cb_warmup" {

triggers = {
project_id = module.project_ci_kms.project_id
}

provisioner "local-exec" {
when = create
command = "gcloud builds submit --tag gcr.io/${module.project_ci_kms.project_id}/hello-world ."
}
}

0 comments on commit 250e8ec

Please sign in to comment.