1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

run setup update command on updates

This commit is contained in:
Kyle Spearrin
2017-10-25 17:21:35 -04:00
parent 43f8fb04d4
commit 3e04377e67
4 changed files with 55 additions and 16 deletions

View File

@ -53,28 +53,42 @@ function updateLetsEncrypt() {
}
function updateDatabase() {
docker pull bitwarden/setup:$TAG
pullSetup
docker run -it --rm --name setup --network container:mssql -v $OUTPUT_DIR:/bitwarden bitwarden/setup:$TAG \
dotnet Setup.dll -update 1 -db 1
echo "Database update complete"
}
function update() {
pullSetup
docker run -it --rm --name setup -v $OUTPUT_DIR:/bitwarden bitwarden/setup:$TAG \
dotnet Setup.dll -update 1
}
function printEnvironment() {
docker pull bitwarden/setup:$TAG
pullSetup
docker run -it --rm --name setup -v $OUTPUT_DIR:/bitwarden bitwarden/setup:$TAG \
dotnet Setup.dll -printenv 1 -env $OS
}
# Commands
if [ "$1" == "start" -o "$1" == "restart" ]
then
function restart() {
dockerComposeDown
dockerComposePull
updateLetsEncrypt
dockerComposeUp
dockerPrune
printEnvironment
}
function pullSetup() {
docker pull bitwarden/setup:$TAG
}
# Commands
if [ "$1" == "start" -o "$1" == "restart" ]
then
restart
elif [ "$1" == "pull" ]
then
dockerComposePull
@ -84,4 +98,10 @@ then
elif [ "$1" == "updatedb" ]
then
updateDatabase
elif [ "$1" == "update" ]
then
dockerComposeDown
update
restart
updateDatabase
fi