Update docker migrator to fix issues and ensure consistency.

This commit is contained in:
Buster Neece 2019-05-27 16:33:11 -05:00
parent 43c28f3d6f
commit f9a87b0651
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
3 changed files with 17 additions and 9 deletions

View File

@ -0,0 +1,11 @@
version: '2.2'
services:
web:
volumes:
- /var/azuracast/stations:/var/azuracast/stations
- /var/azuracast/backups:/var/azuracast/backups
stations:
volumes:
- /var/azuracast/stations:/var/azuracast/stations

View File

@ -20,7 +20,7 @@ BASE_DIR=`pwd`
# Create backup from existing installation.
chmod a+x bin/azuracast
./bin/azuracast azuracast:backup --exclude-media ./migration.tar.gz
./bin/azuracast azuracast:backup --exclude-media migration.zip
read -n 1 -s -r -p "Database backed up. Press any key to continue (Install Docker)..."
@ -41,24 +41,22 @@ chmod a+x uninstall.sh
read -n 1 -s -r -p "Uninstall complete. Press any key to continue (Install AzuraCast in Docker)..."
# Copy override file.
cp docker-compose.migrate.yml docker-compose.override.yml
# Spin up Docker
docker-compose pull
sleep 5
# Copy media.
docker-compose run --user="azuracast" --rm \
-v /var/azuracast/stations:/tmp/migration \
mv /tmp/migration/* /var/azuracast/stations
# Copy all other settings.
chmod a+x docker.sh
./docker.sh restore ./migration.tar.gz
./docker.sh restore migration.zip
read -n 1 -s -r -p "Docker is running. Press any key to continue (cleanup)..."
# Codebase cleanup
rm -rf /var/azuracast/stations
find -maxdepth 1 ! -name migration.tar.gz ! -name . ! -name docker-compose.yml \
find -maxdepth 1 ! -name . ! -name docker-compose.yml ! -name docker-compose.override.yml \
! -name docker.sh ! -name .env ! -name azuracast.env ! -name plugins \
-exec rm -rv {} \;

View File

@ -226,7 +226,6 @@ restore() {
echo "File $BACKUP_PATH does not exist in this directory. Nothing to restore."
exit 1
fi
echo 'test'
}
#