Browse Source

rebuild command added

pull/349/merge
Kyle Spearrin 7 years ago
parent
commit
3c52cc9082
  1. 5
      scripts/bitwarden.ps1
  2. 4
      scripts/bitwarden.sh
  3. 12
      scripts/run.ps1
  4. 11
      scripts/run.sh

5
scripts/bitwarden.ps1

@ -4,6 +4,7 @@ param ( @@ -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) { @@ -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"

4
scripts/bitwarden.sh

@ -90,6 +90,10 @@ then @@ -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

12
scripts/run.ps1

@ -108,8 +108,10 @@ function Update-Database { @@ -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) { @@ -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
}

11
scripts/run.sh

@ -152,7 +152,10 @@ function updateDatabase() { @@ -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 @@ -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

Loading…
Cancel
Save