Added SO-OOF/HAS API document
[optf/osdf.git] / osdfapp.sh
1 #!/bin/bash
2
3 # -------------------------------------------------------------------------
4 #   Copyright (c) 2015-2017 AT&T Intellectual Property
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 #
18 # -------------------------------------------------------------------------
19 #
20
21 # Call osdf app after setting LD_LIBRARY_PATH for oracle client, postgres client, etc.
22
23 cd $(dirname $0)
24
25 # Environment variables below are for ORACLE_HOME and such things, and not needed for 1707 onwards
26 # . ../dependencies/env.sh
27
28 bash ../etc/make-certs.sh  # create the https certificates if they are not present
29
30 set -e
31
32 mkdir -p logs
33
34 if [ ! -e "osdf-optim" ]; then
35 (
36   mkdir tmp
37   cd tmp
38   tar xzf ../../dependencies/SNIROOptimizationPack.tgz
39   mv osdf ../osdf-optim
40   cd ../osdf-optim/pywheels
41   pip install docopt* jsonschema*
42 )
43 cp etc/run-case-local.sh osdf-optim/run/
44 fi
45
46 if [ $# -ge 1 ]; then
47    export SNIRO_MANAGER_CONFIG_FILE="$1"  # this file is passed by the DCAE controller
48 fi
49
50 # export FLASK_APP=osdfapp.py
51
52 # flask run
53 python osdfapp.py # running the app