mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Merge branch 'master' into 6013-change-benutzer-to-nutzer
This commit is contained in:
commit
59525ae373
@ -65,7 +65,6 @@ Factory.define('basicUser')
|
||||
name: faker.name.findName,
|
||||
password: '1234',
|
||||
role: 'user',
|
||||
about: faker.lorem.paragraph,
|
||||
termsAndConditionsAgreedVersion: '0.0.1',
|
||||
termsAndConditionsAgreedAt: '2019-08-01T10:47:19.212Z',
|
||||
allowEmbedIframes: false,
|
||||
@ -82,12 +81,28 @@ Factory.define('basicUser')
|
||||
|
||||
Factory.define('userWithoutEmailAddress')
|
||||
.extend('basicUser')
|
||||
.option('about', faker.lorem.paragraph)
|
||||
.after(async (buildObject, options) => {
|
||||
return neode.create('User', buildObject)
|
||||
})
|
||||
|
||||
Factory.define('userWithAboutNull')
|
||||
.extend('basicUser')
|
||||
.option('about', null)
|
||||
.after(async (buildObject, options) => {
|
||||
return neode.create('User', buildObject)
|
||||
})
|
||||
|
||||
Factory.define('userWithAboutEmpty')
|
||||
.extend('basicUser')
|
||||
.option('about', '')
|
||||
.after(async (buildObject, options) => {
|
||||
return neode.create('User', buildObject)
|
||||
})
|
||||
|
||||
Factory.define('user')
|
||||
.extend('basicUser')
|
||||
.option('about', faker.lorem.paragraph)
|
||||
.option('email', faker.internet.exampleEmail)
|
||||
.option('avatar', () =>
|
||||
Factory.build('image', {
|
||||
|
||||
47
deployment/scripts/cluster.backup.sh
Executable file
47
deployment/scripts/cluster.backup.sh
Executable file
@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
# base setup
|
||||
SCRIPT_PATH=$(realpath $0)
|
||||
SCRIPT_DIR=$(dirname $SCRIPT_PATH)
|
||||
|
||||
# configuration
|
||||
CONFIGURATION=${CONFIGURATION:-"example"}
|
||||
KUBECONFIG=${KUBECONFIG:-${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubeconfig.yaml}
|
||||
BACKUP_DATE=$(date "+%F_%H-%M-%S")
|
||||
BACKUP_FOLDER=${BACKUP_FOLDER:-${SCRIPT_DIR}/../configurations/${CONFIGURATION}/backup/${BACKUP_DATE}}
|
||||
|
||||
# create backup fodler
|
||||
mkdir -p ${BACKUP_FOLDER}
|
||||
|
||||
# maintenance mode on
|
||||
${SCRIPT_DIR}/cluster.maintenance.sh on
|
||||
|
||||
# shutdown database
|
||||
kubectl --kubeconfig=${KUBECONFIG} get deployment ocelot-neo4j -o json \
|
||||
| jq '.spec.template.spec.containers[] += {"command": ["tail", "-f", "/dev/null"]}' \
|
||||
| kubectl --kubeconfig=${KUBECONFIG} apply -f -
|
||||
|
||||
# wait for the container to restart
|
||||
sleep 60
|
||||
|
||||
# database backup
|
||||
kubectl --kubeconfig=${KUBECONFIG} -n default exec -it \
|
||||
$(kubectl --kubeconfig=${KUBECONFIG} -n default get pods | grep ocelot-neo4j | awk '{ print $1 }') \
|
||||
-- neo4j-admin dump --to=/var/lib/neo4j/$BACKUP_DATE-neo4j-dump
|
||||
# copy neo4j backup to local drive
|
||||
kubectl --kubeconfig=${KUBECONFIG} cp \
|
||||
default/$(kubectl --kubeconfig=${KUBECONFIG} -n default get pods | grep ocelot-neo4j |awk '{ print $1 }'):/var/lib/neo4j/$BACKUP_DATE-neo4j-dump $BACKUP_FOLDER/neo4j-dump
|
||||
# copy image data
|
||||
kubectl --kubeconfig=${KUBECONFIG} cp \
|
||||
default/$(kubectl --kubeconfig=${KUBECONFIG} -n default get pods | grep ocelot-backend |awk '{ print $1 }'):/app/public/uploads $BACKUP_FOLDER/public-uploads
|
||||
|
||||
# restart database
|
||||
kubectl --kubeconfig=${KUBECONFIG} get deployment ocelot-neo4j -o json \
|
||||
| jq 'del(.spec.template.spec.containers[].command)' \
|
||||
| kubectl --kubeconfig=${KUBECONFIG} apply -f -
|
||||
|
||||
# wait for the container to restart
|
||||
sleep 60
|
||||
|
||||
# maintenance mode off
|
||||
${SCRIPT_DIR}/cluster.maintenance.sh off
|
||||
22
deployment/scripts/cluster.maintenance.sh
Executable file
22
deployment/scripts/cluster.maintenance.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# base setup
|
||||
SCRIPT_PATH=$(realpath $0)
|
||||
SCRIPT_DIR=$(dirname $SCRIPT_PATH)
|
||||
|
||||
# configuration
|
||||
CONFIGURATION=${CONFIGURATION:-"example"}
|
||||
KUBECONFIG=${KUBECONFIG:-${SCRIPT_DIR}/../configurations/${CONFIGURATION}/kubeconfig.yaml}
|
||||
|
||||
case $1 in
|
||||
on)
|
||||
kubectl --kubeconfig=${KUBECONFIG} patch ingress ingress-ocelot-webapp --type merge --patch-file ${SCRIPT_DIR}/../src/kubernetes/patches/patch.ingress.maintenance.on.yaml
|
||||
;;
|
||||
off)
|
||||
kubectl --kubeconfig=${KUBECONFIG} patch ingress ingress-ocelot-webapp --type merge --patch-file ${SCRIPT_DIR}/../src/kubernetes/patches/patch.ingress.maintenance.off.yaml
|
||||
;;
|
||||
*)
|
||||
echo -e "Run this script with first argument either 'on' or 'off'"
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
@ -0,0 +1,12 @@
|
||||
spec:
|
||||
rules:
|
||||
- host:
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: ocelot-webapp
|
||||
port:
|
||||
number: 3000
|
||||
@ -0,0 +1,12 @@
|
||||
spec:
|
||||
rules:
|
||||
- host:
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: ocelot-maintenance
|
||||
port:
|
||||
number: 80
|
||||
@ -337,7 +337,7 @@ export default {
|
||||
id: user.id,
|
||||
slug: user.slug,
|
||||
name: user.name,
|
||||
about: user.about,
|
||||
about: user.about ? user.about : undefined,
|
||||
},
|
||||
geometry: {
|
||||
type: 'Point',
|
||||
@ -358,7 +358,7 @@ export default {
|
||||
id: group.id,
|
||||
slug: group.slug,
|
||||
name: group.name,
|
||||
about: group.about,
|
||||
about: group.about ? group.about : undefined,
|
||||
},
|
||||
geometry: {
|
||||
type: 'Point',
|
||||
@ -378,7 +378,7 @@ export default {
|
||||
id: this.currentUser.id,
|
||||
slug: this.currentUser.slug,
|
||||
name: this.currentUser.name,
|
||||
about: this.currentUser.about,
|
||||
about: this.currentUser.about ? this.currentUser.about : undefined,
|
||||
},
|
||||
geometry: {
|
||||
type: 'Point',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user