produciton env
This commit is contained in:
parent
fa6b871087
commit
ce2f993f77
3 changed files with 3 additions and 85 deletions
6
.github/workflows/deploy-postgres-prod.yml
vendored
6
.github/workflows/deploy-postgres-prod.yml
vendored
|
|
@ -33,13 +33,13 @@ jobs:
|
||||||
kubectl config use-context runner-context
|
kubectl config use-context runner-context
|
||||||
|
|
||||||
- name: Apply PROD secrets
|
- name: Apply PROD secrets
|
||||||
run: kubectl apply -f db/k8s/prod/secrets/
|
run: kubectl apply -f db/k8s/secrets/
|
||||||
|
|
||||||
- name: Deploy PROD Postgres
|
- name: Deploy PROD Postgres
|
||||||
run: kubectl apply -f db/k8s/prod/postgres/
|
run: kubectl apply -f db/k8s/postgres/
|
||||||
|
|
||||||
- name: Deploy PROD backups
|
- name: Deploy PROD backups
|
||||||
run: kubectl apply -f db/k8s/prod/backups/
|
run: kubectl apply -f db/k8s/backups/
|
||||||
|
|
||||||
migrate:
|
migrate:
|
||||||
runs-on: mealcraft-runners
|
runs-on: mealcraft-runners
|
||||||
|
|
|
||||||
61
.github/workflows/deploy-postgres.yml
vendored
61
.github/workflows/deploy-postgres.yml
vendored
|
|
@ -1,61 +0,0 @@
|
||||||
name: Deploy DEV DB Infrastructure
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "feature/*"
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: mealcraft-runners
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install kubectl
|
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y curl ca-certificates
|
|
||||||
curl -LO "https://dl.k8s.io/release/$(curl -sL https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
|
||||||
sudo install -m 0755 kubectl /usr/local/bin/kubectl
|
|
||||||
|
|
||||||
- name: Configure kubeconfig (in-cluster)
|
|
||||||
run: |
|
|
||||||
KUBE_HOST="https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT"
|
|
||||||
SA_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
|
|
||||||
CA_CERT=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
||||||
NAMESPACE=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)
|
|
||||||
|
|
||||||
kubectl config set-cluster microk8s --server="$KUBE_HOST" --certificate-authority="$CA_CERT"
|
|
||||||
kubectl config set-credentials runner --token="$SA_TOKEN"
|
|
||||||
kubectl config set-context runner-context --cluster=microk8s --user=runner --namespace="$NAMESPACE"
|
|
||||||
kubectl config use-context runner-context
|
|
||||||
|
|
||||||
- name: Apply DEV secrets
|
|
||||||
run: kubectl apply -f db/k8s/secrets/
|
|
||||||
|
|
||||||
- name: Deploy DEV Postgres
|
|
||||||
run: kubectl apply -f db/k8s/postgres/postgres-dev-stripe-to-invoice.yaml
|
|
||||||
|
|
||||||
migrate:
|
|
||||||
runs-on: mealcraft-runners
|
|
||||||
needs: deploy
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install Atlas
|
|
||||||
run: curl -sSf https://atlasgo.sh | sh
|
|
||||||
|
|
||||||
- name: Load DEV DB creds
|
|
||||||
run: |
|
|
||||||
export POSTGRES_USER=$(kubectl get secret postgres-secret -o jsonpath='{.data.POSTGRES_USER}' | base64 -d)
|
|
||||||
export POSTGRES_PASSWORD=$(kubectl get secret postgres-secret -o jsonpath='{.data.POSTGRES_PASSWORD}' | base64 -d)
|
|
||||||
|
|
||||||
echo "POSTGRES_USER=$POSTGRES_USER" >> $GITHUB_ENV
|
|
||||||
echo "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Run Atlas migrations (DEV)
|
|
||||||
run: |
|
|
||||||
atlas migrate apply \
|
|
||||||
--config file://./db/atlas/atlas.hcl \
|
|
||||||
--env stripe_invoice_dev
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name: postgres-secret
|
|
||||||
namespace: arc-systems
|
|
||||||
type: Opaque
|
|
||||||
stringData:
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
POSTGRES_PASSWORD: averysecretpasswordPersonAppleWinter938
|
|
||||||
POSTGRES_DB: stripe_invoice
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name: postgres-secret
|
|
||||||
namespace: arc-systems
|
|
||||||
type: Opaque
|
|
||||||
stringData:
|
|
||||||
POSTGRES_USER: postgres
|
|
||||||
POSTGRES_PASSWORD: averysecretpasswordPersonAppleWinter938
|
|
||||||
POSTGRES_DB: stripe_invoice
|
|
||||||
Loading…
Add table
Reference in a new issue