-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(Cypress) Fix orakl-db-backup job (#244)
* 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
Showing
5 changed files
with
8 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
8 changes: 3 additions & 5 deletions
8
manifest/argocd/cypress/orakl-db-backup.yaml → manifest/argocd/cypress/cronjobs.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: {} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.