fixed upgrade script further
This commit is contained in:
parent
ee596da610
commit
08edd787d4
2 changed files with 11 additions and 30 deletions
|
@ -1,16 +0,0 @@
|
|||
#! /usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
#DB_FILE="db/ciso-assistant.sqlite3"
|
||||
#BACKUP_FILE="ciso-assistant-backup.sqlite3"
|
||||
|
||||
# Backup the database
|
||||
/usr/bin/docker compose -f /opt/cisoas/docker-compose.yml exec -T postgres /usr/local/bin/backup
|
||||
|
||||
# Stop and clean the containers
|
||||
docker compose rm -fs
|
||||
|
||||
# note: the rmi trick is not needed anymore since we move to always pull policy
|
||||
# Start the containers
|
||||
docker compose up -d
|
||||
echo "CISO assistant updated successfully"
|
|
@ -1,23 +1,20 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
VERSION=${1:-community}
|
||||
|
||||
|
||||
if [ "$VERSION" = "enterprise" ]; then
|
||||
BACKEND_IMAGE="ghcr.io/intuitem/ciso-assistant-enterprise-backend:latest"
|
||||
FRONTEND_IMAGE="ghcr.io/intuitem/ciso-assistant-enterprise-frontend:latest"
|
||||
else
|
||||
BACKEND_IMAGE="ghcr.io/intuitem/ciso-assistant-community/backend:latest"
|
||||
FRONTEND_IMAGE="ghcr.io/intuitem/ciso-assistant-community/frontend:latest"
|
||||
fi
|
||||
|
||||
echo "Update of the version : $VERSION"
|
||||
|
||||
# Backup the database
|
||||
|
||||
echo "Backing up database"
|
||||
|
||||
/opt/cisoas ❯ /usr/bin/docker compose -f /opt/cisoas/docker-compose.yml exec -T postgres /usr/local/bin/backup
|
||||
backup=$(/usr/bin/docker compose -f /opt/cisoas/docker-compose.yml exec -T postgres /usr/local/bin/backup)
|
||||
|
||||
backup_result=$?
|
||||
|
||||
if [[ $backup_result -ne 0 ]]; then
|
||||
echo "backup failed, will not upgrade image"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BACKEND_IMAGE="ghcr.io/intuitem/ciso-assistant-enterprise-backend:latest"
|
||||
FRONTEND_IMAGE="ghcr.io/intuitem/ciso-assistant-enterprise-frontend:latest"
|
||||
|
||||
# Stop the containers
|
||||
docker compose down
|
||||
|
|
Loading…
Add table
Reference in a new issue