Skip to content

Instantly share code, notes, and snippets.

@mormolis
Last active May 26, 2020 10:18
#!/usr/bin/env bash
#to set keyspace name
source set_environment_variables
if [[ ! -z "$KEYSPACE_NAME" && $1 = 'cassandra' ]]; then
# Create default keyspace for single node cluster
CQL="CREATE KEYSPACE $KEYSPACE_NAME WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};"
until echo $CQL | cqlsh; do
echo "cqlsh: Cassandra is still starting up - please wait - retrying"
sleep 2
done && touch /tmp/cassandra_up.flag &
fi
exec /docker-entrypoint.sh "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment