Browse Source

BREAKING CHANGE: remove support for deprecated `docker-compose` CLI (#301)

* fix: db migration connectivity issues when using an external db

* Update run.ps1

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>

* rm semicolon in case connection this is at the end of the connection string

* fix: 'no such image: mssql' when mssql container is not present

* BREAKING CHANGE: remove compat with deprecated docker-compose CLI

---------

Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
pull/306/head
tangowithfoxtrot 1 year ago committed by GitHub
parent
commit
846523760d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 18
      bitwarden.sh
  2. 24
      run.sh

18
bitwarden.sh

@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
set -e
cat << "EOF"
_ _ _ _
| |__ (_) |___ ____ _ _ __ __| | ___ _ __
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \
_ _ _ _
| |__ (_) |___ ____ _ _ __ __| | ___ _ __
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \
| |_) | | |_ \ V V / (_| | | | (_| | __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_| \__,_|\___|_| |_|
@ -33,7 +33,7 @@ if [ "$EUID" -eq 0 ]; then @@ -33,7 +33,7 @@ if [ "$EUID" -eq 0 ]; then
echo -e "Continuing...."
;;
*)
exit 1
exit 1
;;
esac
fi
@ -68,11 +68,7 @@ KEYCONNECTORVERSION="2024.8.0" @@ -68,11 +68,7 @@ KEYCONNECTORVERSION="2024.8.0"
echo "bitwarden.sh version $COREVERSION"
docker --version
if [[ "$dccmd" == "docker compose" ]]; then
$dccmd version
else
$dccmd --version
fi
docker compose version
echo ""
@ -155,7 +151,7 @@ function compressLogs() { @@ -155,7 +151,7 @@ function compressLogs() {
exit 1
fi
fi
# Validate end date format and order
if [ -n "$END_DATE" ]; then
validateDateFormat "$END_DATE" "end"
@ -261,7 +257,7 @@ case $1 in @@ -261,7 +257,7 @@ case $1 in
$SCRIPTS_DIR/run.sh uninstall $OUTPUT
;;
"compresslogs")
checkOutputDirExists
checkOutputDirExists
compressLogs $OUTPUT $2 $3
;;
"help")

24
run.sh

@ -2,13 +2,13 @@ @@ -2,13 +2,13 @@
set -e
# Setup
if command -v docker-compose &> /dev/null
if ! docker compose version &> /dev/null
then
dccmd='docker-compose'
else
dccmd='docker compose'
echo "Error: 'docker compose' is not installed. Please install Docker Compose."
exit 1
fi
CYAN='\033[0;36m'
RED='\033[1;31m'
NC='\033[0m' # No Color
@ -108,19 +108,19 @@ function install() { @@ -108,19 +108,19 @@ function install() {
function dockerComposeUp() {
dockerComposeFiles
dockerComposeVolumes
$dccmd up -d
docker compose up -d
}
function dockerComposeDown() {
dockerComposeFiles
if [ $($dccmd ps | wc -l) -gt 2 ]; then
$dccmd down
if [ $(docker compose ps | wc -l) -gt 2 ]; then
docker compose down
fi
}
function dockerComposePull() {
dockerComposeFiles
$dccmd pull
docker compose pull
}
function dockerComposeFiles() {
@ -191,7 +191,7 @@ function updateDatabase() { @@ -191,7 +191,7 @@ function updateDatabase() {
# only use container network driver if using the included mssql image
if grep -q 'Data Source=tcp:mssql,1433' "$ENV_DIR/global.override.env"
then
MSSQL_ID=$($dccmd ps -q mssql)
MSSQL_ID=$(docker compose ps -q mssql)
local docker_network_args="--network container:$MSSQL_ID"
fi
@ -203,11 +203,11 @@ function updateDatabase() { @@ -203,11 +203,11 @@ function updateDatabase() {
function updatebw() {
KEY_CONNECTOR_ENABLED=$(grep 'enable_key_connector:' $OUTPUT_DIR/config.yml | awk '{ print $2}')
CORE_ID=$($dccmd ps -q admin)
WEB_ID=$($dccmd ps -q web)
CORE_ID=$(docker compose ps -q admin)
WEB_ID=$(docker compose ps -q web)
if [ "$KEY_CONNECTOR_ENABLED" = true ];
then
KEYCONNECTOR_ID=$($dccmd ps -q key-connector)
KEYCONNECTOR_ID=$(docker compose ps -q key-connector)
fi
if [ $KEYCONNECTOR_ID ] &&

Loading…
Cancel
Save