Last active
May 26, 2020 08:43
This file contains hidden or 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
#!/usr/bin/env bash | |
echo "------------- cleaning existing instances running ------------- " | |
docker stop localCassandra | |
docker container rm localCassandra | |
echo "------------- running container in detached mode ------------- " | |
docker build . -t containerised_local_cassandra | |
docker run --name localCassandra -d -p 5555:9042 containerised_local_cassandra | |
printf "waiting to spin up the containers " | |
while [[ $(docker exec -it localCassandra ls /tmp/cassandra_up.flag 2>&1 | grep "No such file or directory") ]]; | |
do | |
sleep 1 | |
printf . | |
done | |
printf "\n\n------------- setting variables for the migration script: ------------- \n\n" | |
cat ./set_environment_variables | |
source ./set_environment_variables | |
printf "\n\n------------- running the schema migration script -------------\n\n" | |
java -jar \ | |
-Dcassandra.migration.scripts.locations=$(echo $MIGRATION_SCRIPT_LOCATION) \ | |
-Dcassandra.migration.cluster.contactpoints=$(echo $CASSANDRA_DB_CONTACT_POINTS) \ | |
-Dcassandra.migration.cluster.port=$(echo $CASSANDRA_DB_PORT) \ | |
-Dcassandra.migration.cluster.username=$(echo $CASSANDRA_DB_USERNAME) \ | |
-Dcassandra.migration.cluster.password=$(echo $CASSANDRA_DB_PASSWORD) \ | |
-Dcassandra.migration.keyspace.name=$(echo $KEYSPACE_NAME) \ | |
-Dcassandra.migration.keyspace.consistency=ALL \ | |
-Dcassandra.migration.cluster.enablessl=$(echo $CASSANDRA_DB_SSL_ENABLED) \ | |
../schema_migration/cassandra-migration-0.17-jar-with-dependencies.jar migrate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment