Skip to content

Commit

Permalink
added a google deploy pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioformosa committed Jul 15, 2024
1 parent 8ba33f2 commit 4d5e8f6
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.
23 changes: 22 additions & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,31 @@ steps:
sed -i s/_HELM_CHART_VERSION/0.0.0/g ./quartz-manager-parent/quartz-manager-web-showcase/helm/Chart.yaml
sed -i s/_HELM_APP_VERSION/$SHORT_SHA/g ./quartz-manager-parent/quartz-manager-web-showcase/helm/Chart.yaml
sed -i s/_HELM_CHART_NAME/quartzmanager-standalone/g skaffold.yaml
sed -i s/_HELM_NAMESPACE/quartzmanager/g skaffold.yaml
sed -i s/_HELM_NAMESPACE/quartzmanager-dev/g skaffold.yaml
skaffold build --file-output=/workspace/artifacts.json \
--default-repo=${_REGION}-docker.pkg.dev/quartz-manager-test/quartz-manager/quartz-manager-standalone \
--push=true
# Step 2: deploy
- name: 'google/cloud-sdk:latest'
entrypoint: 'sh'
args:
- -xe
- -c
- |
gcloud config set deploy/region ${_REGION}
gcloud deploy apply --file deploy/pipeline.yaml
gcloud deploy apply --file deploy/dev.yaml
gcloud deploy releases create rel-${SHORT_SHA} \
--delivery-pipeline quartz-manager-standalone-pipeline \
--description "$(git log -1 --pretty='%s')" \
--build-artifacts /workspace/artifacts.json \
--annotations "commit_ui=https://source.cloud.google.com/$PROJECT_ID/quartz-manager-standalone/+/$COMMIT_SHA"
artifacts:
objects:
location: 'gs://$PROJECT_ID-gcdeploy-artifacts/'
paths:
- '/workspace/artifacts.json'

options:
logging: CLOUD_LOGGING_ONLY
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: deploy.cloud.google.com/v1
kind: Target
metadata:
name: dev
annotations: {}
labels: {}
description: dev
gke:
cluster: projects/quartz-manager-test/locations/europe-west8/clusters/gke-cluster
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: deploy.cloud.google.com/v1
kind: DeliveryPipeline
metadata:
name: quartz-manager-pipeline
labels:
app: quartz-manager-standalone
description: quartz-manager-standalone delivery pipeline
serialPipeline:
stages:
- targetId: dev
profiles:
- dev
13 changes: 13 additions & 0 deletions skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,16 @@ build:
artifacts:
- image: quartz-manager-standalone
context: ./
profiles:
- name: dev
deploy:
helm:
releases:
- name: _HELM_CHART_NAME
createNamespace: true
namespace: _HELM_NAMESPACE
chartPath: quartz-manager-parent/quartz-manager-web-showcase/helm/hello-world
# valuesFiles:
# - helm/envs/dev/values.yaml
setValueTemplates:
image.tag: "_IMAGE_TAG_POLICY"

0 comments on commit 4d5e8f6

Please sign in to comment.