diff options
author | Thomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com> | 2018-03-08 01:55:21 -0500 |
---|---|---|
committer | Thomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com> | 2018-03-08 01:55:21 -0500 |
commit | ed47d0c5d004b1ce099090100dda6dc1d963782c (patch) | |
tree | c8ed27f9b18206ddd68bd1cdd20d687b965ae8c3 /distribution/cassandra | |
parent | 64cf8e703644f01ef1efde65c86a60ec3e377a5a (diff) |
Docker Updates for CSIT
Udates fro Docker and also a few bug fixes.
Change-Id: I48d8ee81412c7ce664e6b3e33c06e952afad734e
Issue-ID: MUSIC-32, MUSIC-51
Signed-off-by: Thomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>
Diffstat (limited to 'distribution/cassandra')
-rw-r--r-- | distribution/cassandra/Dockerfile | 3 | ||||
-rw-r--r-- | distribution/cassandra/docker-entrypoint.sh | 17 | ||||
-rw-r--r-- | distribution/cassandra/music_single.cql | 2 |
3 files changed, 19 insertions, 3 deletions
diff --git a/distribution/cassandra/Dockerfile b/distribution/cassandra/Dockerfile index 0e851f47..9405fcb3 100644 --- a/distribution/cassandra/Dockerfile +++ b/distribution/cassandra/Dockerfile @@ -4,5 +4,6 @@ RUN mkdir -p /docker-entrypoint-initdb.d && mkdir -p /home/cassandra/.cassandra COPY cassandra.yaml /etc/cassandra/ COPY music_single.cql /docker-entrypoint-initdb.d/ COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh -RUN chmod 755 /usr/local/bin/docker-entrypoint.sh +RUN chmod 755 /usr/local/bin/docker-entrypoint.sh && chown -R cassandra /docker-entrypoint-initdb.d + ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/distribution/cassandra/docker-entrypoint.sh b/distribution/cassandra/docker-entrypoint.sh index e46dea9f..cec4587b 100644 --- a/distribution/cassandra/docker-entrypoint.sh +++ b/distribution/cassandra/docker-entrypoint.sh @@ -60,10 +60,25 @@ if [ "$1" = 'cassandra' ]; then fi done fi + +for f in /docker-entrypoint-initdb.d/*.cql; do + if [ "${CASSUSER}" ]; then + sed -ri 's/CASSUSER/'${CASSUSER}'/' "$f" + fi + if [ "${CASSPASS}" ]; then + sed -ri 's/CASSPASS/'${CASSPASS}'/' "$f" + fi +done + + + + echo "################################ Let run Scripts ##############################" for f in /docker-entrypoint-initdb.d/*; do + case "$f" in - *.cql) echo "$0: running $f" && until cqlsh -u cassandra -p cassandra -f "$f"; do >&2 echo "Cassandra is unavailable - sleeping"; sleep 2; done & ;; + *.cql) + echo "$0: running $f" && until cqlsh -u cassandra -p cassandra -f "$f"; do >&2 echo "Cassandra is unavailable - sleeping"; sleep 2; done & ;; *) echo "$0: ignoring $f" ;; esac echo diff --git a/distribution/cassandra/music_single.cql b/distribution/cassandra/music_single.cql index 11eb2df0..b8a60cd1 100644 --- a/distribution/cassandra/music_single.cql +++ b/distribution/cassandra/music_single.cql @@ -16,5 +16,5 @@ CREATE TABLE IF NOT EXISTS admin.keyspace_master ( PRIMARY KEY (uuid) ); -CREATE ROLE IF NOT EXISTS nelson24 WITH PASSWORD = 'winman123' AND SUPERUSER = True AND LOGIN = True; +CREATE ROLE IF NOT EXISTS CASSUSER WITH PASSWORD = 'CASSPASS' AND SUPERUSER = True AND LOGIN = True; ALTER ROLE cassandra WITH PASSWORD = 'SomeLongRandomStringNoonewillthinkof'; |