1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -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

@ -5,7 +5,8 @@ param (
[switch] $restart,
[switch] $stop,
[switch] $pull,
[switch] $updatedb
[switch] $updatedb,
[switch] $update
)
# Setup
@ -44,21 +45,25 @@ function Update-Lets-Encrypt {
}
function Update-Database {
docker pull bitwarden/setup:$tag
Pull-Setup
docker run -it --rm --name setup --network container:mssql -v ${outputDir}:/bitwarden bitwarden/setup:$tag `
dotnet Setup.dll -update 1 -db 1
echo "Database update complete"
}
function Update {
Pull-Setup
docker run -it --rm --name setup -v ${outputDir}:/bitwarden bitwarden/setup:$tag `
dotnet Setup.dll -update 1
}
function Print-Environment {
docker pull bitwarden/setup:$tag
Pull-Setup
docker run -it --rm --name setup -v ${outputDir}:/bitwarden bitwarden/setup:$tag `
dotnet Setup.dll -printenv 1 -env win
}
# Commands
if($start -Or $restart) {
function Restart {
Docker-Compose-Down
Docker-Compose-Pull
Update-Lets-Encrypt
@ -66,6 +71,16 @@ if($start -Or $restart) {
Docker-Prune
Print-Environment
}
function Pull-Setup {
docker pull bitwarden/setup:$tag
}
# Commands
if($start -Or $restart) {
Restart
}
elseif($pull) {
Docker-Compose-Pull
}
@ -75,3 +90,9 @@ elseif($stop) {
elseif($updatedb) {
Update-Database
}
elseif($update) {
Docker-Compose-Down
Update
Restart
Update-Database
}