From df2716420918b03320c1ecdfd722cf5a85bac280 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Fri, 6 Oct 2017 23:05:25 +0530 Subject: Normalize all env with OPEN_CLI Issue-Id: CLI-66 Change-Id: Iac377cf4cbd3e4d7419fcd41417e4c8bc127a03e Signed-off-by: Kanagaraj Manickam k00365106 --- deployment/docker/src/main/docker/Dockerfile | 23 +++-- .../docker/src/main/docker/docker-compose.yaml | 5 - deployment/http/lighttpd/lighttpd.conf | 2 +- deployment/http/web/index.html | 109 ++++++++++----------- deployment/http/web/onap-cli.png | Bin 29672 -> 0 bytes deployment/http/web/open-cli.png | Bin 0 -> 12119 bytes deployment/zip/src/main/release/bin/oclip.sh | 2 +- 7 files changed, 65 insertions(+), 76 deletions(-) delete mode 100644 deployment/http/web/onap-cli.png create mode 100644 deployment/http/web/open-cli.png (limited to 'deployment') 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 @@ -ONAP CLI -

ONAP Command-line interface (CLI)

-

One Command to command whole Onap !!

-

Provides unified commands to operate ONAP from Linux console and Web console.

- -

To download

-

Please download ONAP CLI here

- -

To install

-

Please follow the instructions given below for installing ONAP CLI.

-
    -
  1. Un-zip the above download file into /opt/onap/cli folder
  2. -
  3. Run the following commands: -
    export ONAP_CLI_HOME=$CLI_INSTALL_DIR -
    export CLI_PRODUCT_VERSION=onap-1.1 -
    -
    cd $CLI_INSTALL_DIR -
    -
    if [ ! -d ./data ]; then mkdir ./data; fi -
    if [ ! -d ./onap-cli-schema ]; then mkdir ./onap-cli-schema; fi -
    -
    chmod +x ./bin/onap.sh -
    -
    #Make onap available in path -
    ln ./bin/onap.sh $CLI_BIN -
    -
    #Print the version -
    onap -v
  4. +Open CLI Platform (OCLIP) + + +

    OPEN Command-line interface (CLI)

    +

    Provides unified commands to operate any cloud enabled software products from Linux/Web console. Configure the following environment variables, before using it:

    +
      +
    1. OPEN_CLI_HOST_URL - Catalog service URL or a service URL
    2. +
    3. OPEN_CLI_HOST_USERNAME - Service user name
    4. +
    5. OPEN_CLI_HOST_PASSWORD - Service password
    - -

    Web Command console

    -

    To open Console, Click Web Command console

    - -

    To Run a command

    - -

    Configure the following environment variables, before using it in Linux console:

    -
      -
    1. HOST_URL - Onap Micro service bus(MSB) URL or a service URL
    2. -
    3. HOST_USERNAME - Onap user name
    4. -
    5. HOST_PASSWORD - Onap user password
    6. +

      To Run a command

      +

      Type oclip from linux console.

      +

      To Run in Interactive mode

      +

      Type oclip from linux console.

      +

      And use the directive set to set the values for following parameters:

      +
        +
      1. host-url - Catalog service URL or a service URL
      2. +
      3. host-username - Service user name
      4. +
      5. host-password - Service password
      - -

      Type onap <command> from Linux console.

      - -

      To Run in Interactive mode

      -

      Type onap from linux console

      -

      Set the product version

      -

      CLI framework is enhanced to handle multiple product versions at same
      -time. so to choose the product version, set evironment variable
      -CLI_PROUDCT_VERSION.

      -

      NOTE: In interactive mode, product version can be selected using
      -typing use <product-version>

      -

      Run onap [-v|–version] to see the CLI and available product version details

      -

      Help

      -

      onap [-h|–help]
      -onap <command> [-h|–help]

      -

      Debug Mode

      +

      Set the product version

      +

      CLI framework is enhanced to handle multiple product versions at same time. so to choose the product version, set evironment variable OPEN_CLI_PROUDCT_IN_USE.

      +

      NOTE: In interactive mode, product version can be selected using typing use

      +

      Run oclip [-v|--version] to see the CLI and available product version details

      +

      Set the parameter values

      +

      Use the directive 'set' for setting the values for parameters and 'unset' for un-seting the values.

      +

      Help

      +

      oclip [-h|--help] oclip [-h|--help]

      +

      Debug Mode

      To run in debug mode, set following environment variables:

      -
        +
        1. OPEN_CLI_DEBUG - By default its false, otherwise Set to true
        2. OPEN_CLI_DEBUG_PORT - By default it is 5005, otherwise set to new TCP port number
        -

        More details

        -

        https://wiki.onap.org

        - +

        +More details +

        +

        +https://wiki.onap.org +

        +

        +To download +

        +

        Please download Open CLI Platform here

        + +Web Command console + +

        Click me here

        + +<<<<<<< 476f5637ae4e816f7abf3536c5eeb156e0af6bed

        To download

        Please download ONAP CLI here

        +======= +>>>>>>> Normalize all env with OPEN_CLI diff --git a/deployment/http/web/onap-cli.png b/deployment/http/web/onap-cli.png deleted file mode 100644 index 60c3e151..00000000 Binary files a/deployment/http/web/onap-cli.png and /dev/null differ diff --git a/deployment/http/web/open-cli.png b/deployment/http/web/open-cli.png new file mode 100644 index 00000000..35f2b1ec Binary files /dev/null and b/deployment/http/web/open-cli.png differ 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 -- cgit 1.2.3-korg