diff options
author | Thomas Nelson <tn1381@att.com> | 2020-02-19 13:28:09 -0500 |
---|---|---|
committer | Thomas Nelson <tn1381@att.com> | 2020-02-19 13:28:09 -0500 |
commit | a7512128b6eb91ac745dc6130a841910e31eb413 (patch) | |
tree | 31bc1bb768bf758c9accfc7351c9f7c92706ef6c /distribution/cassandra_job | |
parent | 712f0dddc791f9ef8283fb40b5b5f326bc4ea0d9 (diff) |
Fix Broken Docker Builds
Update Pom files and Directory Structure.
Issue-ID: MUSIC-561
Signed-off-by: Thomas Nelson <tn1381@att.com>
Change-Id: I3325b20cc4345e67a356a5cbb1bce7d45904be02
Diffstat (limited to 'distribution/cassandra_job')
-rw-r--r-- | distribution/cassandra_job/Dockerfile | 30 | ||||
-rw-r--r-- | distribution/cassandra_job/admin.cql | 17 | ||||
-rw-r--r-- | distribution/cassandra_job/admin_pw.cql | 2 | ||||
-rw-r--r-- | distribution/cassandra_job/runcql.sh | 112 | ||||
-rw-r--r-- | distribution/cassandra_job/test.cql | 2 |
5 files changed, 0 insertions, 163 deletions
diff --git a/distribution/cassandra_job/Dockerfile b/distribution/cassandra_job/Dockerfile deleted file mode 100644 index 937afdee..00000000 --- a/distribution/cassandra_job/Dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -# -# ============LICENSE_START========================================== -# org.onap.music -# =================================================================== -# Copyright (c) 2019 AT&T Intellectual Property -# =================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# ============LICENSE_END============================================= -# ==================================================================== - -#registry.hub.docker.com/ -FROM library/cassandra:3.11 -ENV DEF_USER=cassandra -ENV DEF_PASS=cassandra -COPY runcql.sh / -RUN mkdir -p cql/extra && \ - chmod 755 runcql.sh && \ - chown cassandra runcql.sh -CMD ["/runcql.sh"] diff --git a/distribution/cassandra_job/admin.cql b/distribution/cassandra_job/admin.cql deleted file mode 100644 index 904a2bab..00000000 --- a/distribution/cassandra_job/admin.cql +++ /dev/null @@ -1,17 +0,0 @@ -CREATE KEYSPACE IF NOT EXISTS admin - WITH REPLICATION = { - 'class' : 'SimpleStrategy', - 'replication_factor': 1 - } - AND DURABLE_WRITES = true; - -CREATE TABLE IF NOT EXISTS admin.keyspace_master ( - uuid uuid, - keyspace_name text, - application_name text, - is_api boolean, - password text, - username text, - is_aaf boolean, - PRIMARY KEY (uuid) -); diff --git a/distribution/cassandra_job/admin_pw.cql b/distribution/cassandra_job/admin_pw.cql deleted file mode 100644 index bbad8d1d..00000000 --- a/distribution/cassandra_job/admin_pw.cql +++ /dev/null @@ -1,2 +0,0 @@ -CREATE ROLE IF NOT EXISTS <CASSUSER> WITH PASSWORD = '<CASSPASS>' AND SUPERUSER = True AND LOGIN = True; -ALTER ROLE cassandra WITH PASSWORD = 'SomeLongRandomStringNoonewillthinkof'; diff --git a/distribution/cassandra_job/runcql.sh b/distribution/cassandra_job/runcql.sh deleted file mode 100644 index 89396bfc..00000000 --- a/distribution/cassandra_job/runcql.sh +++ /dev/null @@ -1,112 +0,0 @@ -#! /bin/bash -# -# ============LICENSE_START========================================== -# org.onap.music -# =================================================================== -# Copyright (c) 2019 AT&T Intellectual Property -# =================================================================== -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# ============LICENSE_END============================================= -# ==================================================================== - -if [ -z "$TIMEOUT" ]; then - TIMEOUT=10; -fi -if [ -z "$DELAY" ]; then - DELAY=60; -fi -TO="--request-timeout=$TIMEOUT" - -if [ $CASS_HOSTNAME ]; then - echo "Sleeping for $DELAY seconds before running cql"; - sleep $DELAY; - >&2 echo "#############################################" - >&2 echo "############## Let run cql's ################" - >&2 echo "#############################################" - >&2 echo "Current Variables in play" - >&2 echo "Default User" - >&2 echo "DEF_USER="$DEF_USER - >&2 echo "DEF_PASS=***********" - >&2 echo "New User" - >&2 echo "USERNAME="$USERNAME - >&2 echo "PASSWORD=***********" - >&2 echo "TIMEOUT="$TIMEOUT - >&2 echo "Running cqlsh $TO -u cassandra -p cassandra -e \"describe keyspaces;\" ${CASS_HOSTNAME} ${PORT};" - if cqlsh $TO -u cassandra -p cassandra -e "describe keyspaces;" ${CASS_HOSTNAME} ${PORT}; - then - >&2 echo "Cassandra user still avalable, will continue as usual"; - else - CASSFAIL=true - >&2 echo "$DEF_USER failed, trying with $USERNAME" - if cqlsh $TO -u $USERNAME -p $PASSWORD -e "describe keyspaces;" ${CASS_HOSTNAME} ${PORT}; - then - >&2 echo "Password $USERNAME in play, update Variables" - DEF_USER=$USERNAME - DEF_PASS=$PASSWORD - >&2 echo "DEF_USER="$DEF_USER - >&2 echo "DEF_PASS=***********" - if cqlsh $TO -u $USERNAME -p $PASSWORD -e "describe keyspaces;" ${CASS_HOSTNAME} ${PORT} | grep admin; - then - >&2 echo "Admin table exists, everything looks good" - exit 0; - else - >&2 echo "Admin does not exists but password has changed. Continue as usual with proper username set" - >&2 echo "DEF_USER=" $DEF_USER - fi - else - if [ $CASSFAIL ]; then - >&2 echo "$DEF_USER and $USERNAME fail. DB might need to be initialized again. This shouldn't have happend." - exit 1; - else - >&2 echo "Continue and as usual" - fi - fi - fi - >&2 echo "Running admin.cql file:" - >&2 echo "Running cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin.cql ${CASS_HOSTNAME} ${PORT}" - sleep 1; - if cqlsh $TO -u $DEF_USER -p $DEF_PASS -f /cql/admin.cql ${CASS_HOSTNAME} ${PORT}; - then - >&2 echo "Success - admin.cql - Admin keyspace created"; - else - >&2 echo "Failure - admin.cql"; - exit 0; - fi - >&2 echo "Running admin_pw.cql file:" - >&2 echo "Running cqlsh -u $DEF_USER -p $DEF_PASS -f /cql/admin_pw.cql ${CASS_HOSTNAME} ${PORT}" - sleep 1; - if cqlsh $TO -u $DEF_USER -p $DEF_PASS -f /cql/admin_pw.cql ${CASS_HOSTNAME} ${PORT}; - then - >&2 echo "Success - admin_pw.cql - Password Changed"; - else - >&2 echo "Failure - admin_pw.cql"; - exit 0; - fi - - >&2 echo "Running Test - look for admin keyspace:" - >&2 echo "Running cqlsh -u $USERNAME -p $PASSWORD -e "select * from system_auth.roles;" ${CASS_HOSTNAME} ${PORT}" - sleep 1; - if cqlsh $TO -u $USERNAME -p $PASSWORD -e "select * from system_auth.roles;" ${CASS_HOSTNAME} ${PORT} - then - >&2 echo "Success - running test"; - else - >&2 echo "Failure - running test"; - exit 0; - fi - -else - >&2 echo "Missing CASS_HOSTNAME"; - exit 0; -fi - diff --git a/distribution/cassandra_job/test.cql b/distribution/cassandra_job/test.cql deleted file mode 100644 index 196fea22..00000000 --- a/distribution/cassandra_job/test.cql +++ /dev/null @@ -1,2 +0,0 @@ -DESCRIBE keyspaces; - |