Skip to content

Commit 1add187

Browse files
committed
cicd:move to new cluster
1 parent 6f523c4 commit 1add187

File tree

2 files changed

+74
-75
lines changed

2 files changed

+74
-75
lines changed

.deploy/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ spec:
1818
image: __GOOGLE_ARTIFACT_URL__/__GOOGLE_PROJECT_ID__/__GOOGLE_ARTIFACT_REPO__/vault-service:__LATEST_RELEASE_TAG__
1919
resources:
2020
limits:
21-
memory: "3Gi"
21+
memory: "6Gi"
2222
cpu: "4000m"
2323
requests:
24-
memory: "2Gi"
24+
memory: "4Gi"
2525
cpu: "2500m"
2626
ports:
2727
- containerPort: __PORT__

.github/workflows/image-publish.yaml

Lines changed: 72 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -3,96 +3,95 @@ name: Vault Service Build and Deploy Pipeline
33
on:
44
push:
55
tags:
6-
- "[0-9]+.[0-9]+.[0-9]+"
7-
- "[0-9]+.[0-9]+.[0-9]-rc.[0-9]+"
6+
- "[0-9]+.[0-9]+.[0-9]+"
7+
- "[0-9]+.[0-9]+.[0-9]-rc.[0-9]+"
88

99
jobs:
1010
Build:
1111
runs-on: ubuntu-latest
1212
environment: production
1313
steps:
14-
- name: code checkout
15-
uses: actions/checkout@v3
16-
- name: Set Latest Tag
17-
run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
14+
- name: code checkout
15+
uses: actions/checkout@v3
16+
- name: Set Latest Tag
17+
run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
1818

19-
- id: "auth"
20-
uses: "google-github-actions/auth@v1"
21-
with:
22-
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}"
19+
- id: "auth"
20+
uses: "google-github-actions/auth@v1"
21+
with:
22+
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}"
2323

24-
- name: install gcloud cli tools
25-
uses: google-github-actions/setup-gcloud@v1
26-
with:
27-
project_id: ${{secrets.GOOGLE_PROJECT_ID}}
28-
service_account_key: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
29-
install_components: "gke-gcloud-auth-plugin"
30-
export_default_credentials: true
31-
- name: "Use gcloud CLI"
32-
run: "gcloud info"
24+
- name: install gcloud cli tools
25+
uses: google-github-actions/setup-gcloud@v1
26+
with:
27+
project_id: ${{secrets.GOOGLE_PROJECT_ID}}
28+
service_account_key: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
29+
install_components: "gke-gcloud-auth-plugin"
30+
export_default_credentials: true
31+
- name: "Use gcloud CLI"
32+
run: "gcloud info"
3333

34-
- name: "Docker Auth"
35-
run: gcloud auth configure-docker asia-south1-docker.pkg.dev
34+
- name: "Docker Auth"
35+
run: gcloud auth configure-docker asia-south1-docker.pkg.dev
3636

37-
- name: "Docker Build and Push"
38-
env:
39-
GOOGLE_PROJECT_ID: ${{secrets.GOOGLE_PROJECT_ID}}
40-
GOOGLE_ARTIFACT_URL: ${{secrets.GOOGLE_ARTIFACT_URL}}
41-
GOOGLE_ARTIFACT_REPO: ${{secrets.GOOGLE_ARTIFACT_REPO}}
42-
run:
43-
docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/vault-service:${{ env.LATEST_RELEASE_TAG }} .
37+
- name: "Docker Build and Push"
38+
env:
39+
GOOGLE_PROJECT_ID: ${{secrets.GOOGLE_PROJECT_ID}}
40+
GOOGLE_ARTIFACT_URL: ${{secrets.GOOGLE_ARTIFACT_URL}}
41+
GOOGLE_ARTIFACT_REPO: ${{secrets.GOOGLE_ARTIFACT_REPO}}
42+
run: docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/vault-service:${{ env.LATEST_RELEASE_TAG }} .
4443

45-
docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/vault-service:${{ env.LATEST_RELEASE_TAG }}
44+
docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/vault-service:${{ env.LATEST_RELEASE_TAG }}
4645

4746
Deploy:
48-
needs: [Build]
47+
needs: [ Build ]
4948
runs-on: ubuntu-latest
5049
environment: production
5150
steps:
52-
- name: code checkout
53-
uses: actions/checkout@v3
54-
- name: Set Latest Tag
55-
run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
51+
- name: code checkout
52+
uses: actions/checkout@v3
53+
- name: Set Latest Tag
54+
run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
5655

57-
- id: "auth"
58-
uses: "google-github-actions/auth@v1"
59-
with:
60-
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}"
61-
- name: install gcloud cli tools
62-
uses: google-github-actions/setup-gcloud@v1
63-
with:
64-
project_id: ${{secrets.GOOGLE_PROJECT_ID}}
65-
service_account_key: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
66-
install_components: "gke-gcloud-auth-plugin"
67-
export_default_credentials: true
68-
- name: "Configure kubectl"
69-
run: gcloud container clusters get-credentials hypermine-gke --region=asia-south1
70-
- name: Replace tags
71-
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__LATEST_RELEASE_TAG__#${{ env.LATEST_RELEASE_TAG }}#" {} \;
56+
- id: "auth"
57+
uses: "google-github-actions/auth@v1"
58+
with:
59+
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}"
60+
- name: install gcloud cli tools
61+
uses: google-github-actions/setup-gcloud@v1
62+
with:
63+
project_id: ${{secrets.GOOGLE_PROJECT_ID}}
64+
service_account_key: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
65+
install_components: "gke-gcloud-auth-plugin"
66+
export_default_credentials: true
67+
- name: "Configure kubectl"
68+
run: gcloud container clusters get-credentials hypermine-gke-manual --region=asia-south1
69+
- name: Replace tags
70+
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__LATEST_RELEASE_TAG__#${{ env.LATEST_RELEASE_TAG }}#" {} \;
7271

73-
- name: "Replace secrets"
74-
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__PORT__/${{ secrets.PORT }}/g'' {} \;
75-
- name: "Replace secrets"
76-
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__HOST__/${{ secrets.HOST }}/g'' {} \;
77-
- name: "Replace secrets"
78-
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__ABSOLUTE_URL__/${{ secrets.ABSOLUTE_URL }}/g'' {} \;
79-
- name: "Replace secrets"
80-
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__DATA_VAULT__/${{ secrets.DATA_VAULT }}/g'' {} \;
81-
- name: "Replace secrets"
82-
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__DB_URL__#${{ secrets.DB_URL }}#" {} \;
83-
- name: "Replace secrets"
84-
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__DB_CONFIG__#${{ secrets.DB_CONFIG }}#" {} \;
85-
- name: "Replace secrets"
86-
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__LOG_LEVEL__#${{ secrets.LOG_LEVEL }}#" {} \;
72+
- name: "Replace secrets"
73+
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__PORT__/${{ secrets.PORT }}/g'' {} \;
74+
- name: "Replace secrets"
75+
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__HOST__/${{ secrets.HOST }}/g'' {} \;
76+
- name: "Replace secrets"
77+
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__ABSOLUTE_URL__/${{ secrets.ABSOLUTE_URL }}/g'' {} \;
78+
- name: "Replace secrets"
79+
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__DATA_VAULT__/${{ secrets.DATA_VAULT }}/g'' {} \;
80+
- name: "Replace secrets"
81+
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__DB_URL__#${{ secrets.DB_URL }}#" {} \;
82+
- name: "Replace secrets"
83+
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__DB_CONFIG__#${{ secrets.DB_CONFIG }}#" {} \;
84+
- name: "Replace secrets"
85+
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__LOG_LEVEL__#${{ secrets.LOG_LEVEL }}#" {} \;
8786

88-
- name: "Replace secrets"
89-
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__SSL__/${{ secrets.SSL }}/g'' {} \;
90-
- name: "Replace secrets"
91-
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_URL__/${{ secrets.GOOGLE_ARTIFACT_URL }}/g'' {} \;
92-
- name: "Replace secrets"
93-
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_REPO__/${{ secrets.GOOGLE_ARTIFACT_REPO }}/g'' {} \;
94-
- name: "Replace secrets"
95-
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_PROJECT_ID__/${{ secrets.GOOGLE_PROJECT_ID }}/g'' {} \;
87+
- name: "Replace secrets"
88+
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__SSL__/${{ secrets.SSL }}/g'' {} \;
89+
- name: "Replace secrets"
90+
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_URL__/${{ secrets.GOOGLE_ARTIFACT_URL }}/g'' {} \;
91+
- name: "Replace secrets"
92+
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_REPO__/${{ secrets.GOOGLE_ARTIFACT_REPO }}/g'' {} \;
93+
- name: "Replace secrets"
94+
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_PROJECT_ID__/${{ secrets.GOOGLE_PROJECT_ID }}/g'' {} \;
9695

97-
- name: "Deploy to GKE"
98-
run: kubectl apply -f .deploy/deployment.yaml
96+
- name: "Deploy to GKE"
97+
run: kubectl apply -f .deploy/deployment.yaml

0 commit comments

Comments
 (0)