diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 7ef55ba..37faf42 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -1,42 +1,38 @@ steps: - # 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 + # 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", "."] - dir: "/workspace" - - # Step 3: Push the container image + # push 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", "registry-backend" ] dir: "/workspace" - # Step 4: Run database migrations for staging + # 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:///workspace/ent/migrate/migrations" --url $$STAGING_DB_CONNECTION_STRING + atlas migrate apply --dir "file://ent/migrate/migrations" --url $$STAGING_DB_CONNECTION_STRING secretEnv: ['STAGING_DB_CONNECTION_STRING'] - dir: "/workspace" + dir: "/workspace/registry-backend" - # Step 5: Publish the release + # 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 - dir: "/workspace" + - '-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 availableSecrets: secretManager: @@ -44,4 +40,4 @@ availableSecrets: env: 'STAGING_DB_CONNECTION_STRING' options: - machineType: 'E2_HIGHCPU_8' + machineType: 'E2_HIGHCPU_8' \ No newline at end of file