Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Keycloak
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NoCloud
docker
Keycloak
Commits
e06eb56a
Commit
e06eb56a
authored
2 months ago
by
David Beniamine
Browse files
Options
Downloads
Plain Diff
Merge branch 'services-desk-183-backup' into 'main'
Ajout de backup.sh See merge request
!5
parents
36e8aa02
6d8602ad
Branches
Branches containing commit
No related tags found
1 merge request
!5
Ajout de backup.sh
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
backup.sh
+36
-0
36 additions, 0 deletions
backup.sh
docker-compose.yml
+1
-1
1 addition, 1 deletion
docker-compose.yml
with
38 additions
and
1 deletion
.gitignore
+
1
−
0
View file @
e06eb56a
...
@@ -2,3 +2,4 @@
...
@@ -2,3 +2,4 @@
keycloak_db/
keycloak_db/
themes/*
themes/*
!themes/custom-theme-template
!themes/custom-theme-template
backups/*
This diff is collapsed.
Click to expand it.
backup.sh
0 → 100644
+
36
−
0
View file @
e06eb56a
#!/bin/bash
echo
"Backing up Keycloak DB and config"
DIR
=
$(
realpath
$(
dirname
$0
))
if
[
!
-e
$DIR
/.env
]
then
echo
".env file do not exist"
exit
1
fi
.
$DIR
/.env
if
[
-z
"
$MARIADB_PASS
"
]
;
then
echo
"Error: the MARIADB_PASS variable is not set or is empty."
exit
1
fi
mkdir
-p
$DIR
/backups
out
=
"
$DIR
/backups/keycloak_
$(
date
+%Y%m%d_%H%M
)
.tar.gz"
if
command
-v
docker-compose &> /dev/null
;
then
DOCKER_COMPOSE
=
"docker-compose"
elif
docker compose version &> /dev/null
;
then
DOCKER_COMPOSE
=
"docker compose"
else
echo
"'docker compose' and 'docker-compose' not found"
exit
1
fi
$DOCKER_COMPOSE
exec
-T
mariadb mysqldump
--all-databases
-u
root
-p
"
$MARIADB_PASS
"
--default-character-set
=
utf8 |
gzip
>
"
$out
"
ls
-lh
$out
echo
"Done"
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
1
−
1
View file @
e06eb56a
...
@@ -21,7 +21,7 @@ services:
...
@@ -21,7 +21,7 @@ services:
mariadb
:
mariadb
:
image
:
mariadb:latest
image
:
mariadb:latest
container_name
:
mariadb
container_name
:
keycloak_
mariadb
volumes
:
volumes
:
-
"
./keycloak_db:/var/lib/mysql:rw"
-
"
./keycloak_db:/var/lib/mysql:rw"
environment
:
environment
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment