ADF CLI fixes (#5674)

* safety checks and better path eval

* do not execute command on help

* rewrite 'update-version' command
This commit is contained in:
Denys Vuika
2020-05-06 11:18:38 +01:00
committed by GitHub
parent 2db9fb0aa9
commit 94e2e83e73
14 changed files with 195 additions and 138 deletions

View File

@@ -1,24 +1,47 @@
# Alfresco ADF Cli
## The Goal of ADF CLI
The ADF CLI manages, builds , doc and test your ADF Application projects.
The ADF CLI provides a set of utilities to manage your ADF projects.
## Installation
To get started follow these instructions:
``
```bash
npm install @alfresco/adf-cli -g
``
```
To know more about any command use the -h or --help option
To know more about any command use the -h or --help option:
```bash
adf-cli <command> --help
```
## Developing
Link the project as a global tool
```bash
npm link
```
Build the tool in the **develop** mode (automatically watches for changes and rebuilds the commands):
```bash
npm run develop
```
Run the tool with the `DEVELOP` environment variable:
```bash
DEVELOP=true adf-cli <command>
```
In develop mode, the CLI takes the prebuilt scripts from the dist folder.
## Commands
|**Commands** |**Description** |
|--- |--- |
| **Commands** |**Description** |
|--- |--- |
|artifact-from-s3 |Get artifact from S3 |
|artifact-to-s3 |Get artifact to S3 |
|docker-publish |publish docker image|
@@ -26,26 +49,26 @@ To know more about any command use the -h or --help option
|kubectl-delete |delete kubectl |
|kubectl-image |This command allows you to update a specific service on the rancher env with a specifig tag |
|npm-publish | publish on npm |
| update-commit-sha | his command allows you to update the commit sha as part of the package.json. Your package.json must to have an existing property called "commit" |
| update-commit-sha | his command allows you to update the commit sha as part of the `package.json`. Your `package.json` must to have an existing property called "commit" |
|update-version |This command allows you to update the adf dependencies and js-api with different versions Update adf libs and js-api with latest alpha|
|adf-license |Create a 3th party license file |
|adf-audit |Check the security risk dependency in your package.json |
## Examples
### License Check
Move in the folder where you have your package.json and run the command:
Move in the folder where you have your `package.json` and run the command:
```bash
npm install
adf-license
```
### Audit Check
Move in the folder where you have your package.json and run the command:
Move in the folder where you have your `package.json` and run the command:
```bash
npm install
@@ -55,7 +78,7 @@ adf-audit
### Docker publish
Move in the folder where you have your Dockerfile and run the command:
Move in the folder where you have your `Dockerfile` and run the command:
```bash
adf-cli docker-publish --dockerRepo "${docker_repository}" --dockerTags "${TAGS}" --pathProject "$(pwd)"
@@ -68,7 +91,7 @@ If you want to specify a different docker registry you can run
### Kubectl update pod image
This command allows you to update a specific service on the rancher env with a specifig tag
This command allows you to update a specific service on the rancher env with a specific tag
```bash
adf-cli kubectl-image --clusterEnv ${clusterEnv} --clusterUrl ${clusterUrl} --username ${username} --token ${token} --deployName ${deployName} --dockerRepo ${dockerRepo} --tag ${tag}
@@ -118,8 +141,8 @@ adf-cli update-version --alpha --pathPackage "$(pwd)" --skipGnu
### Update commit sha
This command allows you to update the commit sha as part of the package.json.
Your package.json must to have an existing property called "commit"
This command allows you to update the commit sha as part of the `package.json`.
Your `package.json` must to have an existing property called "commit"
```bash
adf-cli update-commit-sha --pathProject "$(pwd)"
@@ -145,7 +168,8 @@ adf-cli init-aae-env --host "gateway_env" --oauth "identity_env" --identityHost
```
If you want to add a new app the schema needs to be:
```
```text
TEST_APP: {
        name: 'testapp',
        file_location: 'https://github.com/Alfresco/alfresco-ng2-components/blob/branch/e2e/resources/testapp.zip?raw=true',