From 6a6b228cf5d76ef13011e3e9053bf029e101fa6d Mon Sep 17 00:00:00 2001 From: James Kwon <96548424+hongil0316@users.noreply.github.com> Date: Sun, 26 May 2024 11:41:17 -0400 Subject: [PATCH] fix git clone issue --- cloudbuild.yaml | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 68dfd57..d9e4202 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -1,38 +1,42 @@ steps: - # build the container image + # Step 1: Clone the GitHub repository + - name: "gcr.io/cloud-builders/git" + args: ["clone", "https://github.com/your-github-username/your-repo-name.git", "."] + dir: "/workspace" + + # Step 2: Build the container image - name: "gcr.io/cloud-builders/docker" args: ["build", "-t", "us-central1-docker.pkg.dev/dreamboothy/registry-backend/registry-backend-image:$SHORT_SHA", "."] - # push container image + dir: "/workspace" + + # Step 3: Push the container image - name: "gcr.io/cloud-builders/docker" args: ["push", "us-central1-docker.pkg.dev/dreamboothy/registry-backend/registry-backend-image:$SHORT_SHA"] - - # Clone the GitHub repository - - name: "gcr.io/cloud-builders/git" - args: [ "clone", "git@github.com:Comfy-Org/registry-backend.git", "." ] dir: "/workspace" - # Run database migrations for staging + # Step 4: Run database migrations for staging - name: "gcr.io/google.com/cloudsdktool/cloud-sdk" entrypoint: "bash" args: - "-c" - - | + - | curl -sSL https://atlasgo.sh | sh - atlas migrate apply --dir "file://ent/migrate/migrations" --url $$STAGING_DB_CONNECTION_STRING + atlas migrate apply --dir "file:///workspace/ent/migrate/migrations" --url $STAGING_DB_CONNECTION_STRING secretEnv: ['STAGING_DB_CONNECTION_STRING'] - dir: "/workspace/registry-backend" + dir: "/workspace" - # Publish the release + # Step 5: Publish the release - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:458.0.1' entrypoint: 'bash' args: - - '-c' - - > - gcloud deploy releases create release-registry-backend-$SHORT_SHA - --project=dreamboothy - --region=us-central1 - --delivery-pipeline=comfy-backend-api-pipeline - --images=registry-backend-image-substitute=us-central1-docker.pkg.dev/dreamboothy/registry-backend/registry-backend-image:$SHORT_SHA + - '-c' + - > + gcloud deploy releases create release-registry-backend-$SHORT_SHA + --project=dreamboothy + --region=us-central1 + --delivery-pipeline=comfy-backend-api-pipeline + --images=registry-backend-image-substitute=us-central1-docker.pkg.dev/dreamboothy/registry-backend/registry-backend-image:$SHORT_SHA + dir: "/workspace" availableSecrets: secretManager: @@ -40,4 +44,4 @@ availableSecrets: env: 'STAGING_DB_CONNECTION_STRING' options: - machineType: 'E2_HIGHCPU_8' \ No newline at end of file + machineType: 'E2_HIGHCPU_8'