Skip to content

Commit 4d5e8f6

Browse files
committed
added a google deploy pipeline
1 parent 8ba33f2 commit 4d5e8f6

File tree

4 files changed

+56
-1
lines changed

4 files changed

+56
-1
lines changed

cloudbuild.yaml

+22-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,31 @@ steps:
1414
sed -i s/_HELM_CHART_VERSION/0.0.0/g ./quartz-manager-parent/quartz-manager-web-showcase/helm/Chart.yaml
1515
sed -i s/_HELM_APP_VERSION/$SHORT_SHA/g ./quartz-manager-parent/quartz-manager-web-showcase/helm/Chart.yaml
1616
sed -i s/_HELM_CHART_NAME/quartzmanager-standalone/g skaffold.yaml
17-
sed -i s/_HELM_NAMESPACE/quartzmanager/g skaffold.yaml
17+
sed -i s/_HELM_NAMESPACE/quartzmanager-dev/g skaffold.yaml
1818
skaffold build --file-output=/workspace/artifacts.json \
1919
--default-repo=${_REGION}-docker.pkg.dev/quartz-manager-test/quartz-manager/quartz-manager-standalone \
2020
--push=true
2121
22+
# Step 2: deploy
23+
- name: 'google/cloud-sdk:latest'
24+
entrypoint: 'sh'
25+
args:
26+
- -xe
27+
- -c
28+
- |
29+
gcloud config set deploy/region ${_REGION}
30+
gcloud deploy apply --file deploy/pipeline.yaml
31+
gcloud deploy apply --file deploy/dev.yaml
32+
gcloud deploy releases create rel-${SHORT_SHA} \
33+
--delivery-pipeline quartz-manager-standalone-pipeline \
34+
--description "$(git log -1 --pretty='%s')" \
35+
--build-artifacts /workspace/artifacts.json \
36+
--annotations "commit_ui=https://source.cloud.google.com/$PROJECT_ID/quartz-manager-standalone/+/$COMMIT_SHA"
37+
artifacts:
38+
objects:
39+
location: 'gs://$PROJECT_ID-gcdeploy-artifacts/'
40+
paths:
41+
- '/workspace/artifacts.json'
42+
2243
options:
2344
logging: CLOUD_LOGGING_ONLY
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: deploy.cloud.google.com/v1
2+
kind: Target
3+
metadata:
4+
name: dev
5+
annotations: {}
6+
labels: {}
7+
description: dev
8+
gke:
9+
cluster: projects/quartz-manager-test/locations/europe-west8/clusters/gke-cluster
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: deploy.cloud.google.com/v1
2+
kind: DeliveryPipeline
3+
metadata:
4+
name: quartz-manager-pipeline
5+
labels:
6+
app: quartz-manager-standalone
7+
description: quartz-manager-standalone delivery pipeline
8+
serialPipeline:
9+
stages:
10+
- targetId: dev
11+
profiles:
12+
- dev

skaffold.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,16 @@ build:
77
artifacts:
88
- image: quartz-manager-standalone
99
context: ./
10+
profiles:
11+
- name: dev
12+
deploy:
13+
helm:
14+
releases:
15+
- name: _HELM_CHART_NAME
16+
createNamespace: true
17+
namespace: _HELM_NAMESPACE
18+
chartPath: quartz-manager-parent/quartz-manager-web-showcase/helm/hello-world
19+
# valuesFiles:
20+
# - helm/envs/dev/values.yaml
21+
setValueTemplates:
22+
image.tag: "_IMAGE_TAG_POLICY"

0 commit comments

Comments
 (0)