3 #*******************************************************************************
4 # Copyright 2017 Huawei Technologies Co., Ltd.
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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 #*******************************************************************************
19 CLI_LATEST_BINARY="https://nexus.onap.org/content/repositories/releases/org/onap/cli/cli-zip/1.1.0/cli-zip-1.1.0.zip"
20 CLI_INSTALL_DIR=/opt/onap/cli
23 HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
24 HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
26 if [ $HTTP_PROXY != "no_proxy" ]
28 export http_proxy=$HTTP_PROXY
29 export https_proxy=$HTTPS_PROXY
32 export ONAP_CLI_HOME=$CLI_INSTALL_DIR
33 export CLI_PRODUCT_VERSION=onap-1.1
36 if [ -d $CLI_INSTALL_DIR ]
38 mv $CLI_INSTALL_DIR $CLI_INSTALL_DIR/../cli_`date +"%m-%d-%y-%H-%M-%S"`
42 mkdir -p $CLI_INSTALL_DIR
45 #Download and unzip CLI
46 apt-get install -y wget unzip
52 apt-get install -y openjdk-8-jre
55 wget -O $CLI_ZIP $CLI_LATEST_BINARY
58 if [ ! -d ./data ]; then mkdir ./data; fi
59 if [ ! -d ./onap-cli-schema ]; then mkdir ./onap-cli-schema; fi
60 chmod +x ./bin/onap.sh
62 #Make onap available in path
63 ln ./bin/onap.sh $CLI_BIN