github.com/henvic/wedeploycli@v1.7.6-0.20200319005353-3630f582f284/README.md (about)

     1  # About this repository
     2  The code you find here is legacy and was originally created for WeDeploy (that originated Liferay Cloud Platform later on). This code is not maintained or used anymore, but there are parts of it that might be useful for many Go projects (especially CLI tools).
     3  
     4  To quickly test it, you can run:
     5  
     6  ```shell
     7  go install github.com/henvic/wedeploycli/cmd/lcp
     8  ```
     9  
    10  This code was previously at github.com/wedeploy/cli.
    11  
    12  # Liferay Cloud Platform CLI tool [![Build Status](https://travis-ci.org/henvic/wedeploycli.svg?branch=master)](https://travis-ci.org/henvic/wedeploycli) [![Coverage Status](https://coveralls.io/repos/henvic/wedeploycli/badge.svg)](https://coveralls.io/r/henvic/wedeploycli) [![codebeat badge](https://codebeat.co/badges/bd6acb49-ccdf-4045-a877-05da0198261a)](https://codebeat.co/projects/github-com-wedeploy-cli) [![Go Report Card](https://goreportcard.com/badge/github.com/henvic/wedeploycli)](https://goreportcard.com/report/github.com/henvic/wedeploycli) [![GoDoc](https://godoc.org/github.com/henvic/wedeploycli?status.svg)](https://godoc.org/github.com/henvic/wedeploycli)
    13  
    14  **The contents below are outdated.**
    15  
    16  Install the tool with:
    17  
    18  ```shell
    19  curl https://cdn.liferay.cloud/cli/latest/lcp.sh -fsSL | bash
    20  ```
    21  
    22  or download from our [stable release channel](https://dl.equinox.io/wedeploy/lcp/stable).
    23  
    24  To update this tool, just run `lcp update`.
    25  
    26  ## Dependencies
    27  The following external soft dependencies are necessary to correctly run some commands:
    28  
    29  * [docker](https://www.docker.com/)
    30  * [git](https://git-scm.com/)
    31  
    32  The availability of dependencies are tested just before its immediate use. If a required dependency is not found, an error message is printed and the calling process is terminated with an error code.
    33  
    34  ## Contributing
    35  You can get the latest CLI source code with `go get -u github.com/henvic/wedeploycli`. Alternatively, clone the repo as usual. 
    36  
    37  The following commands are available and requires no arguments:
    38  
    39  * **make clean**: clears generated binaries
    40  * **make development-environment**: install development environment for this project
    41  * **make legal**: generate legal notices for existing dependencies
    42  * **make list-packages**: list all Go packages of the project
    43  * **make build**: compiles the program
    44  * **make fast-test**: run all unit tests
    45  * **make test**: run all unit and integration tests
    46  * **make functional-tests**: run functional tests
    47  * **make build-integration-tests**: generate integration tests suites
    48  * **make release**: tag, build, and publish new version of the app
    49  * **make promote**: publish version already released to a given distribution channel
    50  * **make release-notes-page**: update release notes page
    51  
    52  In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Integration tests should be written as well.
    53  
    54  ## Committing and pushing changes
    55  The master branch of this repository on GitHub is protected:
    56  * force-push is disabled
    57  * tests MUST pass on Travis before merging changes to master
    58  * branches MUST be up to date with master before merging
    59  
    60  Keep your commits neat and [well documented](https://wiki.openstack.org/wiki/GitCommitMessages). Try to always rebase your changes before publishing them.
    61  
    62  ## Maintaining code quality
    63  [goreportcard](https://goreportcard.com/report/github.com/henvic/wedeploycli) can be used online or locally to detect defects and static analysis results from tools with a great overview.
    64  
    65  Using go test and go cover are essential to make sure your code is covered with unit tests.
    66  
    67  Check [scripts/aliases.sh](https://github.com/henvic/wedeploycli/tree/master/scripts/aliases.sh) for a list of aliases you might find useful for development / testing.
    68  
    69  Always run `make test` before submitting changes.
    70  
    71  ## Integration testing
    72  `make test` already runs the integration tests.
    73  
    74  You can generate a test suite to run integration tests outside of your development environment (say, on a virtual machine).
    75  
    76  Set the `$WEDEPLOY_CLI_INTEGRATION_TESTS_PATH` environment variable to save the integration test suites on a shared network volume you can access from each test machine to speed up development and debugging.
    77  
    78  Build and distribute test suites for the supported systems:
    79  
    80  ```
    81  $ make build-integration-tests
    82  Building integration test suites for multiple platforms:
    83  darwin...	lcp-cli-integration-darwin.test
    84  linux...	lcp-cli-integration-linux.test
    85  windows...	lcp-cli-integration-windows.test.exe
    86  Warning: mocks directory placed on trash and recreated.
    87  
    88  Integration test suites and its related mocks are saved in:
    89  /vm-shared-network-volume/lcp-cli-integration-tests
    90  ```
    91  
    92  And run it as a regular executable on each target system.
    93  
    94  ## Functional testing
    95  Functional tests for the CLI are written in the [Tcl](https://tcl.tk/) programming language and uses [Expect](https://core.tcl.tk/expect/). See the [README](functional/README.md) at the functional directory.
    96  
    97  These tests are run by connecting to a real Liferay Cloud infrastructure, therefore caution to avoid data loss is advised. For this very reason it refuses to be run on a non-empty user account by default.
    98  
    99  You need to copy `functional/settings-sample.tcl` to `functional/settings.tcl` and configure it appropriately.
   100  
   101  ## Environment variables
   102  See [envs/envs.go](envs/envs.go) for an up-to-date list of used environment variables.
   103  
   104  ## Hidden global flags
   105  * `--defer-verbose` (`-V`) to defer verbose output until program termination
   106  * `--no-verbose-requests` to avoid printing requests when using `--verbose`
   107  * `--no-color` to print text without colors