4 # ============LICENSE_START==========================================
 
   5 # ===================================================================
 
   6 # Copyright © 2017 AT&T Intellectual Property. All rights reserved.
 
   7 # ===================================================================
 
   8 # Licensed under the Apache License, Version 2.0 (the "License");
 
   9 # you may not use this file except in compliance with the License.
 
  10 # You may obtain a copy of the License at
 
  12 #        http://www.apache.org/licenses/LICENSE-2.0
 
  14 # Unless required by applicable law or agreed to in writing, software
 
  15 # distributed under the License is distributed on an "AS IS" BASIS,
 
  16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  17 # See the License for the specific language governing permissions and
 
  18 # limitations under the License.
 
  19 # ============LICENSE_END============================================
 
  21 # ECOMP and OpenECOMP are trademarks
 
  22 # and service marks of AT&T Intellectual Property.
 
  26 echo "Creating camundabpmn database . . ." 1>/tmp/mariadb-camundabpmn.log 2>&1
 
  28 mysql -uroot -p$MYSQL_ROOT_PASSWORD << EOF || exit 1
 
  29 DROP DATABASE IF EXISTS camundabpmn;
 
  30 CREATE DATABASE camundabpmn;
 
  31 DROP USER IF EXISTS '${CAMUNDA_DB_USER}';
 
  32 CREATE USER '${CAMUNDA_DB_USER}';
 
  33 GRANT ALL on camundabpmn.* to '${CAMUNDA_DB_USER}' identified by '${CAMUNDA_DB_PASSWORD}' with GRANT OPTION;
 
  37 cd /docker-entrypoint-initdb.d/db-sql-scripts
 
  39 mysql -uroot -p$MYSQL_ROOT_PASSWORD -f < mariadb_engine_7.10.0.sql || exit 1
 
  40 mysql -uroot -p$MYSQL_ROOT_PASSWORD -f < mariadb_identity_7.10.0.sql || exit 1
 
  42 echo "Created camundabpmn database . . ." 1>>/tmp/mariadb-camundabpmn.log 2>&1