docker command: Create 2 different actions publish and link (#6907)

* Create 2 different action publish and link

* use enum

* Use publish as default action

* Check if action is valid

* Add back compatibility
This commit is contained in:
Maurizio Vitale
2021-04-09 15:27:27 +01:00
committed by GitHub
parent 833ca30440
commit a1ae3ae8c8
4 changed files with 168 additions and 101 deletions

View File

@@ -47,7 +47,7 @@ In develop mode, the CLI takes the prebuilt scripts from the dist folder.
|check-plugin-env |Check plugin status |
|artifact-from-s3 |Get artifact from S3 |
|artifact-to-s3 |Get artifact to S3 |
|docker-publish |publish docker image|
|docker |Build and publish a docker image or create additional tag link |
|init-aae-env |Init env|
|init-aps-env |Init aps|
|kubectl-delete |delete kubectl |
@@ -81,19 +81,29 @@ npm install
adf-cli audit
```
### Docker publish
### Docker
The command provides 2 targets 'Publish' (default value) and 'Link'
Publish target
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)"
adf-cli docker --target "publish" --dockerRepo "${docker_repository}" --dockerTags "${TAGS}"
```
If you want to specify a different docker registry you can run
```bash
--loginCheck --loginUsername "username" --loginPassword "password" --loginRepo "quay.io"--dockerRepo "${docker_repository}" --dockerTags "${TAGS}" --pathProject "$(pwd)"
--loginCheck --loginUsername "username" --loginPassword "password" --loginRepo "quay.io"--dockerRepo "${docker_repository}" --dockerTags "${TAGS}"
```
Link target
In case you don't need to publish a new image but you would like to create a link to an already existing image (sourceTag) you can use the link target.
```bash
adf-cli docker --target "link" --dockerRepo "${docker_repository}" --dockerTags "${TAGS}" --sourceTag "develop"
```
### Kubectl update pod image
This command allows you to update a specific service on the rancher env with a specific tag