Created
August 18, 2022 23:20
-
-
Save rfay/27b12e49ceb1ed1e3959c603401b7010 to your computer and use it in GitHub Desktop.
Convert a pre-v1.19.0 in-volume database marker to current usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# convert the marker on an old pre-ddev v1.19 database to current usage | |
# See issue at https://github.com/drud/ddev/issues/4129 | |
# First argument should be the project name | |
# Second argument is the correct value you want, for example, | |
# mariadb_10.2 or mysql_8.0 | |
# Example: bash convert-old-db.sh fe-kuerschnersmart mariadb_10.2 | |
if [ $# != 2 ]; then | |
echo "Please run this with '$0 <projectname> dbtype_dbversion', for example '$0 myproject mariadb_10.3'" && exit 1 | |
fi | |
set -x | |
project=$1 | |
db_type=$2 | |
docker run -it --rm -v ${project}-mariadb:/tmp/db busybox sh -c "echo $db_type > /tmp/db/db_mariadb_version.txt" | |
set +x | |
echo -n "your in-volume database type_version is now " | |
docker run -it --rm -v ${project}-mariadb:/tmp/db busybox sh -c 'cat /tmp/db/db_mariadb_version.txt' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment