From 4f3b68c720da8812232b0f0b3b00a91c27062735 Mon Sep 17 00:00:00 2001 From: Ariel Sosnovsky Date: Tue, 14 Nov 2023 12:26:36 -0500 Subject: [PATCH] using scrupt --- k8s/apps/videohosting/templates/sts-arrs.yaml | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/k8s/apps/videohosting/templates/sts-arrs.yaml b/k8s/apps/videohosting/templates/sts-arrs.yaml index bba2a48..258baae 100644 --- a/k8s/apps/videohosting/templates/sts-arrs.yaml +++ b/k8s/apps/videohosting/templates/sts-arrs.yaml @@ -28,8 +28,13 @@ spec: template: engineVersion: v2 data: - CONNECTION_STRING: |- - {{ `postgresql://{{.username}}:{{.password}}@{{.host}}:{{.port}}/` }}{{$k}} + {{ if $v.migrateDbFromSqllite.enabled }} + migration-sqllite-to-pg.sh: + pgloader \ + --with "quote identifiers" \ + --with "data only" \ + /data/{{$k}}.db {{ `postgresql://{{.username}}:{{.password}}@{{.host}}:{{.port}}/` }}{{$k}} + {{ end }} config.xml: |- info @@ -212,17 +217,15 @@ spec: - name: data persistentVolumeClaim: claimName: "{{ $v.migrateDbFromSqllite.claimName }}" + - name: configxml + secret: + secretName: "{{$k}}-config" containers: - name: migration image: "ghcr.io/roxedus/pgloader" command: - - pgloader - - --with - - "quote identifiers" - - --with - - "data only" - - /data/{{$k}}.db - - $CONNECTION_STRING + - sh + - /configxml/migration-sqllite-to-pg.sh volumeMounts: - mountPath: /app name: tffiles @@ -235,5 +238,7 @@ spec: volumeMounts: - mountPath: "/data" name: data + - name: configxml + mountPath: /configxml {{ end }} {{ end }}