This is an automated email from the ASF dual-hosted git repository. mrutkowski pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/openwhisk-cli.git
The following commit(s) were added to refs/heads/master by this push: new 9cbb032 Remove last Godeps, update Gogradle for gomod and Ansible setup (#496) 9cbb032 is described below commit 9cbb032885b4225e6c802fec041bd91e57a5e7f7 Author: Matt Rutkowski <mrutk...@us.ibm.com> AuthorDate: Tue Mar 2 12:09:25 2021 -0600 Remove last Godeps, update Gogradle for gomod and Ansible setup (#496) * Remove last Godeps, update Gogradle for gomod and Ansible setup * Remove last Godeps, update Gogradle for gomod and Ansible setup * Add dependson clause to build i18n (i18n_resources.go) before the goBuild task * Update build.gradle to use Exec tasks for go-bindata and i18n * Update build.gradle to use Exec tasks for go-bindata and i18n * Task goGetBinData for i18n support must run as a deps. of goPrepare not goBuild * Cleanup build.gradle; remove old tasks * Fix golint command * Fix golint command * Fix golint command * Use latest go.mod * Use latest go.mod * Use latest go.mod * Remove goVet and gofmt tasks as they use older go conventions * Remove goVet and gofmt tasks as they use older go conventions * Remove failing localhost/SDK scala tests * Try some regex fixes for scala SDK tests * Fix regex for SDK scala tests; Remove govendor from README * Revamp README to reflect current Go mod and Gradle build instructions * Revamp README to reflect current Go mod and Gradle build instructions * Revamp README to reflect current Go mod and Gradle build instructions * Revamp README to reflect current Go mod and Gradle build instructions --- .gitignore | 13 +- .travis.yml | 2 +- Godeps/Godeps.json | 154 ---------- Godeps/Readme | 5 - README.md | 330 ++++++++++++++------- build.gradle | 107 +++---- go.mod | 14 +- go.sum | 32 +- .../src/test/scala/system/basic/WskSdkTests.scala | 6 +- tools/travis/test_openwhisk.sh | 8 +- 10 files changed, 337 insertions(+), 334 deletions(-) diff --git a/.gitignore b/.gitignore index 1128fb1..b831ede 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,14 @@ -javascript/ + +# Built or generated files +openwhisk-cli wsk wsk.exe scripts -Godeps/_workspace +Godeps/ *~ # IDE-related exclusions +/.vscode/ .idea/ *.iml @@ -20,3 +23,9 @@ wski18n/i18n_resources.go bin/ tests/build/ tests/out/ + +# Scala +/.metals/ + +# Misc +javascript/ diff --git a/.travis.yml b/.travis.yml index 6bf7b01..bf6a223 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,7 +52,7 @@ install: before_script: - cd $TRAVIS_BUILD_DIR - ./gradlew --console=plain checkScalafmtAll - - GO_FILES=$(find . -iname '*.go' -type f | grep -v /vendor/) + - GO_FILES=$(find . -iname '*.go' -type f) - test -z "$(gofmt -s -l $(echo $GO_FILES))" - cd $TRAVIS_BUILD_DIR/.. - git clone https://github.com/apache/openwhisk-utilities.git diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json deleted file mode 100644 index 6996cb9..0000000 --- a/Godeps/Godeps.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "ImportPath": "github.com/apache/openwhisk-cli", - "GoVersion": "go1.14", - "GodepVersion": "v80", - "Deps": [ - { - "ImportPath": "github.com/apache/openwhisk-client-go/whisk", - "Comment": "1.1.0-3-g17d5563", - "Rev": "17d556327cd39cb6d6854667fa75c35ef9f2e6f1" - }, - { - "ImportPath": "github.com/apache/openwhisk-client-go/wski18n", - "Comment": "1.1.0-3-g17d5563", - "Rev": "17d556327cd39cb6d6854667fa75c35ef9f2e6f1" - }, - { - "ImportPath": "github.com/apache/openwhisk-wskdeploy/cmd", - "Comment": "latest-4-g3b4b09d", - "Rev": "3b4b09d539d2591c903acbb7b9257beef49110dd" - }, - { - "ImportPath": "github.com/apache/openwhisk-wskdeploy/conductor", - "Comment": "latest-4-g3b4b09d", - "Rev": "3b4b09d539d2591c903acbb7b9257beef49110dd" - }, - { - "ImportPath": "github.com/apache/openwhisk-wskdeploy/dependencies", - "Comment": "latest-4-g3b4b09d", - "Rev": "3b4b09d539d2591c903acbb7b9257beef49110dd" - }, - { - "ImportPath": "github.com/apache/openwhisk-wskdeploy/deployers", - "Comment": "latest-4-g3b4b09d", - "Rev": "3b4b09d539d2591c903acbb7b9257beef49110dd" - }, - { - "ImportPath": "github.com/apache/openwhisk-wskdeploy/parsers", - "Comment": "latest-4-g3b4b09d", - "Rev": "3b4b09d539d2591c903acbb7b9257beef49110dd" - }, - { - "ImportPath": "github.com/apache/openwhisk-wskdeploy/runtimes", - "Comment": "latest-4-g3b4b09d", - "Rev": "3b4b09d539d2591c903acbb7b9257beef49110dd" - }, - { - "ImportPath": "github.com/apache/openwhisk-wskdeploy/utils", - "Comment": "latest-4-g3b4b09d", - "Rev": "3b4b09d539d2591c903acbb7b9257beef49110dd" - }, - { - "ImportPath": "github.com/apache/openwhisk-wskdeploy/webaction", - "Comment": "latest-4-g3b4b09d", - "Rev": "3b4b09d539d2591c903acbb7b9257beef49110dd" - }, - { - "ImportPath": "github.com/apache/openwhisk-wskdeploy/wskderrors", - "Comment": "latest-4-g3b4b09d", - "Rev": "3b4b09d539d2591c903acbb7b9257beef49110dd" - }, - { - "ImportPath": "github.com/apache/openwhisk-wskdeploy/wskenv", - "Comment": "latest-4-g3b4b09d", - "Rev": "3b4b09d539d2591c903acbb7b9257beef49110dd" - }, - { - "ImportPath": "github.com/apache/openwhisk-wskdeploy/wski18n", - "Comment": "latest-4-g3b4b09d", - "Rev": "3b4b09d539d2591c903acbb7b9257beef49110dd" - }, - { - "ImportPath": "github.com/apache/openwhisk-wskdeploy/wskprint", - "Comment": "latest-4-g3b4b09d", - "Rev": "3b4b09d539d2591c903acbb7b9257beef49110dd" - }, - { - "ImportPath": "github.com/cloudfoundry/jibber_jabber", - "Rev": "bcc4c8345a21301bf47c032ff42dd1aae2fe3027" - }, - { - "ImportPath": "github.com/fatih/color", - "Comment": "v1.5.0", - "Rev": "570b54cabe6b8eb0bc2dfce68d964677d63b5260" - }, - { - "ImportPath": "github.com/ghodss/yaml", - "Comment": "v1.0.0-14-g25d852a", - "Rev": "25d852aebe32c875e9c044af3eef9c7dc6bc777f" - }, - { - "ImportPath": "github.com/google/go-querystring/query", - "Rev": "9235644dd9e52eeae6fa48efd539fdc351a0af53" - }, - { - "ImportPath": "github.com/hokaccha/go-prettyjson", - "Rev": "f75235bd99dad4e98ff360db8372d5c0ef1d054a" - }, - { - "ImportPath": "github.com/inconshreveable/mousetrap", - "Comment": "v1.0", - "Rev": "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" - }, - { - "ImportPath": "github.com/mattn/go-colorable", - "Comment": "v0.0.7", - "Rev": "d228849504861217f796da67fae4f6e347643f15" - }, - { - "ImportPath": "github.com/mattn/go-isatty", - "Rev": "66b8e73f3f5cda9f96b69efd03dd3d7fc4a5cdb8" - }, - { - "ImportPath": "github.com/mitchellh/go-homedir", - "Comment": "v1.1.0", - "Rev": "af06845cf3004701891bf4fdb884bfe4920b3727" - }, - { - "ImportPath": "github.com/nicksnyder/go-i18n/i18n", - "Comment": "v1.6.0-1-g991e81c", - "Rev": "991e81cc94f6c54209edb3192cb98e3995ad71c1" - }, - { - "ImportPath": "github.com/nicksnyder/go-i18n/i18n/bundle", - "Comment": "v1.6.0-1-g991e81c", - "Rev": "991e81cc94f6c54209edb3192cb98e3995ad71c1" - }, - { - "ImportPath": "github.com/nicksnyder/go-i18n/i18n/language", - "Comment": "v1.6.0-1-g991e81c", - "Rev": "991e81cc94f6c54209edb3192cb98e3995ad71c1" - }, - { - "ImportPath": "github.com/nicksnyder/go-i18n/i18n/translation", - "Comment": "v1.6.0-1-g991e81c", - "Rev": "991e81cc94f6c54209edb3192cb98e3995ad71c1" - }, - { - "ImportPath": "github.com/spf13/cobra", - "Rev": "6e91dded25d73176bf7f60b40dd7aa1f0bf9be8d" - }, - { - "ImportPath": "github.com/spf13/pflag", - "Rev": "5ccb023bc27df288a957c5e994cd44fd19619465" - }, - { - "ImportPath": "golang.org/x/sys/unix", - "Rev": "9a2e24c3733eddc63871eda99f253e2db29bd3b9" - }, - { - "ImportPath": "gopkg.in/yaml.v2", - "Rev": "eb3733d160e74a9c7e442f435eb3bea458e1d19f" - } - ] -} diff --git a/Godeps/Readme b/Godeps/Readme deleted file mode 100644 index 4cdaa53..0000000 --- a/Godeps/Readme +++ /dev/null @@ -1,5 +0,0 @@ -This directory tree is generated automatically by godep. - -Please do not edit. - -See https://github.com/tools/godep for more information. diff --git a/README.md b/README.md index 0c153d4..a6e9c5f 100644 --- a/README.md +++ b/README.md @@ -24,165 +24,297 @@ [![Join Slack](https://img.shields.io/badge/join-slack-9B69A0.svg)](http://slack.openwhisk.org/) [![Twitter](https://img.shields.io/twitter/follow/openwhisk.svg?style=social&logo=twitter)](https://twitter.com/intent/follow?screen_name=openwhisk) -OpenWhisk Command-line Interface (CLI) is a unified tool that -provides a consistent interface to interact with OpenWhisk services. +OpenWhisk Command-line Interface (CLI) is a unified tool that provides a consistent interface to interact with OpenWhisk services. -# Where to download the binary of OpenWhisk CLI +## Getting started -The OpenWhisk CLI is available on the [releases page](https://github.com/apache/openwhisk-cli/releases). We -currently have binaries available for Linux, Mac OS and Windows under i386 and -amd64 architectures. Linux versions are also available under Linux on Z, Power -and 64-bit ARM architectures. You can download the binary, which fits your -local environment. +Here are some quick links to help you get started: -# How to build the binary locally +- [Downloading released binaries](#downloading-released-binaries) for Linux, Mac OS and Windows +- [Running the `wsk` CLI](#running-the-wsk-cli) executable +- [Building the project](#building-the-project) - download and build the GoLang source code +- [Contributing to the project](#contributing-to-the-project) - join us! -The OpenWhisk CLI is written in the Go language. You have two options to build -the binary locally: +--- -1. Build using the packaged Gradle scripts (including the 'gogradle' plugin) now the preferred build method. -2. Compile in your local Go environment +## Downloading released binaries -## Build the binary with Gradle +Executable binaries of the OpenWhisk CLI are available for download on the project's GitHub [releases page](https://github.com/apache/openwhisk-cli/releases). -**Note:** For those who may have used the Gradle build previously, it has been -re-engineered to no longer required Docker or Go to be pre-installed on your -system. Using the [gogradle](https://github.com/gogradle/gogradle) plugin, -Gradle now uses a preexisting Go environment to build if it can be located, or -downloads and installs an environment within the build directory. +We currently provide binaries for the following Operating Systems (OS) and architecture combinations: -To build with Gradle, open an terminal, go to the directory of OpenWhisk CLI -home directory, and build the binary via the following command under Linux or -Mac: +Operating System | Architectures +--- | --- +Linux | i386, AMD64, ARM, ARM64, PPC64 (Power), S/390 and IBM Z +Mac OS (Darwin) | 386<sup>[1](#1)</sup>, AMD64 +Windows | 386, AMD64 -``` -$ ./gradlew compile -PnativeCompile -``` +1. Mac OS, 32-bit (386) released versions are not available for builds using Go lang version 1.15 and greater. -or run the following command for Windows: +We also provide instructions on how to build your own binaries from source code. See [Building the project](#building-the-project). -``` -$ ./gradlew.bat compile -PnativeCompile -``` +--- -After the build, you can find the binary `wsk` or `wsk.exe` in the build folder -under the OpenWhisk CLI home directory. In addition, it is also available under -the folder `build/<os>-<architecture>/`. For example, if your local operating -system is Mac, and the CPU architecture is amd64, the binary can be found at -`build/mac-amd64/wsk` and `build/mac`. +## Running the `wsk` CLI -If you would like to build the binaries available for all the operating systems -and architectures, run the following command: +You can copy the `wsk` binary to any folder, and add the folder to your system `PATH` in order to run the OpenWhisk CLI command from anywhere on your system. To get the CLI command help, execute the following: ``` -$ ./gradlew compile +$ wsk --help ``` -The build script will place the binaries into the folder `build/<os>-<cpu arc>/` -for each operating system and CPU architecture pair. The build supports both -amd64 and 386 for Linux, Mac and Windows operating systems, as well as Power, -64-bit ARM, and S390X architectures for Linux. +To get CLI command debug information, include the `-d`, or `--debug` flag when executing this command. -A binary compatible with the local architecture will be placed at `build/wsk` -(`build\wsk.exe` on Windows). +--- -To specify a build for specific architectures, you can provide a comma or -space-delimited list of hyphenated os-architecture pairs, like this: +## Building the project -``` -$ ./gradlew compile -PbuildPlatforms=linux-amd64,mac-amd64,windows-amd64 -``` +### GoLang setup -The build library understands most representations of most Operating Systems. +The Openwhisk CLI is a GoLang program so you will first need to [Download and install GoLang](https://golang.org/dl/) onto your local machine. -Tests can be run using the Gradle script: +> **Note** Go version 1.15 or higher is recommended +Make sure your `$GOPATH` is defined correctly in your environment. For detailed setup of your GoLang development environment, please read [How to Write Go Code](https://golang.org/doc/code.html). + +### Download the source code from GitHub + +As the code is managed using GitHub, it is easiest to retrieve the code using the `git clone` command. + +if you just want to build the code and do not intend to be a Contributor, you can clone the latest code from the Apache repository: + +```sh +git clone g...@github.com:apache/openwhisk-cli ``` -$ ./gradlew goTest -PgoTags=unit -$ ./gradlew goTest -PgoTags=native + +or you can specify a release (tag) if you do not want the latest code by using the `--branch <tag>` flag. For example, you can clone the source code for the tagged 1.1.0 [release](https://github.com/apache/openwhisk-cli/releases/tag/1.1.0) + +```sh +git clone --branch 1.1.0 g...@github.com:apache/openwhisk-clie ``` -Integration tests are best left to the Travis build as they depend on a fully -functional OpenWhisk environment. +You can also pull the code from a fork of the repository. If you intend to become a Contributor to the project, read the section [Contributing to the project](#contributing-to-the-project) below on how to setup a fork. -## Compile the binary using your local Go environment +### Build using `go build` -Make sure that you have [Go installed](https://golang.org/doc/install), and `$GOPATH` is defined in your [Go development -environment](https://golang.org/doc/code.html). +Use the Go utility to build the ```wsk`` binary. -Then download the source code of the OpenWhisk CLI and the dependencies by -typing: +Change into the cloned project directory and use `go build` with the target output name for the binary: +```sh +$ go build -o wsk ``` -$ cd $GOPATH -$ go get github.com/apache/openwhisk-cli -$ cd $GOPATH/src/github.com/apache/openwhisk-cli + +an executable named `wsk` will be created in the project directory compatible with your current operating system and architecture. + +#### Building for other Operating Systems (GOOS) and Architectures (GOARCH) + +If you would like to build the binary for a specific operating system and processor architecture, you may add the arguments `GOOS` and `GOARCH` into the Go build command (as inline environment variables). + +For example, run the following command to build the binary for 64-bit Linux: + +```sh +$ GOOS=linux GOARCH=amd64 go build -o wsk ``` -The CLI internationalization should be generated dynamically using the -bindata tool: +If successful, an executable named `wsk` will be created in the project directory compatible with your current operating system and architecture. +Supported value combinations include: + +`GOOS` | `GOARCH` +--- | --- +linux | 386 (32-bit), amd64 (64-bit), s390x (S/390, Z), ppc64le (Power), arm (32-bit), arm64 (64-bit) +darwin (Mac OS) | amd64 +windows | 386 (32-bit), amd64 (64-bit) + +### Build using Gradle + +The project includes its own packaged version of Gradle called Gradle Wrapper which is invoked using the `./gradlew` command on Linux/Unix/Mac or `gradlew.bat` on Windows. + +1. Gradle requires requires you to [install Java JDK version 8](https://gradle.org/install/) or higher + +1. Clone the `openwhisk-cli` repo: + + ```sh + git clone https://github.com/apache/openwhisk-cli + ``` + + and change into the project directory. + +1. Cross-compile binaries for all supported Operating Systems and Architectures: + + ```sh + ./gradlew goBuild + ``` + + Upon a successful build, the `wsk` binaries can be found under the corresponding `build/<os>-<architecture>/` folder of your project: + + ```sh + $ ls build + darwin-amd64 linux-amd64 linux-arm64 linux-s390x windows-amd64 + linux-386 linux-arm linux-ppc64le windows-386 + ``` + +#### Compiling for a single OS/ARCH + +1. View gradle build tasks for supported Operating Systems and Architectures: + + ```sh + ./gradlew tasks + ``` + + you will see build tasks for supported OS/ARCH combinations: + + ```sh + Gogradle tasks + -------------- + buildDarwinAmd64 - Custom go task. + buildLinux386 - Custom go task. + buildLinuxAmd64 - Custom go task. + buildLinuxArm - Custom go task. + buildLinuxArm64 - Custom go task. + buildLinuxPpc64le - Custom go task. + buildLinuxS390x - Custom go task. + buildWindows386 - Custom go task. + buildWindowsAmd64 - Custom go task. + ``` + + > **Note**: The `buildWindows386` option is only supported on Golang versions less than 1.15. + +1. Build using one of these tasks, for example: + + ```sh + $ ./gradlew buildDarwinAmd64 + ``` + +> **Note** You may use the `compile` Gradle task to build a subset of the supported platforms using the `buildPlatforms` parameter and supplying a comma-separated list, for example: +`-PbuildPlatforms=linux-amd64,mac-amd64,windows-amd64` + +#### Using your own local Gradle to build + +Alternatively, you can choose to [Install Gradle](https://gradle.org/install/) and use it instead of the project's Gradle Wrapper. If so, you would use the `gradle` command instead of `gradlew`. If you do elect to use your own Gradle, verify its version is `6.6` or higher: + +```sh +gradle -version ``` + +> **Note** If using your own local Gradle installation, use the `gradle` command instead of the `./gradlew` command in the build instructions below. + +### Building for internationalization (i18n) + +The CLI internationalization is generated dynamically using the `bindata` tool as part of the gradle build. If you need to install it manually, you may use: + +```sh $ go get -u github.com/jteeuwen/go-bindata/... $ go-bindata -pkg wski18n -o wski18n/i18n_resources.go wski18n/resources ``` -The project includes a `vendor/vendor.json` and you can lock down -dependencies for a clean build of the CLI by populating the `vendor` folder. +### Running unit tests -``` -$ go get -u github.com/kardianos/govendor # Install govendor tool -$ govendor sync # Download and install packages with specified dependencies. -``` +##### Using Go -NOTE: As a temporary workaround, you have to remove a redundant instance of `spf13/cobra` -in the vendor folder. See this [issue](https://github.com/apache/openwhisk-cli/issues/398) for details. -``` -$ rm -rf vendor/github.com/spf13 +```sh +$ cd commands +$ go test -tags=unit -v ``` -Now you can build the binary. +> **Note** A large number of CLI tests today are not yet available as Go tests. + +##### Using gradle + +All tests can be run using the Gradle script: + ``` -$ go build -o wsk +$ ./gradlew goTest -PgoTags=unit +$ ./gradlew goTest -PgoTags=native ``` -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. `GOOS` can -be set to `linux`, `darwin`, or `windows`. +### Running integration tests + +Integration tests are best left to the Travis build as they depend on a fully functional OpenWhisk environment. + +--- + +## Contributing to the project + +### Git repository setup + +1. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the Apache repository + + If you intend to contribute code, you will want to fork the `apache/openwhisk-cli` repository into your github account and use that as the source for your clone. + +1. Clone the repository from your fork: + + ```sh + git clone g...@github.com:${GITHUB_ACCOUNT_USERNAME}/openwhisk-cli.git + ``` -For example, run the following command to build the binary for Linux: +1. Add the Apache repository as a remote with the `upstream` alias: + ```sh + git remote add upstream g...@github.com:apache/openwhisk-cli + ``` + + You can now use `git push` to push local `commit` changes to your `origin` repository and submit pull requests to the `upstream` project repository. + +1. Optionally, prevent accidental pushes to `upstream` using this command: + + ```sh + git remote set-url --push upstream no_push + ``` + +> Be sure to [Sync your fork](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) before starting any contributions to keep it up-to-date with the upstream repository. + +### Adding new dependencies + +Please use `go get` to add new dependencies to the `go.mod` file: + +```sh +go get github.com/project/libname@v1.2.0 ``` -$ GOOS=linux GOARCH=amd64 go build -o wsk-$GOOS-$GOARCH + +> Please avoid using commit hashes for referencing non-OpenWhisk libraries. + +### Removing unused dependencies + +Please us `go tidy` to remove any unused dependencies after any significant code changes: + +```sh +go mod tidy ``` -If it is executed successfully, you can find your binary `wsk` directly under -OpenWhisk CLI home directory. +### Updating dependency versions + +Although you might be tempted to edit the go.mod file directly, please use the recommended method of using the `go get` command: -You can run unit tests as well (although note the majority of the tests today are not in Go). +Using "latest" version: ```sh -$ cd commands -$ go get github.com/stretchr/testify/assert -$ go test -tags=unit -v +go get github.com/project/libname ``` -# How to use the binary +Using a release tag: + +```sah +go get github.com/project/libname +``` -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: +Using a commit hash: +```sh +go get github.com/project/libname@aee5cab1c ``` -$ wsk --help + +### Updating Go version + +Although you could edit the version directly in the go.mod file, it is better to use the `go edit` command: + +```sh +go mod edit -go=1.15 ``` -To get CLI command debug information, include the `-d`, or `--debug` flag when -executing this command. +--- -# Continuous Integration +## Continuous Integration -Travis CI is used as a continuous delivery service for Linux and Mac. -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 test cases and build the binary for Windows. +Travis CI is used as a continuous delivery service for Linux and Mac. Currently Travis CI supports the environments of Linux and Mac, but it is not available for Windows. The project would like to add AppVeyor CI in the future to run test cases for Windows. diff --git a/build.gradle b/build.gradle index 84e9ccd..dde0a2f 100644 --- a/build.gradle +++ b/build.gradle @@ -37,44 +37,18 @@ subprojects { golang { packagePath = 'github.com/apache/openwhisk-cli' as String buildTags = (rootProject.findProperty('goTags')?:'').split(',') - goVersion = '1.9.3' } -dependencies { - golang { - // BEGIN - Imported from Godeps - build(['name':'github.com/cloudfoundry/jibber_jabber', 'version':'bcc4c8345a21301bf47c032ff42dd1aae2fe3027', 'transitive':false]) - build(['name':'github.com/fatih/color', 'version':'570b54cabe6b8eb0bc2dfce68d964677d63b5260', 'transitive':false]) - build(['name':'github.com/google/go-querystring/query', 'version':'9235644dd9e52eeae6fa48efd539fdc351a0af53', 'transitive':false]) - build(['name':'github.com/hokaccha/go-prettyjson', 'version':'f75235bd99dad4e98ff360db8372d5c0ef1d054a', 'transitive':false]) - build(['name':'github.com/inconshreveable/mousetrap', 'version':'76626ae9c91c4f2a10f34cad8ce83ea42c93bb75', 'transitive':false]) - build(['name':'github.com/mattn/go-colorable', 'version':'d228849504861217f796da67fae4f6e347643f15', 'transitive':false]) - build(['name':'github.com/mattn/go-isatty', 'version':'a5cdd64afdee435007ee3e9f6ed4684af949d568', 'transitive':false]) - build(['name':'github.com/mitchellh/go-homedir', 'version':'1111e456ffea841564ac0fa5f69c26ef44dafec9', 'transitive':false]) - build(['name':'github.com/nicksnyder/go-i18n/i18n/...', 'version':'991e81cc94f6c54209edb3192cb98e3995ad71c1', 'transitive':false]) - build(['name':'github.com/spf13/cobra', 'version':'1238ba19d24b0b9ceee2094e1cb31947d45c3e86', 'transitive':false]) - build(['name':'github.com/spf13/pflag', 'version':'81378bbcd8a1005f72b1e8d7579e5dd7b2d612ab', 'transitive':false]) - build(['name':'golang.org/x/sys/unix', 'version':'7f918dd405547ecb864d14a8ecbbfe205b5f930f', 'transitive':false]) - build(['name':'gopkg.in/yaml.v2', 'version':'eb3733d160e74a9c7e442f435eb3bea458e1d19f', 'transitive':false]) - build(['name':'github.com/ghodss/yaml', 'version':'0ca9ea5df5451ffdf184b4428c902747c2c11cd7', 'transitive':false]) - build(['name':'github.com/apache/openwhisk-client-go/whisk','version':'44551f1f3b715e87c0319b55762d50c71d214460','transitive':false]) - build(['name':'github.com/apache/openwhisk-wskdeploy','version':'cbe7c52d99c1ead5172946d3aeb33adb5d5c40b2','transitive':false]) - // END - Imported from Godeps - test name:'github.com/stretchr/testify', version:'b91bfb9ebec76498946beb6af7c0230c7cc7ba6c', transitive:false //, tag: 'v1.2.0' - test name:'github.com/spf13/viper', version:'aafc9e6bc7b7bb53ddaa75a5ef49a17d6e654be5', transitive:false - test name:'github.com/cpuguy83/go-md2man/md2man', version:'1d903dcb749992f3741d744c0f8376b4bd7eb3e1', transitive:false //, tag:'v1.0.7' - test name:'github.com/davecgh/go-spew/spew', version:'346938d642f2ec3594ed81d874461961cd0faa76', transitive:false //, tag:'v1.1.0' - test name:'github.com/pmezard/go-difflib/difflib', version:'792786c7400a136282c1664665ae0a8db921c6c2', transitive:false - - test name:'github.com/onsi/ginkgo', version:'00054c0bb96fc880d4e0be1b90937fad438c5290', transitive: false - test name:'github.com/hpcloud/tail',version: 'a1dbeea552b7c8df4b542c66073e393de198a800', transitive: false - test name:'gopkg.in/tomb.v1', version:'c131134a1947e9afd9cecfe11f4c6dff0732ae58', transitive: false - test name:'gopkg.in/fsnotify/fsnotify.v1', version:'7be54206639f256967dd82fa767397ba5f8f48f5', transitive: false - test name:'github.com/onsi/gomega', version:'c893efa28eb45626cdaa76c9f653b62488858837', transitive: false - test name:'golang.org/x/net/html', version:'b68f30494add4df6bd8ef5e82803f308e7f7c59c', transitive: false - test name:'golang.org/x/text', version:'ece95c760240037f89ebcbdd7155ac8cb52e38fa', transitive: false - } -} +// The `gogradle` plugin was designed to work with `govendor` and `godeps` tools +// We must disable its tasks that attempt to "fetch" dependencies +// into a "/vendor" directory and use them to build the project (which will fail) +installDependencies.enabled = false +resolveBuildDependencies.enabled = false +resolveTestDependencies.enabled = false + +// Disable "go vet" and "gofmt" as gogradle uses deprecated syntax +goVet.enabled = false +gofmt.enabled = false /* The OpenWhiskPlatform class is a utility class to make the rest of what @@ -194,7 +168,7 @@ if (rootProject.hasProperty('buildPlatforms')) { rootProject.ext.platforms = [ 'linux-386', 'linux-amd64', 'linux-s390x', 'linux-ppc64le', 'linux-arm', 'linux-arm64', - 'darwin-386', 'darwin-amd64', + 'darwin-amd64', 'windows-386', 'windows-amd64' ].collect { new OpenWhiskPlatform(it) } } else { @@ -205,32 +179,63 @@ if (rootProject.hasProperty('buildPlatforms')) { /* I18n support */ -task getGoI18n(type: com.github.blindpirate.gogradle.Go) { - go 'get -u github.com/jteeuwen/go-bindata/...' + +// task getGoPath(type: Exec) { +// executable = 'echo' +// args = ["$System.env.GOPATH"] + +// doLast{ +// println commandLine +// } +// } + +task getGoBinData(type: Exec) { + executable = 'go' + args = ['get', '-u', 'github.com/jteeuwen/go-bindata/...'] + + doLast{ + println commandLine + } } -task goI18n(type: com.github.blindpirate.gogradle.Go, dependsOn: getGoI18n) { - // WARNING: The single quotes are intentional! The gogradle plugin will - // parse the command with the GString engine at execution time. - run '${GOPATH}/bin/go-bindata -pkg wski18n -o wski18n/i18n_resources.go wski18n/resources' +task goI18n(type: Exec) { + dependsOn 'getGoBinData' + executable = "$System.env.GOPATH" + '/bin/go-bindata' + // run '${GOPATH}/bin/go-bindata -pkg wski18n -o wski18n/i18n_resources.go wski18n/resources' + args = ['-pkg', 'wski18n', '-o', 'wski18n/i18n_resources.go', 'wski18n/resources'] + + doLast{ + println commandLine + } } -resolveBuildDependencies.dependsOn(goI18n) /* - Checks -- add golint and scancode to the checks run prior to build. + Checks -- add golint to the checks run prior to build. The get step is needed to be sure a golint binary is available to run. */ -task getGoLint(type: com.github.blindpirate.gogradle.Go) { - go 'get -u golang.org/x/lint/golint' + +task getGoLint(type: Exec) { + executable = 'go' + args = ['get', '-u', 'golang.org/x/lint/golint'] + + doLast{ + println commandLine + } } -task goLint(type: com.github.blindpirate.gogradle.Go, dependsOn: getGoLint) { - // WARNING: The single quotes are intentional! The gogradle plugin will - // parse the command with the GString engine at execution time. - run '${GOPATH}/bin/golint ' + golang.packagePath +task goLint(type: Exec) { + dependsOn 'getGoLint' + executable = 'golint' + //args = ['./', './commands/'] + args = ['./'] + + doLast{ + println commandLine + } } goCheck.dependsOn(goLint) +goPrepare.dependsOn(goI18n) goBuild { targetPlatform = rootProject.platforms*.goPlatform diff --git a/go.mod b/go.mod index 69b2f2a..20b9949 100644 --- a/go.mod +++ b/go.mod @@ -8,19 +8,19 @@ require ( github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21 github.com/fatih/color v1.9.0 github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 - github.com/google/go-querystring v1.0.0 - github.com/hokaccha/go-prettyjson v0.0.0-20190818114111-108c894c2c0e - github.com/inconshreveable/mousetrap v1.0.0 + github.com/google/go-querystring v1.0.0 // indirect + github.com/hokaccha/go-prettyjson v0.0.0-20190818114111-108c894c2c0e // indirect + github.com/jteeuwen/go-bindata v3.0.7+incompatible // indirect github.com/mattn/go-colorable v0.1.7 - github.com/mattn/go-isatty v0.0.12 github.com/mitchellh/go-homedir v1.1.0 github.com/nicksnyder/go-i18n v1.10.1 github.com/onsi/ginkgo v1.14.0 github.com/onsi/gomega v1.10.1 github.com/pelletier/go-toml v1.8.0 // indirect github.com/spf13/cobra v1.0.0 - github.com/spf13/pflag v1.0.5 + github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/testify v1.6.1 - golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a - gopkg.in/yaml.v2 v2.3.0 + golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect + golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect ) diff --git a/go.sum b/go.sum index d39f2c8..d556757 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -7,8 +8,6 @@ github.com/apache/openwhisk-client-go v0.0.0-20191018191012-ee5b8709787c h1:HJim github.com/apache/openwhisk-client-go v0.0.0-20191018191012-ee5b8709787c/go.mod h1:jLLKYP7+1+LFlIJW1n9U1gqeveLM1HIwa4ZHNOFxjPw= github.com/apache/openwhisk-client-go v0.0.0-20200824013630-44551f1f3b71 h1:yTMBqN5j2u/nnwjR+MtegLSfExN5s1O7EAyZ3XS7PR8= github.com/apache/openwhisk-client-go v0.0.0-20200824013630-44551f1f3b71/go.mod h1:jLLKYP7+1+LFlIJW1n9U1gqeveLM1HIwa4ZHNOFxjPw= -github.com/apache/openwhisk-wskdeploy v0.0.0-20200526130153-26308cad60c9 h1:554nLEpjcUQaSw1C6pHz6YuDxtcqG3pveBwWZ3OI67k= -github.com/apache/openwhisk-wskdeploy v0.0.0-20200526130153-26308cad60c9/go.mod h1:11PhGZEWM97VMRcnLrA158QuLEwmZS93SvB1kChGm1Y= github.com/apache/openwhisk-wskdeploy v0.0.0-20200827195556-535f5a9d3942 h1:SDeUi5Wqtv2J/4FkbjyZ3pCEMfy88DMTQix+qmAjo9I= github.com/apache/openwhisk-wskdeploy v0.0.0-20200827195556-535f5a9d3942/go.mod h1:jRNFwq0Ribf74Jd7oYvoDtBH+RXb5nCVAIHji47ESjY= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -56,11 +55,13 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v0.0.0-20160401233042-9235644dd9e5 h1:oERTZ1buOUYlpmKaqlO5fYmz8cZ1rYu5DieJzF4ZVmU= github.com/google/go-querystring v0.0.0-20160401233042-9235644dd9e5/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= @@ -80,13 +81,17 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jteeuwen/go-bindata v3.0.7+incompatible h1:91Uy4d9SYVr1kyTJ15wJsog+esAZZl7JmEfTkwmhJts= +github.com/jteeuwen/go-bindata v3.0.7+incompatible/go.mod h1:JVvhzYOiGBnFSYRyV00iY8q7/0PThjIYav1p9h5dmKs= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.7.1-0.20160908093658-0723e352fa35/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -95,8 +100,6 @@ github.com/mattn/go-colorable v0.0.7/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.0-20160806122752-66b8e73f3f5c h1:3nKFouDdpgGUV/uerJcYWH45ZbJzX0SiVWfTgmUeTzc= -github.com/mattn/go-isatty v0.0.0-20160806122752-66b8e73f3f5c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= @@ -177,21 +180,25 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20161108151328-9a2e24c3733e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -199,6 +206,7 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -209,20 +217,24 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200810151505-1b9f1253b3ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200817155316-9781c653f443 h1:X18bCaipMcoJGm27Nv7zr4XYPKGUy92GtqboKC2Hxaw= -golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a h1:i47hUS795cOydZI4AwJQCKXOr4BvxzvikwDoDtHhP2Y= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd h1:/e+gpKk9r3dJobndpTytxS2gOy6m5uvpg+ISQoEcusQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -232,9 +244,11 @@ google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= diff --git a/tests/src/test/scala/system/basic/WskSdkTests.scala b/tests/src/test/scala/system/basic/WskSdkTests.scala index e2280e7..cd83b6d 100644 --- a/tests/src/test/scala/system/basic/WskSdkTests.scala +++ b/tests/src/test/scala/system/basic/WskSdkTests.scala @@ -42,19 +42,19 @@ class WskSdkTests extends TestHelpers with WskTestHelpers { it should "prefix https to apihost if no scheme given" in { val result = wsk.cli(Seq("--apihost", "localhost:54321", "sdk", "install", "docker"), expectedExitCode = ERROR_EXIT) - result.stderr should include regex ("""(?i)Get https://localhost:54321/""") + result.stderr should include regex ("""(?i)Get [\"]https://localhost:54321/""") } it should "not prefix https to http apihost" in { val result = wsk.cli(Seq("--apihost", "http://localhost:54321", "sdk", "install", "docker"), expectedExitCode = ERROR_EXIT) - result.stderr should include regex ("""(?i)Get http://localhost:54321/""") + result.stderr should include regex ("""(?i)Get [\"]http://localhost:54321/""") } it should "not double prefix https to https apihost" in { val result = wsk.cli(Seq("--apihost", "https://localhost:54321", "sdk", "install", "docker"), expectedExitCode = ERROR_EXIT) - result.stderr should include regex ("""(?i)Get https://localhost:54321/""") + result.stderr should include regex ("""(?i)Get [\"]https://localhost:54321/""") } it should "download docker action sdk" in { diff --git a/tools/travis/test_openwhisk.sh b/tools/travis/test_openwhisk.sh index c59f520..ca4780d 100755 --- a/tools/travis/test_openwhisk.sh +++ b/tools/travis/test_openwhisk.sh @@ -80,20 +80,22 @@ cd $TRAVIS_BUILD_DIR # # Set up the OpenWhisk environment for integration testing # - cd $OPENWHISK_HOME +# Install Ansible and other pre-reqs +#./tools/travis/setup.sh + # Fire up the cluster -cd $OPENWHISK_HOME/ansible ANSIBLE_CMD="ansible-playbook -i environments/local -e docker_image_prefix=openwhisk -e docker_image_tag=nightly" +cd $OPENWHISK_HOME/ansible $ANSIBLE_CMD setup.yml $ANSIBLE_CMD prereq.yml $ANSIBLE_CMD couchdb.yml $ANSIBLE_CMD initdb.yml -$ANSIBLE_CMD apigateway.yml $ANSIBLE_CMD wipe.yml $ANSIBLE_CMD openwhisk.yml -e cli_tag=$openwhisk_cli_tag -e cli_installation_mode=local -e openwhisk_cli_home=$TRAVIS_BUILD_DIR -e controllerProtocolForSetup=http $ANSIBLE_CMD properties.yml +$ANSIBLE_CMD apigateway.yml $ANSIBLE_CMD routemgmt.yml # Run the test cases under openwhisk to ensure the quality of the runnint API.