aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/portal/docker/init/mariadb-client/db_migrate.sh
diff options
context:
space:
mode:
authorAndreas Geissler <andreas-geissler@telekom.de>2023-05-24 16:29:11 +0000
committerGerrit Code Review <gerrit@onap.org>2023-05-24 16:29:11 +0000
commit8918760c3eb3d18a670e1e7fe4ee0ba629d8d0d3 (patch)
tree1f0250427fdc6cf72d3279626288d86669292818 /kubernetes/portal/docker/init/mariadb-client/db_migrate.sh
parent8174587eb846fb15bd3bd00135bf91185bfaf8fd (diff)
parentb02ece8cc20c610c82fbb09dd0e54e58ce22c93e (diff)
Merge "[COMMON] Remove not supported components"
Diffstat (limited to 'kubernetes/portal/docker/init/mariadb-client/db_migrate.sh')
-rw-r--r--kubernetes/portal/docker/init/mariadb-client/db_migrate.sh38
1 files changed, 0 insertions, 38 deletions
diff --git a/kubernetes/portal/docker/init/mariadb-client/db_migrate.sh b/kubernetes/portal/docker/init/mariadb-client/db_migrate.sh
deleted file mode 100644
index 2b90a994c3..0000000000
--- a/kubernetes/portal/docker/init/mariadb-client/db_migrate.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh -x
-
-# Copyright © 2018 Amdocs, Bell Canada, AT&T
-#
-# 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.
-
-SQL_DEST_DIR=${SQL_DEST_DIR:-/tmp/sql}
-DB_PORT=${DB_PORT:-3306}
-
-[ -z "$SQL_SRC_DIR" ] && { echo "Error: SQL_SRC_DIR must be provided as an environment variable"; exit 1; }
-[ -z "$DB_USER" ] && { echo "Error: DB_USER must be provided as an environment variable"; exit 1; }
-[ -z "$DB_PASS" ] && { echo "Error: DB_PASS must be provided as an environment variable"; exit 1; }
-[ -z "$DB_HOST" ] && { echo "Error: DB_HOST must be provided as an environment variable"; exit 1; }
-
-mkdir -p $SQL_DEST_DIR
-
-#Find all sql files and copy them to the destination directory
-find "/onap-sources/$SQL_SRC_DIR" -type f -iname "*.sql" | awk -v dest="$SQL_DEST_DIR" '{n=split($1,a,"/"); system(sprintf( "cp %s %s", $1, dest"/"a[n])) }'
-
-
-#Not needed right now?
-#--database=$DB_NAME
-
-#--force to deal with duplicate records in absense of "insert ignore"
-##ERROR 1062 (23000) at line 382: Duplicate entry '2' for key 'PRIMARY'
-
-cd $SQL_DEST_DIR
-cat *.sql | mysql -vv --user=$DB_USER --password=$DB_PASS --host=$DB_HOST --port=$DB_PORT --force