Skip to content
Snippets Groups Projects
Commit e24f56b6 authored by Pierre Ozoux's avatar Pierre Ozoux
Browse files

Adds 2 missing scripts from server.

parent fea240a7
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# List instances where indie_external is not enabled
# If an app is enabled it prints the version, if not, it doesn't
for ns in `kubectl get ns --no-headers -o custom-columns=":metadata.name"`; do # Loop all Ns
po=`kubectl -n $ns get po -l app.kubernetes.io/name=nextcloud,app.kubernetes.io/component=app --no-headers -o custom-columns=":metadata.name" | head -n1` # Get the first po
if [ ! -z "$po" ]; then # if there is Nc in this Ns
if ! kubectl -n $ns exec $po -- php /usr/src/nextcloud/occ config:app:get user_saml saml-attribute-mapping-group_mapping | grep -q "groups"; then # check that our app is not activated
echo $ns # Print ns if Nc installed and app not activated
fi
fi
done
apiVersion: batch/v1
kind: Job
metadata:
labels:
application: spilo-logical-backup
job-name: restore
name: restore
spec:
backoffLimit: 6
completions: 1
parallelism: 1
selector:
matchLabels:
job-name: restore
template:
metadata:
creationTimestamp: null
labels:
application: spilo-logical-backup
job-name: restore
spec:
containers:
- command:
- /bin/sh
- -c
args:
- sleep 100000000
- aws s3 cp s3://${NS}-dumps/migrations/$(date +%m-%d-%Y).sql.gz - --endpoint-url=https://minio.k7.indie.host --region=default | unpigz | pg_restore -d nextcloud -h pg-${PG_DOMAIN} -p 5432 -U nextcloud --clean --no-owner --role=nextcloud -n public
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
key: password
name: nextcloud.pg-${NS}.credentials
- name: AWS_S3_FORCE_PATH_STYLE
value: "true"
envFrom:
- secretRef:
name: ${NS}-dumps
image: registry.opensource.zalan.do/acid/logical-backup:v1.6.2
imagePullPolicy: IfNotPresent
name: logical-backup
restartPolicy: Never
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment