diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2020-10-26 09:59:09 -0400 |
---|---|---|
committer | Pamela Dragosh <pdragosh@research.att.com> | 2020-10-27 19:03:47 +0000 |
commit | c9c871660267ab9a43406cfd02e356309cf7a558 (patch) | |
tree | 589dc3a14b97474609aa2da980a5829480715199 /tutorials/tutorial-enforcement/src/main/docker/config/db/db.sh | |
parent | 54beb22fd5a59c5385d49398d749d5229628dbab (diff) |
Submit Policy Tutorials
So app developers can more easily download and test client code etc.
Issue-ID: POLICY-2876
Change-Id: I360cd0d637150cd0c2353c6284803f4438e96556
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
(cherry picked from commit f0bd7f421948415b1c2f05cb39674f57f72218e0)
Diffstat (limited to 'tutorials/tutorial-enforcement/src/main/docker/config/db/db.sh')
-rw-r--r-- | tutorials/tutorial-enforcement/src/main/docker/config/db/db.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tutorials/tutorial-enforcement/src/main/docker/config/db/db.sh b/tutorials/tutorial-enforcement/src/main/docker/config/db/db.sh new file mode 100644 index 00000000..499764df --- /dev/null +++ b/tutorials/tutorial-enforcement/src/main/docker/config/db/db.sh @@ -0,0 +1,26 @@ +#!/bin/bash -xv +# ============LICENSE_START======================================================= +# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +for db in policyadmin operationshistory +do + mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};" + mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;" +done + +mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;" |