commit | 2120761c296d6c601e5c036a3fd1047afe1b4d9f | [log] [tgz] |
---|---|---|
author | Vincent <shou@us.ibm.com> | Tue Oct 24 14:38:59 2017 -0400 |
committer | Carlos Santana <csantana23@gmail.com> | Wed Nov 15 12:34:09 2017 -0500 |
tree | 50d71957721a9666f6f5f755dc5a2b9894cff219 | |
parent | 2ac591e23fd10c72a3506b67147e5ecbdd445be8 [diff] |
Replace the test cases of action and package with REST implementation (#2621) Partially-closes: #2430
wsk
This project is currently on an experimental stage. We periodically synchronize the source code and test cases of this repository with the CLI folder and the test folder in OpenWhisk. The framework of test cases is under construction for this repository. Please contribute to the CLI folder in OpenWhisk for any CLI changes, before we officially announce the separation of OpenWhisk CLI from OpenWhisk.
The OpenWhisk Command Line Interface (OpenWhisk CLI) is a unified tool that provides a consistent interface to interact with OpenWhisk services. With this tool to download and configure, you are able to manage OpenWhisk services from the command line and automate them through scripts.
The OpenWhisk CLI is available on the release page: click here to download. We currently have binaries available for Linux, Mac OS and windows under amd64 architecture. You can download the binary, which fits your local environment.
You can also choose to build the binaries locally from the source code with Go tool.
Make sure that you have Go installed installing Go, and $GOPATH
is defined Go development environment.
Then download the source code of the OpenWhisk CLI and the dependencies by typing:
$ cd $GOPATH $ go get github.com/apache/incubator-openwhisk-cli
Open an terminal, go to the directory of OpenWhisk CLI home directory, and build the binary via the following command:
$ go build -o wsk
If you would like to build the binary for a specific operating system, you may add the arguments GOOS and GOARCH into the Go build command. Since it is only applicable under amd64 architecture, you have to set GOARCH to amd64. GOOS can be set to “linux” “darwin” or “windows”.
For example, run the following command to build the binary for Linux:
$ GOOS=linux GOARCH=amd64 go build -o wsk
If it is executed successfully, you can find your binary wsk
directly under OpenWhisk CLI home directory.
This is the second choice for you to build the binary. Make sure that you have Docker and gradle on your machine: installing Docker and installing Gradle for your local machine.
After that, open an terminal, go to the directory of OpenWhisk CLI home directory, and build the binary via the following command under Linux or Mac:
$ ./gradlew buildBinaries
or run the following command for Windows:
$ ./gradlew.bat buildBinaries
Finally, you can find the binary wsk
or wsk.exe
in the bin folder under the OpenWhisk CLI home directory. In addition, it is also available under the folder bin/<os>/<cpu arc>/. For example, if your local operating system is Mac, and the CPU architecture is amd64, the binary and its compressed package can also be found under bin/mac/amd64/.
OpenWhisk CLI(wsk
) is produced in a Docker container during the build process which is copied from the Docker container to the local file system in the following directory: bin. This binary will be platform specific, it will only run on the operating system, and CPU architecture that matches the build machine.
If you would like to build the binaries available for all the operating systems and architectures, run the following command:
$ ./gradlew buildBinaries -PcrossCompileCLI=true
Then, you will find the binaries and their compressed packages generated under the folder bin/<os>/<cpu arc>/ for each operating system and CPU architecture pair. We supports both amd64 and 386 for Linux, Mac and Windows operating systems.
When you have the binary, you can copy the binary to any folder, and add folder into the system PATH in order to run the OpenWhisk CLI command. To get the CLI command help, execute the following command:
$ wsk --help
To get CLI command debug information, include the -d, or --debug flag when executing this command.
In order to build OpenWhisk CLI binaries with good quality, OpenWhisk CLI uses Travis CI as the continuous delivery service for Linux and Mac. OpenWhisk CLI is a Go project. Currently Travis CI supports the environments of Linux and Mac, but it is not available for Windows. We will add support of AppVeyor CI in future to run the test cases and build the binary for Windows.