Skip to content

Commit

Permalink
(Cypress) Fix orakl-db-backup job (#244)
Browse files Browse the repository at this point in the history
* chore: Delete orakl-db-backup app

* feat: Add `cronjobs` to ArgoCD

* fix: Fix orakl-db-backup job

---------

Co-authored-by: jay-bisonai <[email protected]>
  • Loading branch information
Jay(김재훈) and jay-bisonai authored Mar 18, 2024
1 parent ba66110 commit 2e24c21
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 55 deletions.
9 changes: 5 additions & 4 deletions cronjobs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@ jobs:
concurrencyPolicy: Allow
restartPolicy: OnFailure
serviceAccount:
annotation:
annotations:
iam.gke.io/gcp-serviceaccount: "[email protected]"
command: ["/bin/bash"]
args:
- "-c"
# Step 1: Export old data to csv file.
# Step 1: Install postgresql-client
- "sudo apt -y update && sudo apt -y install postgresql-client"
# Step 2: Export old data to csv file.
- |
psql $DATABASE_URL -t -c "SELECT tablename FROM pg_tables WHERE tablename LIKE 'data_%';" \
| xargs -I {} sh -c '\
psql $DATABASE_URL -c "\copy {} to './{}.csv' WITH DELIMITER ',' CSV HEADER;" \
&& psql $DATABASE_URL -c "DROP TABLE {};"'
# Step 2: e
# Step 2: Upload all csv files to GCS bucket.
# Step 3: Upload all csv files to GCS bucket.
- "ls | grep 'csv' | xargs -I {} gcloud storage cp {} gs://orakl-db-backup-cypress"
env:
- name: DATABASE_URL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: orakl-db-backup
name: cronjobs
namespace: argocd
spec:
destination:
namespace: orakl
server: https://kubernetes.default.svc
project: default
source:
path: orakl-db-backup/
path: cronjobs/
repoURL: https://github.com/Bisonai/orakl-helm-charts.git
targetRevision: gcp-cypress-prod
syncPolicy:
automated:
prune: true
syncPolicy: {}
6 changes: 0 additions & 6 deletions orakl-db-backup/Chart.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions orakl-db-backup/templates/deployment.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions orakl-db-backup/values.yaml

This file was deleted.

0 comments on commit 2e24c21

Please sign in to comment.