1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-28 13:15:12 +01:00

stop script

This commit is contained in:
Kyle Spearrin 2017-08-21 09:39:12 -04:00
parent 9049c48aed
commit c50b4657d6
5 changed files with 45 additions and 1 deletions

View File

@ -1,7 +1,8 @@
param (
[switch] $install,
[switch] $run,
[switch] $restart,
[switch] $restart
[switch] $stop,
[switch] $update,
[switch] $updatedb,
[string] $output = ""
@ -40,6 +41,7 @@ if(!(Test-Path -Path $scriptsDir)) {
function Download-Run-Files {
Invoke-RestMethod -OutFile $scriptsDir\run.ps1 -Uri "${githubBaseUrl}/scripts/run.ps1"
Invoke-RestMethod -OutFile $scriptsDir\stop.ps1 -Uri "${githubBaseUrl}/scripts/stop.ps1"
Invoke-RestMethod -OutFile $dockerDir\docker-compose.yml -Uri "${githubBaseUrl}/docker/docker-compose.yml"
Invoke-RestMethod -OutFile $dockerDir\docker-compose.macwin.yml ` -Uri "${githubBaseUrl}/docker/docker-compose.macwin.yml"
Invoke-RestMethod -OutFile $dockerDir\global.env -Uri "${githubBaseUrl}/docker/global.env"
@ -71,6 +73,9 @@ elseif($updatedb) {
Invoke-RestMethod -OutFile $scriptsDir\update-db.ps1 -Uri "${githubBaseUrl}/scripts/update-db.ps1"
Invoke-Expression "$scriptsDir\update-db.ps1 -outputDir $output"
}
elseif($stop) {
Invoke-Expression "$scriptsDir\stop.ps1 -dockerDir $dockerDir"
}
else {
echo "No command found."
}

View File

@ -47,6 +47,8 @@ fi
function downloadRunFiles() {
curl -s -o $SCRIPTS_DIR/run.sh $GITHUB_BASE_URL/scripts/run.sh
chmod u+x $SCRIPTS_DIR/run.sh
curl -s -o $SCRIPTS_DIR/stop.sh $GITHUB_BASE_URL/scripts/stop.sh
chmod u+x $SCRIPTS_DIR/stop.sh
curl -s -o $DOCKER_DIR/docker-compose.yml $GITHUB_BASE_URL/docker/docker-compose.yml
curl -s -o $DOCKER_DIR/docker-compose.$OS.yml $GITHUB_BASE_URL/docker/docker-compose.$OS.yml
curl -s -o $DOCKER_DIR/global.env $GITHUB_BASE_URL/docker/global.env
@ -81,6 +83,9 @@ then
curl -s -o $SCRIPTS_DIR/update-db.sh $GITHUB_BASE_URL/scripts/update-db.sh
chmod u+x $SCRIPTS_DIR/update-db.sh
$SCRIPTS_DIR/update-db.sh $OUTPUT
elif [ "$1" == "stop" ]
then
$SCRIPTS_DIR/stop.sh $DOCKER_DIR
else
echo "No command found."
fi

13
scripts/stop.ps1 Normal file
View File

@ -0,0 +1,13 @@
param (
[string] $dockerDir = ""
)
$dir = Split-Path -Parent $MyInvocation.MyCommand.Path
if($dockerDir -eq "") {
$dockerDir="${dir}\..\docker"
}
docker --version
docker-compose --version
docker-compose -f ${dockerDir}\docker-compose.yml -f ${dockerDir}\docker-compose.macwin.yml down

20
scripts/stop.sh Normal file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DOCKER_DIR=$DIR/../docker
if [ $# -eq 1 ]
then
DOCKER_DIR=$1
fi
OS="linux"
if [ "$(uname)" == "Darwin" ]
then
OS="macwin"
fi
docker --version
docker-compose --version
docker-compose -f $DOCKER_DIR/docker-compose.yml -f $DOCKER_DIR/docker-compose.$OS.yml down

View File

@ -81,6 +81,7 @@ namespace Setup
BuildEnvironmentFiles();
BuildAppSettingsFiles();
BuildAppId();
}
private static void Update()