diff --git a/golang-sample/cloudbuild.yaml b/golang-sample/cloudbuild.yaml index c35095d1..5013d0c3 100644 --- a/golang-sample/cloudbuild.yaml +++ b/golang-sample/cloudbuild.yaml @@ -28,20 +28,20 @@ steps: # Docker Build - name: 'gcr.io/cloud-builders/docker' args: ['build', '-t', - 'us-central1-docker.pkg.dev/$PROJECT_ID/$_REPO_NAME/myimage:$SHORT_SHA', '.'] + 'us-central1-docker.pkg.dev/$PROJECT_ID/$_AR_REPO_NAME/myimage:$SHORT_SHA', '.'] # [END cloudbuild_go_image_yaml] # [START cloudbuild_go_push_yaml] # Docker push to Google Artifact Registry - name: 'gcr.io/cloud-builders/docker' - args: ['push', 'us-central1-docker.pkg.dev/$PROJECT_ID/$_REPO_NAME/myimage:$SHORT_SHA'] + args: ['push', 'us-central1-docker.pkg.dev/$PROJECT_ID/$_AR_REPO_NAME/myimage:$SHORT_SHA'] # [END cloudbuild_go_push_yaml] # [START cloudbuild_go_deploy_yaml] # Deploy to Cloud Run - name: 'gcr.io/cloud-builders/gcloud' args: ['run', 'deploy', 'helloworld-${SHORT_SHA}', - '--image=us-central1-docker.pkg.dev/$PROJECT_ID/$_REPO_NAME/myimage:$SHORT_SHA', + '--image=us-central1-docker.pkg.dev/$PROJECT_ID/$_AR_REPO_NAME/myimage:$SHORT_SHA', '--region', 'us-central1', '--platform', 'managed'] # [END cloudbuild_go_deploy_yaml] @@ -55,5 +55,5 @@ artifacts: # [END cloudbuild_go_logs_yaml] # Store images in Google Artifact Registry images: - - us-central1-docker.pkg.dev/$PROJECT_ID/$_REPO_NAME/myimage:$SHORT_SHA + - us-central1-docker.pkg.dev/$PROJECT_ID/$_AR_REPO_NAME/myimage:$SHORT_SHA # [END cloudbuild_go_yaml] diff --git a/golang-sample/test.cloudbuild.yaml b/golang-sample/test.cloudbuild.yaml index 5115dd42..e8ec907e 100644 --- a/golang-sample/test.cloudbuild.yaml +++ b/golang-sample/test.cloudbuild.yaml @@ -7,7 +7,7 @@ steps: - '-c' - | gcloud builds submit --config cloudbuild.yaml \ - --substitutions SHORT_SHA=${SHORT_SHA},_REPO_NAME=${_REPO_NAME},_BUCKET_NAME=${_BUCKET_NAME} + --substitutions SHORT_SHA=${SHORT_SHA},_AR_REPO_NAME=${_AR_REPO_NAME},_BUCKET_NAME=${_BUCKET_NAME} - id: cleanup name: gcr.io/google.com/cloudsdktool/cloud-sdk @@ -16,5 +16,5 @@ steps: - '-c' - | gsutil rm gs://${_BUCKET_NAME}/${SHORT_SHA}_test_log.xml - gcloud artifacts docker images delete us-central1-docker.pkg.dev/${PROJECT_ID}/${_REPO_NAME}/myimage:${SHORT_SHA} + gcloud artifacts docker images delete us-central1-docker.pkg.dev/${PROJECT_ID}/${_AR_REPO_NAME}/myimage:${SHORT_SHA} gcloud run services delete helloworld-${SHORT_SHA} --region us-central1 --quiet