Skip to content

Commit

Permalink
Merge pull request #941 from airqo-platform/fix-stopPreviewAutoUpdates
Browse files Browse the repository at this point in the history
Stop preview auto updates
  • Loading branch information
Baalmart authored Nov 21, 2022
2 parents a983c4b + ab93db7 commit 281812a
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 72 deletions.
68 changes: 12 additions & 56 deletions .github/workflows/deploy-frontend-pr-previews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
branches:
- staging

env:
REGISTRY_URL: gcr.io
PROJECT_ID: airqo-250220

jobs:
branch-name:
name: Format branch name string
Expand Down Expand Up @@ -117,6 +121,8 @@ jobs:
cd netmanager/
docker build --tag ${{ secrets.REGISTRY_URL }}/${{ secrets.PROJECT_ID }}/pr-previews/netmanager-pr-previews:${{ github.sha }} ./
docker push ${{ secrets.REGISTRY_URL }}/${{ secrets.PROJECT_ID }}/pr-previews/netmanager-pr-previews:${{ github.sha }}
docker tag ${{ env.REGISTRY_URL }}/${{ env.PROJECT_ID }}/pr-previews/netmanager-pr-previews:${{ github.sha }} ${{ env.REGISTRY_URL }}/${{ env.PROJECT_ID }}/pr-previews/netmanager-pr-previews:latest
docker push ${{ env.REGISTRY_URL }}/${{ env.PROJECT_ID }}/pr-previews/netmanager-pr-previews:latest
- name: Deploy to Cloud Run
run: |-
Expand All @@ -133,20 +139,6 @@ jobs:
--command="/bin/sh","-c","cat /etc/env/.env >> /etc/environment; nginx -g 'daemon off;'" \
--allow-unauthenticated
- name: Update corresponding helm values file
uses: fjogeleit/yaml-update-action@main
with:
valueFile: "k8s/netmanager/values-dev.yaml"
updateFile: true
branch: deployment/argocd
message: "Update (dev)netmanager image for PR:${{ needs.branch-name.outputs.lowercase }}"
createPR: false
changes: |
{
"image.repository": "${{ secrets.REGISTRY_URL }}/${{ secrets.PROJECT_ID }}/pr-previews/netmanager-pr-previews",
"image.tag": "${{ github.sha }}"
}
- name: Get preview service url
id: preview-url
run: |
Expand Down Expand Up @@ -216,6 +208,8 @@ jobs:
cd calibrate/
docker build --tag ${{ secrets.REGISTRY_URL }}/${{ secrets.PROJECT_ID }}/pr-previews/calibrate-app-pr-previews:${{ github.sha }} .
docker push ${{ secrets.REGISTRY_URL }}/${{ secrets.PROJECT_ID }}/pr-previews/calibrate-app-pr-previews:${{ github.sha }}
docker tag ${{ env.REGISTRY_URL }}/${{ env.PROJECT_ID }}/pr-previews/calibrate-app-pr-previews:${{ github.sha }} ${{ env.REGISTRY_URL }}/${{ env.PROJECT_ID }}/pr-previews/calibrate-app-pr-previews:latest
docker push ${{ env.REGISTRY_URL }}/${{ env.PROJECT_ID }}/pr-previews/calibrate-app-pr-previews:latest
- name: Deploy to Cloud Run
run: |-
Expand All @@ -232,20 +226,6 @@ jobs:
--command="/bin/sh","-c","cat /etc/env/.env >> /etc/environment; nginx -g 'daemon off;'" \
--allow-unauthenticated
- name: Update corresponding helm values file
uses: fjogeleit/yaml-update-action@main
with:
valueFile: "k8s/calibrate/values-dev.yaml"
updateFile: true
branch: deployment/argocd
message: "Update (dev)calibrate app image for PR:${{ needs.branch-name.outputs.lowercase }}"
createPR: false
changes: |
{
"image.repository": "${{ secrets.REGISTRY_URL }}/${{ secrets.PROJECT_ID }}/pr-previews/calibrate-app-pr-previews",
"image.tag": "${{ github.sha }}"
}
- name: Get preview service url
id: preview-url
run: |
Expand Down Expand Up @@ -306,6 +286,8 @@ jobs:
cd platform/
docker build --tag ${{ secrets.REGISTRY_URL }}/${{ secrets.PROJECT_ID }}/pr-previews/next-platform-pr-previews:${{ github.sha }} .
docker push ${{ secrets.REGISTRY_URL }}/${{ secrets.PROJECT_ID }}/pr-previews/next-platform-pr-previews:${{ github.sha }}
docker tag ${{ env.REGISTRY_URL }}/${{ env.PROJECT_ID }}/pr-previews/next-platform-pr-previews:${{ github.sha }} ${{ env.REGISTRY_URL }}/${{ env.PROJECT_ID }}/pr-previews/next-platform-pr-previews:latest
docker push ${{ env.REGISTRY_URL }}/${{ env.PROJECT_ID }}/pr-previews/next-platform-pr-previews:latest
- name: Deploy to Cloud Run
run: |-
Expand All @@ -320,20 +302,6 @@ jobs:
--memory=256Mi \
--allow-unauthenticated
- name: Update corresponding helm values file
uses: fjogeleit/yaml-update-action@main
with:
valueFile: "k8s/platform/values-dev.yaml"
updateFile: true
branch: deployment/argocd
message: "Update (dev)next platform image for PR:${{ needs.branch-name.outputs.lowercase }}"
createPR: false
changes: |
{
"image.repository": "${{ secrets.REGISTRY_URL }}/${{ secrets.PROJECT_ID }}/pr-previews/next-platform-pr-previews",
"image.tag": "${{ github.sha }}"
}
- name: Get preview service url
id: preview-url
run: |
Expand Down Expand Up @@ -391,6 +359,8 @@ jobs:
cd docs/
docker build --tag ${{ secrets.REGISTRY_URL }}/${{ secrets.PROJECT_ID }}/pr-previews/docs-pr-previews:${{ github.sha }} .
docker push ${{ secrets.REGISTRY_URL }}/${{ secrets.PROJECT_ID }}/pr-previews/docs-pr-previews:${{ github.sha }}
docker tag ${{ env.REGISTRY_URL }}/${{ env.PROJECT_ID }}/pr-previews/docs-pr-previews:${{ github.sha }} ${{ env.REGISTRY_URL }}/${{ env.PROJECT_ID }}/pr-previews/docs-pr-previews:latest
docker push ${{ env.REGISTRY_URL }}/${{ env.PROJECT_ID }}/pr-previews/docs-pr-previews:latest
- name: Deploy to Cloud Run
run: |-
Expand All @@ -405,20 +375,6 @@ jobs:
--memory=256Mi \
--allow-unauthenticated
- name: Update corresponding helm values file
uses: fjogeleit/yaml-update-action@main
with:
valueFile: "k8s/docs/values-dev.yaml"
updateFile: true
branch: deployment/argocd
message: "Update (dev)docs app image for PR:${{ needs.branch-name.outputs.lowercase }}"
createPR: false
changes: |
{
"image.repository": "${{ secrets.REGISTRY_URL }}/${{ secrets.PROJECT_ID }}/pr-previews/docs-pr-previews",
"image.tag": "${{ github.sha }}"
}
- name: Get preview service url
id: preview-url
run: |
Expand Down
Empty file added k8s/calibrate/charts/.gitkeep
Empty file.
15 changes: 15 additions & 0 deletions k8s/calibrate/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "calibrate-app.fullname" . }}-test-connection"
labels:
{{ include "calibrate-app.labels" . | indent 4 }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "calibrate-app.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
2 changes: 1 addition & 1 deletion k8s/calibrate/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
replicaCount: 1

image:
repository: gcr.io/airqo-250220/airqo-dev-calibrate-app
repository: gcr.io/airqo-250220/pr-previews/calibrate-app-pr-previews
pullPolicy: Always
tag: latest

Expand Down
Empty file added k8s/docs/charts/.gitkeep
Empty file.
15 changes: 15 additions & 0 deletions k8s/docs/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "airqo-docs.fullname" . }}-test-connection"
labels:
{{ include "airqo-docs.labels" . | indent 4 }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "airqo-docs.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
2 changes: 1 addition & 1 deletion k8s/docs/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
replicaCount: 1

image:
repository: gcr.io/airqo-250220/airqo-dev-docs
repository: gcr.io/airqo-250220/pr-previews/docs-pr-previews
pullPolicy: Always
tag: latest

Expand Down
7 changes: 1 addition & 6 deletions k8s/docs/values-stage.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Default values for airqo-docs.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: gcr.io/airqo-250220/airqo-stage-docs
pullPolicy: Always
tag: latest
tag: stage-090ad16f-1667922055

imagePullSecrets: []
nameOverride: ""
Expand Down Expand Up @@ -53,7 +49,6 @@ autoscaling:
# targetMemoryUtilizationPercentage: 80

nodeSelector: {}

tolerations: []

affinity:
Expand Down
2 changes: 1 addition & 1 deletion k8s/netmanager/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
replicaCount: 1

image:
repository: airqo-dev-platform-frontend
repository: gcr.io/airqo-250220/pr-previews/netmanager-pr-previews
tag: latest
pullPolicy: Always

Expand Down
7 changes: 1 addition & 6 deletions k8s/netmanager/values-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,20 @@
# Declare variables to be passed into your templates.

replicaCount: 2

image:
repository: gcr.io/airqo-250220/airqo-stage-platform-frontend
tag: latest
tag: stage-45ddd0db-1667922355
pullPolicy: Always

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

service:
type: NodePort
nodePort: 31101
targetPort: 80
port: 80

ingress:
enabled: false

nodeSelector: {}
torelations: {}

Expand Down
Empty file added k8s/platform/charts/.gitkeep
Empty file.
15 changes: 15 additions & 0 deletions k8s/platform/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "platform.fullname" . }}-test-connection"
labels:
{{ include "platform.labels" . | indent 4 }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "platform.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
2 changes: 1 addition & 1 deletion k8s/platform/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
replicaCount: 1

image:
repository: gcr.io/airqo-250220/airqo-dev-next-platform
repository: gcr.io/airqo-250220/pr-previews/next-platform-pr-previews
pullPolicy: Always
tag: latest

Expand Down

0 comments on commit 281812a

Please sign in to comment.