codefresh 1.2.10 → 1.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/binary/components.js +0 -38
- package/lib/interface/cli/commands/components/download.cmd.js +1 -1
- package/lib/interface/cli/commands/hybrid/helper.js +1 -877
- package/lib/interface/cli/completion/tree.json +1 -1
- package/package.json +2 -11
- package/lib/interface/cli/commands/agent/helper.js +0 -28
- package/lib/interface/cli/commands/agent/install.cmd.js +0 -283
- package/lib/interface/cli/commands/agent/uninstall.cmd.js +0 -92
- package/lib/interface/cli/commands/app-proxy/helper.js +0 -63
- package/lib/interface/cli/commands/app-proxy/install.cmd.js +0 -204
- package/lib/interface/cli/commands/app-proxy/uninstall.cmd.js +0 -175
- package/lib/interface/cli/commands/app-proxy/upgrade.cmd.js +0 -110
- package/lib/interface/cli/commands/gitops/argocd/install.js +0 -9
- package/lib/interface/cli/commands/gitops/argocd/uninstall.js +0 -11
- package/lib/interface/cli/commands/gitops/argocd/upgrade.js +0 -9
- package/lib/interface/cli/commands/gitops/codefresh/install.js +0 -50
- package/lib/interface/cli/commands/gitops/codefresh/uninstall.js +0 -14
- package/lib/interface/cli/commands/gitops/codefresh/upgrade.js +0 -9
- package/lib/interface/cli/commands/gitops/common/install.js +0 -62
- package/lib/interface/cli/commands/gitops/common/uninstall.js +0 -39
- package/lib/interface/cli/commands/gitops/common/upgrade.js +0 -45
- package/lib/interface/cli/commands/gitops/install.cmd.js +0 -116
- package/lib/interface/cli/commands/gitops/install.spec.js +0 -77
- package/lib/interface/cli/commands/gitops/uninstall.cmd.js +0 -56
- package/lib/interface/cli/commands/gitops/upgrade.cmd.js +0 -56
- package/lib/interface/cli/commands/hybrid/delete.cmd.js +0 -341
- package/lib/interface/cli/commands/hybrid/init.cmd.js +0 -957
- package/lib/interface/cli/commands/hybrid/key-helper.js +0 -82
- package/lib/interface/cli/commands/hybrid/migration.js +0 -192
- package/lib/interface/cli/commands/hybrid/upgrade.cmd.js +0 -195
- package/lib/interface/cli/commands/monitor/install.cmd.js +0 -160
- package/lib/interface/cli/commands/monitor/uninstall.cmd.js +0 -78
- package/lib/interface/cli/commands/root/install.cmd.js +0 -17
- package/lib/interface/cli/commands/root/uninstall.cmd.js +0 -17
- package/lib/interface/cli/commands/runtimeEnvironments/attach.cmd.js +0 -180
- package/lib/interface/cli/commands/runtimeEnvironments/create.cmd.js +0 -23
- package/lib/interface/cli/commands/runtimeEnvironments/install.cmd.js +0 -340
- package/lib/interface/cli/commands/runtimeEnvironments/uninstall.cmd.js +0 -149
- package/lib/interface/cli/helpers/kubernetes.js +0 -61
- package/lib/interface/cli/helpers/progressEvents.js +0 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
{"codefresh":{"analyze":{},"completion":{},"completions":{"alias":"completion"},"tag":{},"untag":{},"offline-logs":{"ensure-index":{},"offload-to-collection":{},"offload-to-file":{}},"run":{"__optionHandlers":["../commands/pipeline/run.completion.js"]},"add":{"repository":{},"repo":{"alias":"repository"}},"annotate":{"image":{},"img":{"alias":"image"}},"patch":{"__optionHandlers":["../commands/root/apply.completion.js"],"agent":{"__optionHandlers":["../commands/root/apply.completion.js"]},"board":{"__optionHandlers":["../commands/root/apply.completion.js"]},"project":{"__optionHandlers":["../commands/root/apply.completion.js"]},"runtime-environments":{"__optionHandlers":["../commands/root/apply.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"section":{"__optionHandlers":["../commands/root/apply.completion.js"]},"system-runtime-environments":{"__optionHandlers":["../commands/root/apply.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"},"teams":{"__optionHandlers":["../commands/root/apply.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"tokens":{"__optionHandlers":["../commands/root/apply.completion.js"]},"token":{"alias":"tokens"},"helm-repo":{"__optionHandlers":["../commands/root/apply.completion.js"]},"context":{"__optionHandlers":["../commands/root/apply.completion.js"]},"ctx":{"alias":"context"}},"assign":{"system-runtime-environments":{},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"}},"auth":{"create-context":{},"current-context":{},"get-contexts":{},"use-context":{}},"components":{"download":{},"update":{}},"create":{"__optionHandlers":["../commands/root/create.completion.js"],"agent":{"__optionHandlers":["../commands/root/create.completion.js"]},"clusters":{"__optionHandlers":["../commands/root/create.completion.js"]},"cluster":{"alias":"clusters"},"annotation":{"__optionHandlers":["../commands/root/create.completion.js"]},"board":{"__optionHandlers":["../commands/root/create.completion.js"]},"composition":{"__optionHandlers":["../commands/composition/create.completion.js","../commands/root/create.completion.js"]},"com":{"alias":"composition"},"project":{"__optionHandlers":["../commands/root/create.completion.js"]},"runtime-environments":{"__optionHandlers":["../commands/root/create.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"section":{"__optionHandlers":["../commands/root/create.completion.js"]},"teams":{"__optionHandlers":["../commands/root/create.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"token":{"__optionHandlers":["../commands/root/create.completion.js"]},"helm-repo":{"__optionHandlers":["../commands/root/create.completion.js"]},"registry":{"__optionHandlers":["../commands/root/create.completion.js"],"standard":{"__optionHandlers":["../commands/root/create.completion.js"]}},"trigger":{"__optionHandlers":["../commands/root/create.completion.js"]},"t":{"alias":"trigger"},"trigger-event":{"__optionHandlers":["../commands/root/create.completion.js"]},"te":{"alias":"trigger-event"},"workflow-data-item":{"__optionHandlers":["../commands/root/create.completion.js"]},"wdi":{"alias":"workflow-data-item"},"context":{"__optionHandlers":["../commands/root/create.completion.js"],"config":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret-yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"helm-repository":{"__optionHandlers":["../commands/root/create.completion.js"],"http":{"__optionHandlers":["../commands/root/create.completion.js"]},"s3":{"__optionHandlers":["../commands/root/create.completion.js"]}},"git":{"__optionHandlers":["../commands/root/create.completion.js"],"github":{"__optionHandlers":["../commands/root/create.completion.js"]},"bitbucket":{"__optionHandlers":["../commands/root/create.completion.js"]},"gitlab":{"__optionHandlers":["../commands/root/create.completion.js"]},"stash":{"__optionHandlers":["../commands/root/create.completion.js"]}},"secret-store":{"__optionHandlers":["../commands/root/create.completion.js"],"hashicorp-vault":{"__optionHandlers":["../commands/root/create.completion.js"]},"kubernetes-runtime":{"__optionHandlers":["../commands/root/create.completion.js"]},"kubernetes":{"__optionHandlers":["../commands/root/create.completion.js"]}}},"ctx":{"alias":"context","config":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret-yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"helm-repository":{"__optionHandlers":["../commands/root/create.completion.js"],"http":{"__optionHandlers":["../commands/root/create.completion.js"]},"s3":{"__optionHandlers":["../commands/root/create.completion.js"]}},"git":{"__optionHandlers":["../commands/root/create.completion.js"],"github":{"__optionHandlers":["../commands/root/create.completion.js"]},"bitbucket":{"__optionHandlers":["../commands/root/create.completion.js"]},"gitlab":{"__optionHandlers":["../commands/root/create.completion.js"]},"stash":{"__optionHandlers":["../commands/root/create.completion.js"]}},"secret-store":{"__optionHandlers":["../commands/root/create.completion.js"],"hashicorp-vault":{"__optionHandlers":["../commands/root/create.completion.js"]},"kubernetes-runtime":{"__optionHandlers":["../commands/root/create.completion.js"]},"kubernetes":{"__optionHandlers":["../commands/root/create.completion.js"]}}}},"delete":{"__optionHandlers":["../commands/root/delete.completion.js"],"agent":{"__optionHandlers":["../commands/root/delete.completion.js"]},"annotation":{"__optionHandlers":["../commands/root/delete.completion.js"]},"board":{"__optionHandlers":["../commands/root/delete.completion.js"]},"cluster":{"__optionHandlers":["../commands/root/delete.completion.js"]},"clusters":{"alias":"cluster"},"composition":{"__optionHandlers":["../commands/root/delete.completion.js"]},"com":{"alias":"composition"},"environment":{"__optionHandlers":["../commands/root/delete.completion.js"]},"env":{"alias":"environment"},"pipeline":{"__optionHandlers":["../commands/root/delete.completion.js"]},"pip":{"alias":"pipeline"},"project":{"__optionHandlers":["../commands/root/delete.completion.js"]},"repository":{"__optionHandlers":["../commands/root/delete.completion.js"]},"repo":{"alias":"repository"},"runtime-environments":{"__optionHandlers":["../commands/root/delete.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"step-type":{"__optionHandlers":["../commands/root/delete.completion.js"]},"section":{"__optionHandlers":["../commands/root/delete.completion.js"]},"system-runtime-environments":{"__optionHandlers":["../commands/root/delete.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"},"teams":{"__optionHandlers":["../commands/root/delete.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"tokens":{"__optionHandlers":["../commands/root/delete.completion.js"]},"token":{"alias":"tokens"},"helm-repo":{"__optionHandlers":["../commands/root/delete.completion.js"]},"registry":{"__optionHandlers":["../commands/root/delete.completion.js"]},"trigger":{"__optionHandlers":["../commands/root/delete.completion.js"]},"t":{"alias":"trigger"},"trigger-event":{"__optionHandlers":["../commands/root/delete.completion.js"]},"te":{"alias":"trigger-event"},"context":{"__optionHandlers":["../commands/root/delete.completion.js"]},"ctx":{"alias":"context"}},"diff":{"__optionHandlers":["../commands/root/diff.completion.js"],"runtime-environments":{"__optionHandlers":["../commands/root/diff.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"system-runtime-environments":{"__optionHandlers":["../commands/root/diff.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"}},"generate":{"image-pull-secret":{}},"download":{"audit":{}},"get":{"__optionHandlers":["../commands/root/get.completion.js"],"runtime-environment-base-images":{"__optionHandlers":["../commands/root/get.completion.js"]},"re-base-images":{"alias":"runtime-environment-base-images"},"agents":{"__optionHandlers":["../commands/root/get.completion.js"]},"agent":{"alias":"agents"},"annotation":{"__optionHandlers":["../commands/root/get.completion.js"]},"boards":{"__optionHandlers":["../commands/root/get.completion.js"]},"board":{"alias":"boards"},"clusters":{"__optionHandlers":["../commands/root/get.completion.js"]},"cluster":{"alias":"clusters"},"compositions":{"__optionHandlers":["../commands/root/get.completion.js"]},"com":{"alias":"compositions"},"composition":{"alias":"compositions"},"environments":{"__optionHandlers":["../commands/root/get.completion.js"]},"env":{"alias":"environments"},"environment":{"alias":"environments"},"images":{"__optionHandlers":["../commands/root/get.completion.js"]},"img":{"alias":"images"},"image":{"alias":"images"},"pipelines":{"__positionalHandler":"../commands/pipeline/get.completion.js","__optionHandlers":["../commands/root/get.completion.js"]},"pip":{"alias":"pipelines"},"pipeline":{"alias":"pipelines"},"projects":{"__optionHandlers":["../commands/root/get.completion.js"]},"project":{"alias":"projects"},"repository":{"__optionHandlers":["../commands/root/get.completion.js"]},"repo":{"alias":"repository"},"runtime-environments":{"__optionHandlers":["../commands/root/get.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"step-types":{"__positionalHandler":"../commands/step/get.completion.js","__optionHandlers":["../commands/root/get.completion.js"]},"step-type":{"alias":"step-types"},"sections":{"__optionHandlers":["../commands/root/get.completion.js"]},"section":{"alias":"sections"},"system-runtime-environments":{"__optionHandlers":["../commands/root/get.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"},"teams":{"__optionHandlers":["../commands/root/get.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"tokens":{"__optionHandlers":["../commands/root/get.completion.js"]},"token":{"alias":"tokens"},"helm-repo":{"__optionHandlers":["../commands/root/get.completion.js"]},"registry":{"__optionHandlers":["../commands/root/get.completion.js"]},"triggers":{"__optionHandlers":["../commands/root/get.completion.js"]},"trigger":{"alias":"triggers"},"t":{"alias":"triggers"},"trigger-types":{"__optionHandlers":["../commands/root/get.completion.js"]},"trigger-type":{"alias":"trigger-types"},"tt":{"alias":"trigger-types"},"trigger-events":{"__optionHandlers":["../commands/root/get.completion.js"]},"trigger-event":{"alias":"trigger-events"},"te":{"alias":"trigger-events"},"builds":{"__optionHandlers":["../commands/root/get.completion.js"]},"build":{"alias":"builds"},"workflow-data-item":{"__optionHandlers":["../commands/root/get.completion.js"]},"wdi":{"alias":"workflow-data-item"},"contexts":{"__optionHandlers":["../commands/root/get.completion.js"]},"ctx":{"alias":"contexts"},"context":{"alias":"contexts"}},"install":{"runtime":{},"agent":{},"app-proxy":{},"monitor":{},"gitops":{}},"replace":{"__optionHandlers":["../commands/root/replace.completion.js"],"composition":{"__optionHandlers":["../commands/composition/replace.completion.js","../commands/root/replace.completion.js"]},"com":{"alias":"composition"}},"runner":{"delete":{},"execute-test-pipeline":{},"info":{},"init":{},"upgrade":{}},"synchronize":{"teams":{},"team":{"alias":"teams"},"tm":{"alias":"teams"}},"unassign":{"system-runtime-environments":{},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"}},"uninstall":{"agent":{},"app-proxy":{},"runtime":{},"monitor":{},"gitops":{}},"upgrade":{"app-proxy":{},"gitops":{}},"validate":{"__positionalHandler":"../commands/root/validate.completion.js"},"version":{},"attach":{},"cli-config":{"get":{},"help":{},"profile":{},"set":{}},"set-helm-config":{},"install-chart":{},"helm-promotion":{},"delete-release":{},"rollback-release":{},"test-release":{},"approve":{},"deny":{},"logs":{},"restart":{},"terminate":{},"wait":{}}}
|
|
1
|
+
{"codefresh":{"analyze":{},"completion":{},"completions":{"alias":"completion"},"tag":{},"untag":{},"offline-logs":{"ensure-index":{},"offload-to-collection":{},"offload-to-file":{}},"run":{"__optionHandlers":["../commands/pipeline/run.completion.js"]},"add":{"repository":{},"repo":{"alias":"repository"}},"annotate":{"image":{},"img":{"alias":"image"}},"patch":{"__optionHandlers":["../commands/root/apply.completion.js"],"agent":{"__optionHandlers":["../commands/root/apply.completion.js"]},"board":{"__optionHandlers":["../commands/root/apply.completion.js"]},"project":{"__optionHandlers":["../commands/root/apply.completion.js"]},"runtime-environments":{"__optionHandlers":["../commands/root/apply.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"section":{"__optionHandlers":["../commands/root/apply.completion.js"]},"system-runtime-environments":{"__optionHandlers":["../commands/root/apply.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"},"tokens":{"__optionHandlers":["../commands/root/apply.completion.js"]},"token":{"alias":"tokens"},"teams":{"__optionHandlers":["../commands/root/apply.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"helm-repo":{"__optionHandlers":["../commands/root/apply.completion.js"]},"context":{"__optionHandlers":["../commands/root/apply.completion.js"]},"ctx":{"alias":"context"}},"assign":{"system-runtime-environments":{},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"}},"auth":{"create-context":{},"current-context":{},"get-contexts":{},"use-context":{}},"components":{"download":{},"update":{}},"create":{"__optionHandlers":["../commands/root/create.completion.js"],"agent":{"__optionHandlers":["../commands/root/create.completion.js"]},"annotation":{"__optionHandlers":["../commands/root/create.completion.js"]},"board":{"__optionHandlers":["../commands/root/create.completion.js"]},"clusters":{"__optionHandlers":["../commands/root/create.completion.js"]},"cluster":{"alias":"clusters"},"composition":{"__optionHandlers":["../commands/composition/create.completion.js","../commands/root/create.completion.js"]},"com":{"alias":"composition"},"project":{"__optionHandlers":["../commands/root/create.completion.js"]},"section":{"__optionHandlers":["../commands/root/create.completion.js"]},"token":{"__optionHandlers":["../commands/root/create.completion.js"]},"teams":{"__optionHandlers":["../commands/root/create.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"helm-repo":{"__optionHandlers":["../commands/root/create.completion.js"]},"registry":{"__optionHandlers":["../commands/root/create.completion.js"],"standard":{"__optionHandlers":["../commands/root/create.completion.js"]}},"trigger":{"__optionHandlers":["../commands/root/create.completion.js"]},"t":{"alias":"trigger"},"trigger-event":{"__optionHandlers":["../commands/root/create.completion.js"]},"te":{"alias":"trigger-event"},"workflow-data-item":{"__optionHandlers":["../commands/root/create.completion.js"]},"wdi":{"alias":"workflow-data-item"},"context":{"__optionHandlers":["../commands/root/create.completion.js"],"config":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret-yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"git":{"__optionHandlers":["../commands/root/create.completion.js"],"bitbucket":{"__optionHandlers":["../commands/root/create.completion.js"]},"github":{"__optionHandlers":["../commands/root/create.completion.js"]},"gitlab":{"__optionHandlers":["../commands/root/create.completion.js"]},"stash":{"__optionHandlers":["../commands/root/create.completion.js"]}},"secret-store":{"__optionHandlers":["../commands/root/create.completion.js"],"hashicorp-vault":{"__optionHandlers":["../commands/root/create.completion.js"]},"kubernetes-runtime":{"__optionHandlers":["../commands/root/create.completion.js"]},"kubernetes":{"__optionHandlers":["../commands/root/create.completion.js"]}},"helm-repository":{"__optionHandlers":["../commands/root/create.completion.js"],"http":{"__optionHandlers":["../commands/root/create.completion.js"]},"s3":{"__optionHandlers":["../commands/root/create.completion.js"]}}},"ctx":{"alias":"context","config":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret":{"__optionHandlers":["../commands/root/create.completion.js"]},"secret-yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"yaml":{"__optionHandlers":["../commands/root/create.completion.js"]},"git":{"__optionHandlers":["../commands/root/create.completion.js"],"bitbucket":{"__optionHandlers":["../commands/root/create.completion.js"]},"github":{"__optionHandlers":["../commands/root/create.completion.js"]},"gitlab":{"__optionHandlers":["../commands/root/create.completion.js"]},"stash":{"__optionHandlers":["../commands/root/create.completion.js"]}},"secret-store":{"__optionHandlers":["../commands/root/create.completion.js"],"hashicorp-vault":{"__optionHandlers":["../commands/root/create.completion.js"]},"kubernetes-runtime":{"__optionHandlers":["../commands/root/create.completion.js"]},"kubernetes":{"__optionHandlers":["../commands/root/create.completion.js"]}},"helm-repository":{"__optionHandlers":["../commands/root/create.completion.js"],"http":{"__optionHandlers":["../commands/root/create.completion.js"]},"s3":{"__optionHandlers":["../commands/root/create.completion.js"]}}}},"delete":{"__optionHandlers":["../commands/root/delete.completion.js"],"agent":{"__optionHandlers":["../commands/root/delete.completion.js"]},"annotation":{"__optionHandlers":["../commands/root/delete.completion.js"]},"board":{"__optionHandlers":["../commands/root/delete.completion.js"]},"cluster":{"__optionHandlers":["../commands/root/delete.completion.js"]},"clusters":{"alias":"cluster"},"composition":{"__optionHandlers":["../commands/root/delete.completion.js"]},"com":{"alias":"composition"},"environment":{"__optionHandlers":["../commands/root/delete.completion.js"]},"env":{"alias":"environment"},"pipeline":{"__optionHandlers":["../commands/root/delete.completion.js"]},"pip":{"alias":"pipeline"},"project":{"__optionHandlers":["../commands/root/delete.completion.js"]},"repository":{"__optionHandlers":["../commands/root/delete.completion.js"]},"repo":{"alias":"repository"},"runtime-environments":{"__optionHandlers":["../commands/root/delete.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"section":{"__optionHandlers":["../commands/root/delete.completion.js"]},"step-type":{"__optionHandlers":["../commands/root/delete.completion.js"]},"system-runtime-environments":{"__optionHandlers":["../commands/root/delete.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"},"tokens":{"__optionHandlers":["../commands/root/delete.completion.js"]},"token":{"alias":"tokens"},"teams":{"__optionHandlers":["../commands/root/delete.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"helm-repo":{"__optionHandlers":["../commands/root/delete.completion.js"]},"registry":{"__optionHandlers":["../commands/root/delete.completion.js"]},"trigger":{"__optionHandlers":["../commands/root/delete.completion.js"]},"t":{"alias":"trigger"},"trigger-event":{"__optionHandlers":["../commands/root/delete.completion.js"]},"te":{"alias":"trigger-event"},"context":{"__optionHandlers":["../commands/root/delete.completion.js"]},"ctx":{"alias":"context"}},"diff":{"__optionHandlers":["../commands/root/diff.completion.js"],"runtime-environments":{"__optionHandlers":["../commands/root/diff.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"system-runtime-environments":{"__optionHandlers":["../commands/root/diff.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"}},"download":{"audit":{}},"generate":{"image-pull-secret":{}},"get":{"__optionHandlers":["../commands/root/get.completion.js"],"runtime-environment-base-images":{"__optionHandlers":["../commands/root/get.completion.js"]},"re-base-images":{"alias":"runtime-environment-base-images"},"agents":{"__optionHandlers":["../commands/root/get.completion.js"]},"agent":{"alias":"agents"},"annotation":{"__optionHandlers":["../commands/root/get.completion.js"]},"boards":{"__optionHandlers":["../commands/root/get.completion.js"]},"board":{"alias":"boards"},"clusters":{"__optionHandlers":["../commands/root/get.completion.js"]},"cluster":{"alias":"clusters"},"compositions":{"__optionHandlers":["../commands/root/get.completion.js"]},"com":{"alias":"compositions"},"composition":{"alias":"compositions"},"environments":{"__optionHandlers":["../commands/root/get.completion.js"]},"env":{"alias":"environments"},"environment":{"alias":"environments"},"images":{"__optionHandlers":["../commands/root/get.completion.js"]},"img":{"alias":"images"},"image":{"alias":"images"},"pipelines":{"__positionalHandler":"../commands/pipeline/get.completion.js","__optionHandlers":["../commands/root/get.completion.js"]},"pip":{"alias":"pipelines"},"pipeline":{"alias":"pipelines"},"projects":{"__optionHandlers":["../commands/root/get.completion.js"]},"project":{"alias":"projects"},"repository":{"__optionHandlers":["../commands/root/get.completion.js"]},"repo":{"alias":"repository"},"runtime-environments":{"__optionHandlers":["../commands/root/get.completion.js"]},"re":{"alias":"runtime-environments"},"runtime-environment":{"alias":"runtime-environments"},"sections":{"__optionHandlers":["../commands/root/get.completion.js"]},"section":{"alias":"sections"},"step-types":{"__positionalHandler":"../commands/step/get.completion.js","__optionHandlers":["../commands/root/get.completion.js"]},"step-type":{"alias":"step-types"},"system-runtime-environments":{"__optionHandlers":["../commands/root/get.completion.js"]},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"},"tokens":{"__optionHandlers":["../commands/root/get.completion.js"]},"token":{"alias":"tokens"},"teams":{"__optionHandlers":["../commands/root/get.completion.js"]},"team":{"alias":"teams"},"tm":{"alias":"teams"},"helm-repo":{"__optionHandlers":["../commands/root/get.completion.js"]},"registry":{"__optionHandlers":["../commands/root/get.completion.js"]},"triggers":{"__optionHandlers":["../commands/root/get.completion.js"]},"trigger":{"alias":"triggers"},"t":{"alias":"triggers"},"trigger-events":{"__optionHandlers":["../commands/root/get.completion.js"]},"trigger-event":{"alias":"trigger-events"},"te":{"alias":"trigger-events"},"trigger-types":{"__optionHandlers":["../commands/root/get.completion.js"]},"trigger-type":{"alias":"trigger-types"},"tt":{"alias":"trigger-types"},"builds":{"__optionHandlers":["../commands/root/get.completion.js"]},"build":{"alias":"builds"},"workflow-data-item":{"__optionHandlers":["../commands/root/get.completion.js"]},"wdi":{"alias":"workflow-data-item"},"contexts":{"__optionHandlers":["../commands/root/get.completion.js"]},"ctx":{"alias":"contexts"},"context":{"alias":"contexts"}},"replace":{"__optionHandlers":["../commands/root/replace.completion.js"],"composition":{"__optionHandlers":["../commands/composition/replace.completion.js","../commands/root/replace.completion.js"]},"com":{"alias":"composition"}},"runner":{"execute-test-pipeline":{},"info":{}},"synchronize":{"teams":{},"team":{"alias":"teams"},"tm":{"alias":"teams"}},"unassign":{"system-runtime-environments":{},"sys-re":{"alias":"system-runtime-environments"},"system-runtime-environment":{"alias":"system-runtime-environments"}},"upgrade":{},"validate":{"__positionalHandler":"../commands/root/validate.completion.js"},"version":{},"cli-config":{"get":{},"help":{},"profile":{},"set":{}},"set-helm-config":{},"install-chart":{},"helm-promotion":{},"delete-release":{},"rollback-release":{},"test-release":{},"approve":{},"deny":{},"logs":{},"restart":{},"terminate":{},"wait":{}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codefresh",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11",
|
|
4
4
|
"description": "Codefresh command line utility",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"preferGlobal": true,
|
|
@@ -33,22 +33,19 @@
|
|
|
33
33
|
"pkg": {
|
|
34
34
|
"scripts": [
|
|
35
35
|
"lib/**/*.js",
|
|
36
|
-
"node_modules/codefresh-sdk/lib/**/*.js"
|
|
37
|
-
"node_modules/kubernetes-client/**/*.js"
|
|
36
|
+
"node_modules/codefresh-sdk/lib/**/*.js"
|
|
38
37
|
],
|
|
39
38
|
"assets": "lib/**/*.hbs"
|
|
40
39
|
},
|
|
41
40
|
"resolutions": {
|
|
42
41
|
"json-schema": "^0.4.0",
|
|
43
42
|
"ansi-regex": "^5.0.1",
|
|
44
|
-
"kubernetes-client/@kubernetes/client-node": "^0.22.2",
|
|
45
43
|
"tough-cookie": "^4.1.3",
|
|
46
44
|
"openid-client": "^4.9.0",
|
|
47
45
|
"**/request/form-data": "^2.5.5",
|
|
48
46
|
"**/request/qs": "^6.15.2"
|
|
49
47
|
},
|
|
50
48
|
"dependencies": {
|
|
51
|
-
"adm-zip": "^0.6.0",
|
|
52
49
|
"ajv": "^6.14.0",
|
|
53
50
|
"bluebird": "^3.5.1",
|
|
54
51
|
"cf-errors": "^0.1.16",
|
|
@@ -63,18 +60,14 @@
|
|
|
63
60
|
"diff": "^3.5.0",
|
|
64
61
|
"dockerode": "^2.5.7",
|
|
65
62
|
"draftlog": "^1.0.12",
|
|
66
|
-
"figlet": "^1.4.0",
|
|
67
63
|
"filesize": "^3.5.11",
|
|
68
64
|
"firebase": "git+https://github.com/codefresh-io/firebase.git#80b2ed883ff281cd67b53bd0f6a0bbd6f330fed5",
|
|
69
65
|
"flat": "^5.0.2",
|
|
70
|
-
"inquirer": "^12.11.1",
|
|
71
66
|
"js-yaml": "^4.3.0",
|
|
72
67
|
"kefir": "^3.8.1",
|
|
73
|
-
"kubernetes-client": "^9.0.0",
|
|
74
68
|
"lodash": "^4.17.23",
|
|
75
69
|
"moment": "^2.29.4",
|
|
76
70
|
"mongodb": "^4.17.2",
|
|
77
|
-
"node-forge": "^1.3.0",
|
|
78
71
|
"ora": "^5.4.1",
|
|
79
72
|
"recursive-readdir": "^2.2.3",
|
|
80
73
|
"request": "^2.88.0",
|
|
@@ -83,13 +76,11 @@
|
|
|
83
76
|
"rimraf": "^2.6.2",
|
|
84
77
|
"semver": "^7.5.4",
|
|
85
78
|
"tar-stream": "^2.2.0",
|
|
86
|
-
"yaml": "^1.10.0",
|
|
87
79
|
"yargs": "^15.4.1",
|
|
88
80
|
"yargs-parser": "^13.0.0",
|
|
89
81
|
"zip": "^1.2.0"
|
|
90
82
|
},
|
|
91
83
|
"devDependencies": {
|
|
92
|
-
"@types/node-forge": "^1.0.1",
|
|
93
84
|
"@yao-pkg/pkg": "^6.1.1",
|
|
94
85
|
"eslint": "^7.32.0",
|
|
95
86
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const sdk = require('../../../../logic/sdk');
|
|
2
|
-
const _ = require('lodash');
|
|
3
|
-
|
|
4
|
-
async function getNewAgentName(kubeContextName, kubeNamespace, agents) {
|
|
5
|
-
const defaultName = `${kubeContextName}_${kubeNamespace}`;
|
|
6
|
-
if (!agents) {
|
|
7
|
-
// eslint-disable-next-line no-param-reassign
|
|
8
|
-
agents = await sdk.agents.list({ });
|
|
9
|
-
}
|
|
10
|
-
let name;
|
|
11
|
-
|
|
12
|
-
if (!_.isArray(agents) || !_.find(agents, a => a.name === defaultName)) {
|
|
13
|
-
name = defaultName; // use the default name if there are no collisions
|
|
14
|
-
} else {
|
|
15
|
-
const agentsNames = new Set(_.map(agents, a => a.name)); // for fast lookup
|
|
16
|
-
let i = 1;
|
|
17
|
-
while (agentsNames.has(`${defaultName}_${i}`)) {
|
|
18
|
-
i += 1;
|
|
19
|
-
}
|
|
20
|
-
name = `${defaultName}_${i}`;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return name;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
module.exports = {
|
|
27
|
-
getNewAgentName,
|
|
28
|
-
};
|
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
|
-
const cliProgress = require('cli-progress');
|
|
3
|
-
const colors = require('colors');
|
|
4
|
-
const Command = require('../../Command');
|
|
5
|
-
const installRoot = require('../root/install.cmd');
|
|
6
|
-
const { sdk } = require('../../../../logic');
|
|
7
|
-
const installRuntimeCmd = require('../runtimeEnvironments/install.cmd');
|
|
8
|
-
const { getKubeContext } = require('../../helpers/kubernetes');
|
|
9
|
-
const ProgressEvents = require('../../helpers/progressEvents');
|
|
10
|
-
const { getNewAgentName } = require('./helper');
|
|
11
|
-
const { DefaultLogFormatter } = require('../hybrid/helper');
|
|
12
|
-
const Output = require('../../../../output/Output');
|
|
13
|
-
|
|
14
|
-
const defaultNamespace = 'codefresh';
|
|
15
|
-
|
|
16
|
-
async function createAgent(argv) {
|
|
17
|
-
const {
|
|
18
|
-
name,
|
|
19
|
-
kubeConfigPath,
|
|
20
|
-
kubeContextName = getKubeContext(kubeConfigPath),
|
|
21
|
-
kubeNamespace = defaultNamespace,
|
|
22
|
-
} = argv;
|
|
23
|
-
const finalName = name || await getNewAgentName(kubeContextName, kubeNamespace);
|
|
24
|
-
try {
|
|
25
|
-
const { token } = await sdk.agents.create({ name: finalName });
|
|
26
|
-
console.log(`A Codefresh Runner with the name: ${colors.cyan(finalName)} has been created.`);
|
|
27
|
-
return token;
|
|
28
|
-
} catch (err) {
|
|
29
|
-
const msg = Output._extractErrorMessage(err);
|
|
30
|
-
if (msg.includes('Agent name duplication')) {
|
|
31
|
-
throw new Error(`A Codefresh Runner with the name "${colors.cyan(finalName)}" already exists. Please choose a different name, or delete the current agent from the platform.`);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
throw err;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
async function getAgentNameByToken(token) {
|
|
39
|
-
const [apiKey] = token.split('.');
|
|
40
|
-
const agentData = await sdk.tokens.getById({ id: apiKey });
|
|
41
|
-
if (!agentData) {
|
|
42
|
-
throw new Error('token is not valid');
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const {
|
|
46
|
-
subject: {
|
|
47
|
-
type,
|
|
48
|
-
ref,
|
|
49
|
-
},
|
|
50
|
-
} = agentData;
|
|
51
|
-
|
|
52
|
-
if (type !== 'agent') {
|
|
53
|
-
throw new Error('token is not assosicated with a runner');
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const { name } = await sdk.agents.get({ agentId: ref });
|
|
57
|
-
return name;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
async function installAgentInCluster(argv, token, agentName) {
|
|
61
|
-
const {
|
|
62
|
-
kubeNodeSelector,
|
|
63
|
-
dryRun,
|
|
64
|
-
inCluster,
|
|
65
|
-
tolerations,
|
|
66
|
-
dockerRegistry,
|
|
67
|
-
skipVersionCheck,
|
|
68
|
-
kubeConfigPath,
|
|
69
|
-
kubeContextName = getKubeContext(kubeConfigPath),
|
|
70
|
-
kubeNamespace = defaultNamespace,
|
|
71
|
-
envVars,
|
|
72
|
-
verbose,
|
|
73
|
-
terminateProcess,
|
|
74
|
-
} = argv;
|
|
75
|
-
|
|
76
|
-
const apiHost = sdk.config.context.url;
|
|
77
|
-
const events = new ProgressEvents();
|
|
78
|
-
const format = 'downloading [{bar}] {percentage}% | {value}/{total}';
|
|
79
|
-
const progressBar = new cliProgress.SingleBar({ stopOnComplete: true, format }, cliProgress.Presets.shades_classic);
|
|
80
|
-
let totalSize;
|
|
81
|
-
events.onStart((size) => {
|
|
82
|
-
console.log('Downloading Codefresh Runner installer \n');
|
|
83
|
-
progressBar.start(size, 0);
|
|
84
|
-
totalSize = size;
|
|
85
|
-
});
|
|
86
|
-
events.onProgress((progress) => {
|
|
87
|
-
progressBar.update(progress);
|
|
88
|
-
if (progress >= totalSize) {
|
|
89
|
-
console.log('\n');
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
const agentInstallStatusCode = await sdk.agents.install({
|
|
93
|
-
agentId: agentName,
|
|
94
|
-
apiHost,
|
|
95
|
-
token,
|
|
96
|
-
kubeConfigPath,
|
|
97
|
-
kubeContextName,
|
|
98
|
-
kubeNamespace,
|
|
99
|
-
kubeNodeSelector,
|
|
100
|
-
inCluster,
|
|
101
|
-
dockerRegistry,
|
|
102
|
-
tolerations,
|
|
103
|
-
skipVersionCheck,
|
|
104
|
-
envVars,
|
|
105
|
-
events,
|
|
106
|
-
dryRun,
|
|
107
|
-
verbose,
|
|
108
|
-
terminateProcess,
|
|
109
|
-
logFormatting: DefaultLogFormatter,
|
|
110
|
-
});
|
|
111
|
-
if (agentInstallStatusCode !== 0) {
|
|
112
|
-
throw new Error(`\nRunner installation failed with code ${agentInstallStatusCode}`);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
async function installRuntimeFunc(argv, agentName) {
|
|
117
|
-
const {
|
|
118
|
-
runtimeName,
|
|
119
|
-
skipReCreation,
|
|
120
|
-
buildNodeSelector,
|
|
121
|
-
storageClassName,
|
|
122
|
-
setValue,
|
|
123
|
-
setFile,
|
|
124
|
-
agentKubeContextName,
|
|
125
|
-
agentKubeNamespace,
|
|
126
|
-
kubeConfigPath,
|
|
127
|
-
kubeContextName,
|
|
128
|
-
kubeNamespace,
|
|
129
|
-
skipClusterCreation,
|
|
130
|
-
makeDefaultRuntime,
|
|
131
|
-
platformOnly,
|
|
132
|
-
verbose,
|
|
133
|
-
terminateProcess,
|
|
134
|
-
} = argv;
|
|
135
|
-
await installRuntimeCmd.handler({
|
|
136
|
-
runtimeName,
|
|
137
|
-
skipReCreation,
|
|
138
|
-
skipClusterCreation,
|
|
139
|
-
runtimeKubeConfigPath: kubeConfigPath,
|
|
140
|
-
runtimeKubeContextName: kubeContextName,
|
|
141
|
-
runtimeKubeNamespace: kubeNamespace,
|
|
142
|
-
kubeNodeSelector: buildNodeSelector,
|
|
143
|
-
storageClassName,
|
|
144
|
-
setValue,
|
|
145
|
-
setFile,
|
|
146
|
-
makeDefaultRuntime,
|
|
147
|
-
attachRuntime: true,
|
|
148
|
-
agentName,
|
|
149
|
-
agentKubeContextName,
|
|
150
|
-
agentKubeNamespace,
|
|
151
|
-
restartAgent: true,
|
|
152
|
-
platformOnly,
|
|
153
|
-
verbose,
|
|
154
|
-
terminateProcess,
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const installAgentCmd = new Command({
|
|
159
|
-
root: false,
|
|
160
|
-
parent: installRoot,
|
|
161
|
-
command: 'agent',
|
|
162
|
-
description: 'Install and create an agent on kubernetes cluster',
|
|
163
|
-
webDocs: {
|
|
164
|
-
category: 'Agents',
|
|
165
|
-
title: 'Install',
|
|
166
|
-
weight: 100,
|
|
167
|
-
},
|
|
168
|
-
builder: (yargs) => yargs
|
|
169
|
-
.env('CF_ARG_') // this means that every process.env.CF_ARG_* will be passed to argv
|
|
170
|
-
.option('name', {
|
|
171
|
-
describe: 'Agent\'s name to be created if token is not provided',
|
|
172
|
-
})
|
|
173
|
-
.option('token', {
|
|
174
|
-
describe: 'Agent\'s token',
|
|
175
|
-
})
|
|
176
|
-
.option('kube-context-name', {
|
|
177
|
-
describe: 'Name of the kubernetes context on which runner should be installed [$CF_ARG_KUBE_CONTEXT_NAME]',
|
|
178
|
-
})
|
|
179
|
-
.option('kube-node-selector', {
|
|
180
|
-
describe: 'The kubernetes node selector "key=value" to be used by runner build resources (default is no node selector) (string)',
|
|
181
|
-
})
|
|
182
|
-
.option('dry-run', {
|
|
183
|
-
describe: 'Set to true to simulate installation',
|
|
184
|
-
})
|
|
185
|
-
.option('in-cluster', {
|
|
186
|
-
describe: 'Set flag if runner is been installed from inside a cluster',
|
|
187
|
-
})
|
|
188
|
-
.option('kube-namespace', {
|
|
189
|
-
describe: 'Name of the namespace on which runner should be installed [$CF_ARG_KUBE_NAMESPACE]',
|
|
190
|
-
})
|
|
191
|
-
.option('tolerations', {
|
|
192
|
-
describe: 'The kubernetes tolerations as path to a JSON file to be used by runner resources (default is no tolerations) (string)',
|
|
193
|
-
})
|
|
194
|
-
.option('kube-config-path', {
|
|
195
|
-
describe: 'Path to kubeconfig file (default is $HOME/.kube/config)',
|
|
196
|
-
})
|
|
197
|
-
.option('skip-version-check', {
|
|
198
|
-
describe: 'Do not compare current runner\'s version with latest',
|
|
199
|
-
})
|
|
200
|
-
.option('install-runtime', {
|
|
201
|
-
describe: 'Install and attach runtime on the same namespace as the agent (default is false)',
|
|
202
|
-
})
|
|
203
|
-
.option('runtime-name', {
|
|
204
|
-
describe: 'The name of the runtime to install',
|
|
205
|
-
})
|
|
206
|
-
.option('build-node-selector', {
|
|
207
|
-
describe: 'The kubernetes node selector "key=value" to be used by runner build resources (default is no node selector) (string)',
|
|
208
|
-
})
|
|
209
|
-
.option('skip-re-creation', {
|
|
210
|
-
description: 'If set to true, will skip runtime creation in the platform',
|
|
211
|
-
})
|
|
212
|
-
.option('set-value', {
|
|
213
|
-
describe: 'Set values for templates, example: --set-value LocalVolumesDir=/mnt/disks/ssd0/codefresh-volumes',
|
|
214
|
-
})
|
|
215
|
-
.option('set-file', {
|
|
216
|
-
describe: 'Set values for templates from file, example: --set-file Storage.GoogleServiceAccount=/path/to/service-account.json',
|
|
217
|
-
})
|
|
218
|
-
.option('skip-cluster-creation', {
|
|
219
|
-
description: 'If set to true, will skip cluster integration creation for this runtime',
|
|
220
|
-
})
|
|
221
|
-
.option('make-default-runtime', {
|
|
222
|
-
describe: 'should all pipelines run on the hybrid runtime (default is false)',
|
|
223
|
-
})
|
|
224
|
-
.option('storage-class-name', {
|
|
225
|
-
describe: 'Set a name of your custom storage class, note: this will not install volume provisioning components',
|
|
226
|
-
})
|
|
227
|
-
.option('agent-kube-context-name', {
|
|
228
|
-
describe: 'Agent kubernetes context (on attach)',
|
|
229
|
-
})
|
|
230
|
-
.option('agent-kube-namespace', {
|
|
231
|
-
describe: 'Agent\'s namespace (on attach)',
|
|
232
|
-
})
|
|
233
|
-
.option('docker-registry', {
|
|
234
|
-
describe: 'The prefix for the container registry that will be used for pulling the required components images. Example: --docker-registry="docker.io"',
|
|
235
|
-
type: 'string',
|
|
236
|
-
})
|
|
237
|
-
.option('platform-only', {
|
|
238
|
-
describe: 'Set to true to create runtime on the platform side only',
|
|
239
|
-
})
|
|
240
|
-
.option('verbose', {
|
|
241
|
-
describe: 'Print logs',
|
|
242
|
-
}),
|
|
243
|
-
handler: async (argv) => {
|
|
244
|
-
const {
|
|
245
|
-
agentKubeNamespace,
|
|
246
|
-
installRuntime,
|
|
247
|
-
platformOnly,
|
|
248
|
-
} = argv;
|
|
249
|
-
let {
|
|
250
|
-
name,
|
|
251
|
-
token,
|
|
252
|
-
} = argv;
|
|
253
|
-
|
|
254
|
-
if (installRuntimeFunc && !agentKubeNamespace) {
|
|
255
|
-
throw new Error('agent-kube-namespace is a mandatory parameter when installing runtime');
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
if (!token) {
|
|
259
|
-
// Create an agent if not provided
|
|
260
|
-
token = await createAgent(argv);
|
|
261
|
-
} else {
|
|
262
|
-
// take the agent name from the token
|
|
263
|
-
const nameFromToken = await getAgentNameByToken(token);
|
|
264
|
-
if (!name) {
|
|
265
|
-
name = nameFromToken;
|
|
266
|
-
} else if (name !== nameFromToken) {
|
|
267
|
-
throw new Error(`token is assosicated with agent ${nameFromToken}, different from supplied '--name ${name}'`);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
if (!platformOnly) {
|
|
272
|
-
await installAgentInCluster(argv, token, name);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
if (installRuntime) {
|
|
276
|
-
await installRuntimeFunc(argv, name);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
console.log(token);
|
|
280
|
-
},
|
|
281
|
-
});
|
|
282
|
-
|
|
283
|
-
module.exports = installAgentCmd;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
|
-
const Command = require('../../Command');
|
|
3
|
-
const deleteAgent = require('../agent/delete.cmd');
|
|
4
|
-
const unInstallRoot = require('../root/uninstall.cmd');
|
|
5
|
-
const { sdk } = require('../../../../logic');
|
|
6
|
-
const { getKubeContext } = require('../../helpers/kubernetes');
|
|
7
|
-
const ProgressEvents = require('../../helpers/progressEvents');
|
|
8
|
-
const cliProgress = require('cli-progress');
|
|
9
|
-
const { DefaultLogFormatter } = require('./../hybrid/helper');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const unInstallAgentCmd = new Command({
|
|
13
|
-
root: false,
|
|
14
|
-
parent: unInstallRoot,
|
|
15
|
-
command: 'agent',
|
|
16
|
-
description: 'Uninstall an agent on kubernetes cluster',
|
|
17
|
-
webDocs: {
|
|
18
|
-
category: 'Agents',
|
|
19
|
-
title: 'Uninstall',
|
|
20
|
-
weight: 100,
|
|
21
|
-
},
|
|
22
|
-
builder: yargs => yargs
|
|
23
|
-
.env('CF_ARG_') // this means that every process.env.CF_ARG_* will be passed to argv
|
|
24
|
-
.option('name', {
|
|
25
|
-
describe: 'Agent\'s name to be uninstalled',
|
|
26
|
-
})
|
|
27
|
-
.option('kube-context-name', {
|
|
28
|
-
describe: 'Name of the kubernetes context on which venona should be uninstalled [$CF_ARG_KUBE_CONTEXT_NAME]',
|
|
29
|
-
})
|
|
30
|
-
.option('kube-namespace', {
|
|
31
|
-
describe: 'Name of the namespace on which venona should be uninstalled [$CF_ARG_KUBE_NAMESPACE]',
|
|
32
|
-
})
|
|
33
|
-
.option('kube-config-path', {
|
|
34
|
-
describe: 'Path to kubeconfig file (default is $HOME/.kube/config)',
|
|
35
|
-
})
|
|
36
|
-
.option('verbose', {
|
|
37
|
-
describe: 'Print logs',
|
|
38
|
-
}),
|
|
39
|
-
handler: async (argv) => {
|
|
40
|
-
const {
|
|
41
|
-
name,
|
|
42
|
-
'kube-namespace': kubeNamespace,
|
|
43
|
-
'kube-config-path': kubeConfigPath,
|
|
44
|
-
terminateProcess,
|
|
45
|
-
|
|
46
|
-
} = argv;
|
|
47
|
-
|
|
48
|
-
let { 'kube-context-name': kubeContextName } = argv;
|
|
49
|
-
|
|
50
|
-
if (!kubeContextName) {
|
|
51
|
-
kubeContextName = getKubeContext(kubeConfigPath);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (!name) {
|
|
55
|
-
throw new Error('Name is a mandatory parameter');
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const events = new ProgressEvents();
|
|
59
|
-
const format = 'downloading [{bar}] {percentage}% | {value}/{total}';
|
|
60
|
-
const progressBar = new cliProgress.SingleBar({ stopOnComplete: true, format }, cliProgress.Presets.shades_classic);
|
|
61
|
-
let totalSize;
|
|
62
|
-
events.onStart((size) => {
|
|
63
|
-
progressBar.start(size, 0);
|
|
64
|
-
totalSize = size;
|
|
65
|
-
});
|
|
66
|
-
events.onProgress((progress) => {
|
|
67
|
-
progressBar.update(progress);
|
|
68
|
-
if (progress >= totalSize) {
|
|
69
|
-
console.log('\n');
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const exitCode = await sdk.agents.unInstall({
|
|
75
|
-
kubeContextName,
|
|
76
|
-
kubeNamespace,
|
|
77
|
-
kubeConfigPath,
|
|
78
|
-
terminateProcess: false,
|
|
79
|
-
events,
|
|
80
|
-
logFormatting: DefaultLogFormatter,
|
|
81
|
-
});
|
|
82
|
-
if (exitCode === 0) {
|
|
83
|
-
console.log('Agent uninstalled successfully');
|
|
84
|
-
await deleteAgent.handler({ name, id: name });
|
|
85
|
-
}
|
|
86
|
-
if (terminateProcess !== false) {
|
|
87
|
-
process.exit(0);
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
module.exports = unInstallAgentCmd;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const _ = require('lodash');
|
|
2
|
-
const inquirer = require('inquirer').default;
|
|
3
|
-
const YAML = require('yaml');
|
|
4
|
-
const { readFileSync, lstatSync } = require('fs');
|
|
5
|
-
const { resolve } = require('path');
|
|
6
|
-
const { INSTALLATION_DEFAULTS } = require('../hybrid/helper');
|
|
7
|
-
const { getKubeContext } = require('../../helpers/kubernetes');
|
|
8
|
-
|
|
9
|
-
const selectRuntime = async (runtimes) => {
|
|
10
|
-
const ans = await inquirer.prompt({
|
|
11
|
-
type: 'list',
|
|
12
|
-
name: 're',
|
|
13
|
-
message: 'Name of Codefresh runtime-environment to use',
|
|
14
|
-
choices: runtimes,
|
|
15
|
-
});
|
|
16
|
-
return ans.re;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const selectNamespace = async () => {
|
|
20
|
-
const ans = await inquirer.prompt({
|
|
21
|
-
type: 'input',
|
|
22
|
-
name: 'namespace',
|
|
23
|
-
message: 'Name of Kubernetes namespace to use',
|
|
24
|
-
default: INSTALLATION_DEFAULTS.NAMESPACE,
|
|
25
|
-
});
|
|
26
|
-
return ans.namespace;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const selectHost = async () => {
|
|
30
|
-
const ans = await inquirer.prompt({
|
|
31
|
-
type: 'input',
|
|
32
|
-
name: 'host',
|
|
33
|
-
message: 'The hostname that will be used by the app-proxy ingress',
|
|
34
|
-
});
|
|
35
|
-
return ans.host;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const setIfNotDefined = (obj, prop, value) => {
|
|
39
|
-
_.set(obj, prop, _.get(obj, prop, value));
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const mergeWithValues = (argv) => {
|
|
43
|
-
if (!argv.values || !lstatSync(resolve(process.cwd(), argv.values)).isFile()) {
|
|
44
|
-
return argv;
|
|
45
|
-
}
|
|
46
|
-
const valuesFileStr = readFileSync(resolve(process.cwd(), argv.values), 'utf8');
|
|
47
|
-
const valuesObj = YAML.parse(valuesFileStr);
|
|
48
|
-
|
|
49
|
-
setIfNotDefined(argv, 'kube-namespace', valuesObj.Namespace || INSTALLATION_DEFAULTS.NAMESPACE);
|
|
50
|
-
setIfNotDefined(argv, 'kube-context-name', valuesObj.Context || getKubeContext());
|
|
51
|
-
setIfNotDefined(argv, 'host', _.get(valuesObj, 'AppProxy.Ingress.Host'));
|
|
52
|
-
setIfNotDefined(argv, 'pathPrefix', _.get(valuesObj, 'AppProxy.Ingress.PathPrefix', ''));
|
|
53
|
-
setIfNotDefined(argv, 'runtime-environment', valuesObj.RuntimeEnvironmentName);
|
|
54
|
-
|
|
55
|
-
return argv;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
module.exports = {
|
|
59
|
-
selectRuntime,
|
|
60
|
-
mergeWithValues,
|
|
61
|
-
selectNamespace,
|
|
62
|
-
selectHost,
|
|
63
|
-
};
|