Skip to content

Commit

Permalink
Allow Cassandra schema builder to use credentials (#1635)
Browse files Browse the repository at this point in the history
* Allow Cassandra schema builder to use credentials

Currently the Cassandra schema builder job only works on open Cassandra installations. This PR fixes this by modifying the script so that two environmental variables, CASSANDRA_USER and CASSANDRA_PASSWORD, could be passed in to supply these credentials.

Signed-off-by: E.G. Hornbostel <eg.hornbostel@pricespider.com>

* Fixed missing semi-colon

Signed-off-by: E.G. Hornbostel <eg.hornbostel@pricespider.com>
  • Loading branch information
EGHornbostel authored and pavolloffay committed Jun 27, 2019
1 parent 5b52726 commit 3588002
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugin/storage/cassandra/schema/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ DATACENTER=${DATACENTER:-"dc1"}
KEYSPACE=${KEYSPACE:-"jaeger_v1_${DATACENTER}"}
MODE=${MODE:-"test"}
TEMPLATE=${TEMPLATE:-""}
USER=${CASSANDRA_USERNAME:-""}
PASSWORD=${CASSANDRA_PASSWORD:-""}

total_wait=0
while true
Expand All @@ -31,4 +33,9 @@ done

echo "Generating the schema for the keyspace ${KEYSPACE} and datacenter ${DATACENTER}"

MODE="${MODE}" DATACENTER="${DATACENTER}" KEYSPACE="${KEYSPACE}" /cassandra-schema/create.sh "${TEMPLATE}" | ${CQLSH} ${CQLSH_SSL} ${CQLSH_HOST}

if [ -z "$PASSWORD" ]; then
MODE="${MODE}" DATACENTER="${DATACENTER}" KEYSPACE="${KEYSPACE}" /cassandra-schema/create.sh "${TEMPLATE}" | ${CQLSH} ${CQLSH_SSL} ${CQLSH_HOST}
else
MODE="${MODE}" DATACENTER="${DATACENTER}" KEYSPACE="${KEYSPACE}" /cassandra-schema/create.sh "${TEMPLATE}" | ${CQLSH} ${CQLSH_SSL} ${CQLSH_HOST} -u ${USER} -p ${PASSWORD}
fi

0 comments on commit 3588002

Please sign in to comment.