mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 05:00:19 -05:00
Add key connector check for update function in run.sh (#1790)
* Added logic to check if key-connector is enabled
This commit is contained in:
parent
f1e084445e
commit
fefe284a2b
@ -188,14 +188,24 @@ function updateDatabase() {
|
||||
}
|
||||
|
||||
function updatebw() {
|
||||
KEY_CONNECTOR_ENABLED=$(grep -A3 'enable_key_connector:' $OUTPUT_DIR/config.yml | tail -n1 | awk '{ print $2}')
|
||||
CORE_ID=$(docker-compose ps -q admin)
|
||||
WEB_ID=$(docker-compose ps -q web)
|
||||
#KEYCONNECTOR_ID=$(docker-compose ps -q key-connector)
|
||||
#if docker inspect --format='{{.Config.Image}}:' $CORE_ID | grep -F ":$COREVERSION:" | grep -q ":[0-9.]*:$" &&
|
||||
# docker inspect --format='{{.Config.Image}}:' $WEB_ID | grep -F ":$WEBVERSION:" | grep -q ":[0-9.]*:$" &&
|
||||
# docker inspect --format='{{.Config.Image}}:' $KEYCONNECTOR_ID | grep -F ":$KEYCONNECTORVERSION:" | grep -q ":[0-9.]*:$"
|
||||
if docker inspect --format='{{.Config.Image}}:' $CORE_ID | grep -F ":$COREVERSION:" | grep -q ":[0-9.]*:$" &&
|
||||
docker inspect --format='{{.Config.Image}}:' $WEB_ID | grep -F ":$WEBVERSION:" | grep -q ":[0-9.]*:$"
|
||||
if [ $KEY_CONNECTOR_ENABLED = true ];
|
||||
then
|
||||
KEYCONNECTOR_ID=$(docker-compose ps -q key-connector)
|
||||
fi
|
||||
|
||||
if [ $KEYCONNECTOR_ID ] &&
|
||||
docker inspect --format='{{.Config.Image}}:' $CORE_ID | grep -F ":$COREVERSION:" | grep -q ":[0-9.]*:$" &&
|
||||
docker inspect --format='{{.Config.Image}}:' $WEB_ID | grep -F ":$WEBVERSION:" | grep -q ":[0-9.]*:$" &&
|
||||
docker inspect --format='{{.Config.Image}}:' $KEYCONNECTOR_ID | grep -F ":$KEYCONNECTORVERSION:" | grep -q ":[0-9.]*:$"
|
||||
then
|
||||
echo "Update not needed"
|
||||
exit
|
||||
elif
|
||||
docker inspect --format='{{.Config.Image}}:' $CORE_ID | grep -F ":$COREVERSION:" | grep -q ":[0-9.]*:$" &&
|
||||
docker inspect --format='{{.Config.Image}}:' $WEB_ID | grep -F ":$WEBVERSION:" | grep -q ":[0-9.]*:$"
|
||||
then
|
||||
echo "Update not needed"
|
||||
exit
|
||||
|
Loading…
x
Reference in New Issue
Block a user