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