cf-html5-apps-repo-cli-plugin

command module
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2020 License: Apache-2.0, BSD-3-Clause, MIT Imports: 9 Imported by: 0

README

GoDoc

HTML5 Applications Repository CLI Plugin

https://sap.github.io/cf-html5-apps-repo-cli-plugin

Description

HTML5 Applications Repository CLI Plugin is a plugin for Cloud Foundry CLI tool that aims to provide easy command line access to APIs exposed by HTML5 Application Repository service. It allows to:

  • inspect HTML5 applications of current space
  • list files of specific HTML5 application
  • view HTML5 applications exposed by business services that are bound to Approuter application
  • download single file, application or the whole bucket of applications uploaded with the same service instance of html5-apps-repo service
  • push one or multiple applications using existing service instances of app-host plan, or create new ones for you on-the-fly

Prerequisites

  • Download and install Cloud Foundry CLI (≥6.36.1)
  • Download and install GO (≥1.11.4)

Installation

If you want to use latest released version and not intend to modify it, you can install plugin directly from Cloud Foundry Community plugins repository:

cf install-plugin -r CF-Community "html5-plugin"

Otherwise, you can build from source code:

  • Clone or download current repository to /src folder of your default GOPATH
    • On Unix-like systems $HOME/go/src
    • On Windows systems %USERPROFILE%\go\src
  • Open terminal/console in the root folder of repository
  • Build sources with go build
  • Install CF CLI plugin
    • On Unix-like systems cf install-plugin -f cf-html5-apps-repo-cli-plugin
    • On Windows systems cf install-plugin -f cf-html5-apps-repo-cli-plugin.exe

Upgrade

To upgrade version of HTML5 Applications Repository CLI Plugin, you will need to uninstall previous version with command:

cf uninstall-plugin html5-plugin

and then install new version as described in Installation section.

Usage

The HTML5 Applications Repository CLI Plugin supports the following commands:

html5-list
History
Version Changes
v1.4.0 The --destination option added
v1.3.0 The --name option added
v1.1.0 The --url option added
v1.0.0 Added in v1.0.0
NAME:
   html5-list - Display list of HTML5 applications or file paths of specified application

USAGE:
   cf html5-list [APP_NAME] [APP_VERSION] [APP_HOST_ID|-n APP_HOST_NAME] [-d|-a CF_APP_NAME [-u]]

OPTIONS:
   -APP_NAME          Application name, which file paths should be listed.
                      If not provided, list of applications will be printed
   -APP_VERSION       Application version, which file paths should be listed.
                      If not provided, current active version will be used
   -APP_HOST_ID       GUID of html5-apps-repo app-host service instance that
                      contains application with specified name and version
   -APP_HOST_NAME     Name of html5-apps-repo app-host service instance that 
                      contains application with specified name and version
   --name, -n         Use html5-apps-repo app-host service instance name
                      instead of APP_HOST_ID
   --destination, -d  List HTML5 applications exposed via destinations with 
                      sap.cloud.service and html5-apps-repo.app_host_id 
                      properties 
   --app, -a          Cloud Foundry application name, which is bound to
                      services that expose UI via html5-apps-repo
   --url, -u          Show conventional URLs of applications, when accessed 
                      via Cloud Foundry application specified with --app flag
                      or when --destination flag is used                   
html5-get
History
Version Changes
v1.3.0 The --name option added
v1.0.0 Added in v1.0.0
NAME:
   html5-get - Fetch content of single HTML5 application file by path,
               or whole application by name and version

USAGE:
   cf html5-get PATH|APPKEY|--all [APP_HOST_ID|-n APP_HOST_NAME] [--out OUTPUT]

OPTIONS:
   --all              Flag that indicates that all applications of specified
                      APP_HOST_ID should be fetched
   --out, -o          Output file (for single file) or output directory (for
                      application). By default, standard output and current
                      working directory
   --name, -n         Use html5-apps-repo app-host service instance name 
                      instead of APP_HOST_ID                   
   -APPKEY            Application name and version
   -APP_HOST_ID       GUID of html5-apps-repo app-host service instance that
                      contains application with specified name and version
   -APP_HOST_NAME     Name of html5-apps-repo app-host service instance that 
                      contains application with specified name and version                   
   -PATH              Application file path, starting 
                      from /<appName-appVersion>
html5-push
History
Version Changes
v1.4.0 The --destination and --service options added
v1.2.0 The --name and --redeploy options added
v1.0.0 Added in v1.0.0
NAME:
   html5-push - Push HTML5 applications to html5-apps-repo service

USAGE:
   cf html5-push [-d|-s SERVICE_INSTANCE_NAME] [-r|-n APP_HOST_NAME] [PATH_TO_APP_FOLDER ...] [APP_HOST_ID]

OPTIONS:
   -APP_HOST_ID              GUID of html5-apps-repo app-host service instance 
                             that contains application with specified name and
                             version
   -APP_HOST_NAME            Name of app-host service instance to which 
                             applications should be deployed
   -PATH_TO_APP_FOLDER       One or multiple paths to folders containing 
                             manifest.json and xs-app.json files
   --destination,-d          Create subaccount level destination with
                             credentials to access HTML5 applications
   --service,-s              Create subaccount level destination with
                             credentials of the service instance
   --name,-n                 Use app-host service instance with specified name
   --redeploy,-r             Redeploy HTML5 applications. All applications
                             should be previously deployed to same service 
                             instance
html5-delete
History
Version Changes
v1.4.0 The --destination option added
v1.3.0 The --name option added
v1.1.0 Added in v1.1.0
NAME:
   html5-delete - Delete one or multiple app-host service instances or content 
                  uploaded with these instances

USAGE:
   cf html5-delete [--content|--destination] APP_HOST_ID|-n APP_HOST_NAME [...]

OPTIONS:
   --content                  delete content only
   --destination,-d           delete destinations that point to service instances to be deleted
   --name,-n                  Use app-host service instance with specified name
   -APP_HOST_ID               GUID of html5-apps-repo app-host service instance
   -APP_HOST_NAME             Name of html5-apps-repo app-host service instance
html5-info
History
Version Changes
v1.3.0 The --name option added
v1.1.0 Added in v1.1.0
NAME:
   html5-info - Get size limit and status of app-host service instances

USAGE:
   cf html5-info [APP_HOST_ID|-n APP_HOST_NAME ...]

OPTIONS:
   --name,-n          Use app-host service instance with specified name
   -APP_HOST_ID       GUID of html5-apps-repo app-host service instance
   -APP_HOST_NAME     Name of html5-apps-repo app-host service instance

Configuration

The configuration of the HTML5 CLI Plugin is done via environment variables. The following are supported:

  • DEBUG=1 - enables trace logs with detailed information about currently running steps
  • HTML5_SERVICE_NAME - name of the service in CF marketplace (default: html5-apps-repo)
  • HTML5_RUNTIME_URL - URL of HTML5 runtime to serve business service destinations (default: https://<tenant>.cpp.<landscape_url>)

Troubleshooting

Services and Service Keys

In order to work with HTML5 Application Repository API, HTML5 Applications Repository CLI Plugin is required to send JWT with every request. To obtain it HTML5 Applications Repository CLI Plugin creates temporarry artifacts, such as service instances of html5-apps-repo service and service keys for these service instances. If one of the flows invoked by HTML5 Applications Repository CLI Plugin fails in the middle, these artifacts may remain in the current space.

Limitations

Currently, you can't use HTML5 Applications Repository CLI Plugin with global -v flag due to limitations of cf curl that is used internally by plugin.

How to obtain support

If you need any support, have any question or have found a bug, please report it in the GitHub bug tracking system. We shall get back to you.

License

This project is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.

Documentation

Overview

HTML5 Applications Repository CLI Plugin is a plugin for Cloud Foundry CLI tool that aims to provide easy command line access to APIs exposed by HTML5 Application

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL