e1b6a5728bce2e90570c093b6d36837990bcb13a
[it/dep.git] / nonrtric / data / prepare_data.sh
1 #!/bin/bash
2
3 #  ============LICENSE_START===============================================
4 #  Copyright (C) 2020 Nordix Foundation. All rights reserved.
5 #  ========================================================================
6 #  Licensed under the Apache License, Version 2.0 (the "License");
7 #  you may not use this file except in compliance with the License.
8 #  You may obtain a copy of the License at
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0
11 #
12 #  Unless required by applicable law or agreed to in writing, software
13 #  distributed under the License is distributed on an "AS IS" BASIS,
14 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 #  See the License for the specific language governing permissions and
16 #  limitations under the License.
17 #  ============LICENSE_END=================================================
18 #
19
20 # This script is populating some data into nonrtric for demo/test purpose.
21 # First this script copies data/ folder into one of the rics, in below case a1-sim-osc-0.
22 # Then from the ric, run populate_data.sh.
23 # populate_data.sh creats policy type/ service/ polocies.
24 #
25 # Why we run the scripts in the ric, not from the host?
26 # Because a1-simulators(ric) are deployed in statefulset,
27 # they are not exposed to outside the k8s cluster.
28 # And we must create policy type into the ric first.
29
30 kubectl -n nonrtric cp run_in_k8s a1-sim-osc-0:/usr/src/app/
31 kubectl -n nonrtric exec -it a1-sim-osc-0 -- bash -c 'cd run_in_k8s/ && ./populate_data.sh'