1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 13:08:17 -05:00

rebuild command added

This commit is contained in:
Kyle Spearrin 2018-08-30 16:25:33 -04:00
parent 69605fab5b
commit 3c52cc9082
4 changed files with 27 additions and 5 deletions

View File

@ -4,6 +4,7 @@ param (
[switch] $restart,
[switch] $stop,
[switch] $update,
[switch] $rebuild,
[switch] $updatedb,
[switch] $updateself,
[string] $output = ""
@ -87,6 +88,10 @@ elseif ($update) {
Download-Run-File
Invoke-Expression "$scriptsDir\run.ps1 -update -outputDir $output -coreVersion $coreVersion -webVersion $webVersion"
}
elseif ($rebuild) {
Check-Output-Dir-Exists
Invoke-Expression "$scriptsDir\run.ps1 -rebuild -outputDir $output -coreVersion $coreVersion -webVersion $webVersion"
}
elseif ($updatedb) {
Check-Output-Dir-Exists
Invoke-Expression "$scriptsDir\run.ps1 -updatedb -outputDir $output -coreVersion $coreVersion -webVersion $webVersion"

View File

@ -90,6 +90,10 @@ then
checkOutputDirExists
downloadRunFile
$SCRIPTS_DIR/run.sh update $OUTPUT $COREVERSION $WEBVERSION
elif [ "$1" == "rebuild" ]
then
checkOutputDirExists
$SCRIPTS_DIR/run.sh rebuild $OUTPUT $COREVERSION $WEBVERSION
elif [ "$1" == "updatedb" ]
then
checkOutputDirExists

View File

@ -108,8 +108,10 @@ function Update-Database {
echo "Database update complete"
}
function Update {
Pull-Setup
function Update([switch] $withpull) {
if ($withpull) {
Pull-Setup
}
docker run -it --rm --name setup -v ${outputDir}:/bitwarden bitwarden/setup:$coreVersion `
dotnet Setup.dll -update 1 -os win -corev $coreVersion -webv $webVersion
}
@ -152,9 +154,13 @@ elseif ($updatedb) {
}
elseif ($update) {
Docker-Compose-Down
Update
Update -withpull
Restart
echo "Pausing 60 seconds for database to come online. Please wait..."
Start-Sleep -s 60
Update-Database
}
elseif ($rebuild) {
Docker-Compose-Down
Update
}

View File

@ -152,7 +152,10 @@ function updateDatabase() {
}
function update() {
pullSetup
if [ "$1" == "withpull" ]
then
pullSetup
fi
docker run -i --rm --name setup -v $OUTPUT_DIR:/bitwarden \
--env-file $ENV_DIR/uid.env bitwarden/setup:$COREVERSION \
dotnet Setup.dll -update 1 -os $OS -corev $COREVERSION -webv $WEBVERSION
@ -198,9 +201,13 @@ then
elif [ "$1" == "update" ]
then
dockerComposeDown
update
update withpull
restart
echo "Pausing 60 seconds for database to come online. Please wait..."
sleep 60
updateDatabase
elif [ "$1" == "rebuild" ]
then
dockerComposeDown
update nopull
fi