/entrypoint-wrap.sh Secret
Last active
May 26, 2020 10:18
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
#!/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