Skip to content

Commit

Permalink
feat: adds project as a deployment param
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Jan 6, 2025
1 parent 3bf3922 commit 141f6a4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions internal/cmd/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package utils

import (
"fmt"
"internal/apiclient"
"io"
"os"
"runtime/debug"
Expand Down Expand Up @@ -110,6 +111,8 @@ metadata:
name: %s-env
customTarget:
customTargetType: appint-%s-target
deployParameters:
APP_INTEGRATION_PROJECT_ID: "%s"
---
apiVersion: deploy.cloud.google.com/v1
Expand Down Expand Up @@ -154,7 +157,7 @@ customActions:
args:
- '-c'
- |-
integrationcli integrations apply --env=dev --reg=$CLOUD_DEPLOY_LOCATION --proj=$CLOUD_DEPLOY_PROJECT --pipeline=$CLOUD_DEPLOY_DELIVERY_PIPELINE --release=$CLOUD_DEPLOY_OUTPUT_GCS_PATH --output-gcs-path=$CLOUD_DEPLOY_TARGET --metadata-token`
integrationcli integrations apply --env=dev --reg=$CLOUD_DEPLOY_LOCATION --proj=$APP_INTEGRATION_PROJECT_ID --pipeline=$CLOUD_DEPLOY_DELIVERY_PIPELINE --release=$CLOUD_DEPLOY_OUTPUT_GCS_PATH --output-gcs-path=$CLOUD_DEPLOY_TARGET --metadata-token`

var githubActionApply = `# Copyright 2025 Google LLC
#
Expand Down Expand Up @@ -226,7 +229,7 @@ func GetCloudDeployYaml(integrationName string, env string) string {
if env == "" {
env = "dev"
}
return fmt.Sprintf(cloudDeploy, integrationName, env, env, integrationName, integrationName)
return fmt.Sprintf(cloudDeploy, integrationName, env, env, integrationName, apiclient.GetProjectID(), integrationName)
}

func GetSkaffoldYaml(integrationName string) string {
Expand Down
4 changes: 3 additions & 1 deletion samples/scaffold-sample/clouddeploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ metadata:
name: dev-env
customTarget:
customTargetType: appint-sample-target
deployParameters:
APP_INTEGRATION_PROJECT_ID: "sample-project"
---

apiVersion: deploy.cloud.google.com/v1
Expand All @@ -35,4 +37,4 @@ metadata:
name: appint-sample-target
customActions:
renderAction: render-app-integration
deployAction: deploy-app-integration
deployAction: deploy-app-integration
2 changes: 1 addition & 1 deletion samples/scaffold-sample/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ customActions:
args:
- '-c'
- |-
integrationcli integrations apply --env=dev --reg=$CLOUD_DEPLOY_LOCATION --proj=$CLOUD_DEPLOY_PROJECT --pipeline=$CLOUD_DEPLOY_DELIVERY_PIPELINE --release=$CLOUD_DEPLOY_RELEASE --output-gcs-path=$CLOUD_DEPLOY_OUTPUT_GCS_PATH --metadata-token
integrationcli integrations apply --env=dev --reg=$CLOUD_DEPLOY_LOCATION --proj=$APP_INTEGRATION_PROJECT_ID --pipeline=$CLOUD_DEPLOY_DELIVERY_PIPELINE --release=$CLOUD_DEPLOY_RELEASE --output-gcs-path=$CLOUD_DEPLOY_OUTPUT_GCS_PATH --metadata-token

0 comments on commit 141f6a4

Please sign in to comment.