diff options
author | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-10-06 23:05:25 +0530 |
---|---|---|
committer | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2017-11-20 12:41:57 +0530 |
commit | df2716420918b03320c1ecdfd722cf5a85bac280 (patch) | |
tree | bef178b6ddb9942665de518090f02ac56fdf6b0b /deployment | |
parent | 20dc78d226aca6cb390586a9e19e522d68d0821b (diff) |
Normalize all env with OPEN_CLI
Issue-Id: CLI-66
Change-Id: Iac377cf4cbd3e4d7419fcd41417e4c8bc127a03e
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'deployment')
-rw-r--r-- | deployment/docker/src/main/docker/Dockerfile | 23 | ||||
-rw-r--r-- | deployment/docker/src/main/docker/docker-compose.yaml | 5 | ||||
-rw-r--r-- | deployment/http/lighttpd/lighttpd.conf | 2 | ||||
-rw-r--r-- | deployment/http/web/index.html | 109 | ||||
-rw-r--r-- | deployment/http/web/onap-cli.png | bin | 29672 -> 0 bytes | |||
-rw-r--r-- | deployment/http/web/open-cli.png | bin | 0 -> 12119 bytes | |||
-rwxr-xr-x | deployment/zip/src/main/release/bin/oclip.sh | 2 |
7 files changed, 65 insertions, 76 deletions
diff --git a/deployment/docker/src/main/docker/Dockerfile b/deployment/docker/src/main/docker/Dockerfile index 777e3ac8..e23a3c1b 100644 --- a/deployment/docker/src/main/docker/Dockerfile +++ b/deployment/docker/src/main/docker/Dockerfile @@ -10,15 +10,18 @@ RUN cd /tmp && curl -O https://storage.googleapis.com/golang/go1.9.linux-amd64.t mv /tmp/gotty/bin/gotty /usr/sbin/ #Environments -ENV OPEN_CLI_HOME /opt/onap/cli +ENV OPEN_CLI_HOME /opt/oclip ENV OPEN_CLI_DEBUG false ENV OPEN_CLI_DEBUG_PORT 5005 ENV OPEN_CLI_MODE console ENV OPEN_CLI_PRODUCT_IN_USE open-cli -ENV HOST_URL http://localhost:8080 -ENV OPEN_USERNAME guest -ENV OPEN_PASSWORD guest +ENV OPEN_CLI_HOST_URL http://localhost:8080 +ENV OPEN_CLI_USERNAME guest +ENV OPEN_CLI_PASSWORD guest + +ENV GOTTY_TITLE_FORMAT {{ .command }} +ENV GOTTY_INDEX $OPEN_CLI_HOME/http/web/occ.html #Copy CLI into docker ADD ./STAGE $OPEN_CLI_HOME @@ -27,18 +30,18 @@ WORKDIR $OPEN_CLI_HOME #Setup the run time environment (RTE) #RTE: CLI RUN chmod +x ./bin/oclip.sh && \ - ln ./bin/oclip.sh /usr/sbin/onap && \ + ln ./bin/oclip.sh /usr/sbin/oclip && \ if [ ! -d ./data ]; then mkdir ./data; fi && \ - if [ ! -d ./onap-cli-schema ]; then mkdir ./onap-cli-schema; fi + if [ ! -d ./open-cli-schema ]; then mkdir ./open-cli-schema; fi #Create the readable README RUN pandoc -t plain $OPEN_CLI_HOME/docs/README.md > $OPEN_CLI_HOME/docs/onap-readme.txt #RTE: lighttpd COPY ./STAGE/http/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf -COPY ./STAGE/http/web /var/www-data/servers/onap-cli/ +COPY ./STAGE/http/web /var/www-data/servers/open-cli/ COPY ./STAGE/http/lighttpd/10-proxy.conf /etc/lighttpd/conf-enabled/ -COPY ./STAGE/installer/cli-*.zip /var/www-data/servers/onap-cli/onap-cli.zip +COPY ./STAGE/installer/cli-*.zip /var/www-data/servers/open-cli/open-cli.zip RUN if [ ! -f /var/log/lighttpd/access.log ]; then touch /var/log/lighttpd/access.log; fi RUN cp /etc/lighttpd/conf-available/10-accesslog.conf /etc/lighttpd/conf-enabled/ @@ -49,9 +52,9 @@ EXPOSE 80 EXPOSE 8080 #Start -ENTRYPOINT if [ "$OPEN_CLI_MODE" = "daemon" ]; then service lighttpd start; gotty --permit-write --reconnect onap; else onap -v && /bin/bash; fi +ENTRYPOINT if [ "$OPEN_CLI_MODE" = "daemon" ]; then service lighttpd start; gotty --permit-write --reconnect oclip; else oclip -v && /bin/bash; fi #Cleanup RUN apt-get purge -y pandoc && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/go /tmp/gotty /tmp/* /var/tmp/* -RUN echo ONAP CLI docker successfully created !! +RUN echo Open CLI docker successfully created !! diff --git a/deployment/docker/src/main/docker/docker-compose.yaml b/deployment/docker/src/main/docker/docker-compose.yaml index 370ca678..dfd3bb20 100644 --- a/deployment/docker/src/main/docker/docker-compose.yaml +++ b/deployment/docker/src/main/docker/docker-compose.yaml @@ -5,9 +5,6 @@ services: image: onap/cli environment: OPEN_CLI_MODE: 'daemon' - expose: - - 80 - - 8080 ports: - 8080:80 - 9090:8080 @@ -26,7 +23,5 @@ services: environment: OPEN_CLI_MODE: 'console' OPEN_CLI_DEBUG: "true" - expose: - - 5005 ports: - 5005:5005 diff --git a/deployment/http/lighttpd/lighttpd.conf b/deployment/http/lighttpd/lighttpd.conf index 03765bf8..07a49644 100644 --- a/deployment/http/lighttpd/lighttpd.conf +++ b/deployment/http/lighttpd/lighttpd.conf @@ -24,7 +24,7 @@ server.modules = ( ) #server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) -#server.errorlog = "/var/log/lighttpd/error.log" +server.errorlog = "/var/log/lighttpd/error.log" server.pid-file = "/var/run/lighttpd.pid" #compress.cache-dir = "/var/cache/lighttpd/compress/" #compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" ) diff --git a/deployment/http/web/index.html b/deployment/http/web/index.html index f8680f08..263d2bd7 100644 --- a/deployment/http/web/index.html +++ b/deployment/http/web/index.html @@ -1,70 +1,61 @@ <!DOCTYPE html><html><head><link rel="icon" href="./open-cli.png"> -<meta charset="utf-8"><title>ONAP CLI</title><style></style></head><body id="preview"> -<h1><a id="OPEN_Commandline_interface_CLI_0"></a>ONAP Command-line interface (CLI)</h1> -<p style="color:blue"><strong>One Command to command whole Onap !!</strong></p> -<p>Provides unified commands to operate ONAP from Linux console and Web console.</p> - -<h2><a id="Download_42"></a>To download</h2> -<p style="color:red">Please download ONAP CLI <a href="./onap-cli.zip">here</a></p> - -<h3><a id="Download_42"></a>To install</h3> -<p>Please follow the instructions given below for installing ONAP CLI.</p> -<ol> -<li>Un-zip the above download file into <b>/opt/onap/cli folder</b></li> -<li>Run the following commands: -<br>export ONAP_CLI_HOME=$CLI_INSTALL_DIR -<br>export CLI_PRODUCT_VERSION=onap-1.1 -<br> -<br>cd $CLI_INSTALL_DIR -<br> -<br>if [ ! -d ./data ]; then mkdir ./data; fi -<br>if [ ! -d ./onap-cli-schema ]; then mkdir ./onap-cli-schema; fi -<br> -<br>chmod +x ./bin/onap.sh -<br> -<br>#Make onap available in path -<br>ln ./bin/onap.sh $CLI_BIN -<br> -<br>#Print the version -<br>onap -v</li> +<meta charset="utf-8"><title>Open CLI Platform (OCLIP)</title><style></style></head><body id="preview"> +<script> +function redirectToConsole(){ + window.location.href="http://"+ window.location.hostname + ":9090"; +} +</script> + +<h1 id="open-command-line-interface-cli">OPEN Command-line interface (CLI)</h1> +<p>Provides unified commands to operate any cloud enabled software products from Linux/Web console. Configure the following environment variables, before using it:</p> +<ol style="list-style-type: decimal"> +<li><strong>OPEN_CLI_HOST_URL</strong> - Catalog service URL or a service URL</li> +<li><strong>OPEN_CLI_HOST_USERNAME</strong> - Service user name</li> +<li><strong>OPEN_CLI_HOST_PASSWORD</strong> - Service password</li> </ol> - -<h2><a id="Console_42"></a>Web Command console</h2> -<p style="color:blue">To open Console, Click <img src="./onap-cli.png" alt="Web Command console" style="width:30px;height:22px;" onclick="redirectToConsole();"> </p> - -<h2><a id="To_Run_a_command_12"></a>To Run a command</h2> - -<p>Configure the following environment variables, before using it in Linux console:</p> -<ol> -<li><strong>HOST_URL</strong> - Onap Micro service bus(MSB) URL or a service URL</li> -<li><strong>HOST_USERNAME</strong> - Onap user name</li> -<li><strong>HOST_PASSWORD</strong> - Onap user password</li> +<h2 id="to-run-a-command">To Run a command</h2> +<p>Type <strong>oclip <command></strong> from linux console.</p> +<h2 id="to-run-in-interactive-mode">To Run in Interactive mode</h2> +<p>Type <strong>oclip</strong> from linux console.</p> +<p>And use the directive set to set the values for following parameters:</p> +<ol style="list-style-type: decimal"> +<li><strong>host-url</strong> - Catalog service URL or a service URL</li> +<li><strong>host-username</strong> - Service user name</li> +<li><strong>host-password</strong> - Service password</li> </ol> - -<p>Type <strong>onap <command></strong> from Linux console.</p> - -<h2><a id="To_Run_in_Interactive_mode_16"></a>To Run in Interactive mode</h2> -<p>Type <strong>onap</strong> from linux console</p> -<h2><a id="Set_the_product_version_20"></a>Set the product version</h2> -<p>CLI framework is enhanced to handle multiple product versions at same<br> -time. so to choose the product version, set evironment variable<br> -<strong>CLI_PROUDCT_VERSION</strong>.</p> -<p>NOTE: In interactive mode, product version can be selected using<br> -typing <strong>use <product-version></strong></p> -<p>Run <em>onap [-v|–version]</em> to see the CLI and available product version details</p> -<h2><a id="Help_31"></a>Help</h2> -<p><em>onap [-h|–help]</em><br> -<em>onap <command> [-h|–help]</em></p> -<h2><a id="Debug_Mode_36"></a>Debug Mode</h2> +<h2 id="set-the-product-version">Set the product version</h2> +<p>CLI framework is enhanced to handle multiple product versions at same time. so to choose the product version, set evironment variable <strong>OPEN_CLI_PROUDCT_IN_USE</strong>.</p> +<p>NOTE: In interactive mode, product version can be selected using typing <strong>use <product-version></strong></p> +<p>Run <em>oclip [-v|--version]</em> to see the CLI and available product version details</p> +<h2 id="set-the-parameter-values">Set the parameter values</h2> +<p>Use the directive 'set' for setting the values for parameters and 'unset' for un-seting the values.</p> +<h2 id="help">Help</h2> +<p><em>oclip [-h|--help]</em> <em>oclip <command> [-h|--help]</em></p> +<h2 id="debug-mode">Debug Mode</h2> <p>To run in debug mode, set following environment variables:</p> -<ol> +<ol style="list-style-type: decimal"> <li>OPEN_CLI_DEBUG - By default its false, otherwise Set to true</li> <li>OPEN_CLI_DEBUG_PORT - By default it is 5005, otherwise set to new TCP port number</li> </ol> -<h2><a id="More_details_42"></a>More details</h2> -<p><a href="https://wiki.onap.org">https://wiki.onap.org</a></p> - +<h2> +<a id="More_details_42"></a>More details +</h2> +<p> +<a href="https://wiki.onap.org">https://wiki.onap.org</a> +</p> +<h2> +<a id="Download_42"></a>To download +</h2> +<p style="color:red">Please download Open CLI Platform <a href="./open-cli.zip">here</a></p> + +<a id="Console_42"></a>Web Command console +</h2> +<p style="color:blue">Click me <a onclick="redirectToConsole();">here</a></p> + +<<<<<<< 476f5637ae4e816f7abf3536c5eeb156e0af6bed <h2><a id="Download_42"></a>To download</h2> <p style="color:red">Please download ONAP CLI <a href="./open-cli.zip">here</a></p> +======= +>>>>>>> Normalize all env with OPEN_CLI </body></html> diff --git a/deployment/http/web/onap-cli.png b/deployment/http/web/onap-cli.png Binary files differdeleted file mode 100644 index 60c3e151..00000000 --- a/deployment/http/web/onap-cli.png +++ /dev/null diff --git a/deployment/http/web/open-cli.png b/deployment/http/web/open-cli.png Binary files differnew file mode 100644 index 00000000..35f2b1ec --- /dev/null +++ b/deployment/http/web/open-cli.png diff --git a/deployment/zip/src/main/release/bin/oclip.sh b/deployment/zip/src/main/release/bin/oclip.sh index e4a58502..a3d51940 100755 --- a/deployment/zip/src/main/release/bin/oclip.sh +++ b/deployment/zip/src/main/release/bin/oclip.sh @@ -18,7 +18,7 @@ if [ -z "$OPEN_CLI_HOME" ] then - echo "There is no OPEN_CLI_HOME" + echo "OPEN_CLI_HOME is not set." exit 1 fi |