mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-30 18:15:11 +00:00
[ADF-4733] AdfCli - Kubectl-image add option to install the kubectl (#4941)
* add the npm install kubectl option * fix tslint * add docs
This commit is contained in:
parent
601f975485
commit
7791205077
@ -52,3 +52,5 @@ This command allows you to update a specific service on the rancher env with a s
|
||||
```bash
|
||||
adf-cli kubectl-image --clusterEnv ${clusterEnv} --clusterUrl ${clusterUrl} --username ${username} --token ${token} --deployName ${deployName} --dockerRepo ${dockerRepo} --tag ${tag}
|
||||
```
|
||||
|
||||
You can use the option --installCheck to install kubectl as part of the command
|
||||
|
@ -22,12 +22,12 @@ import { spawnSync } from 'child_process';
|
||||
|
||||
export interface KubeArgs {
|
||||
tag?: string;
|
||||
installCheck?: boolean;
|
||||
username?: string;
|
||||
token?: string;
|
||||
clusterEnv?: string;
|
||||
clusterUrl?: string;
|
||||
dockerRepo?: string;
|
||||
dockerTag?: string;
|
||||
deployName?: string;
|
||||
}
|
||||
|
||||
@ -82,10 +82,22 @@ function _setImage(args: KubeArgs, logger: logging.Logger) {
|
||||
logger.info(response);
|
||||
}
|
||||
|
||||
export default async function (args: KubeArgs, logger: logging.Logger) {
|
||||
_setCluster(args, logger);
|
||||
_setCredentials(args, logger);
|
||||
_setContext(args, logger);
|
||||
_useContext(args, logger);
|
||||
_setImage(args, logger);
|
||||
function _installPerform(args: KubeArgs, logger: logging.Logger) {
|
||||
logger.info('Perform install...');
|
||||
const responseK8sStable = _exec('curl', [`-s`, `https://storage.googleapis.com/kubernetes-release/release/stable.txt`], {}, logger).trim();
|
||||
const k8sRelease = `https://storage.googleapis.com/kubernetes-release/release/${responseK8sStable}/bin/linux/amd64/kubectl`;
|
||||
_exec('curl', [`LO`, `${k8sRelease}`], {}, logger);
|
||||
}
|
||||
|
||||
export default async function (args: KubeArgs, logger: logging.Logger) {
|
||||
if (args.installCheck === true) {
|
||||
_installPerform(args, logger);
|
||||
}
|
||||
if (args.tag !== undefined) {
|
||||
_setCluster(args, logger);
|
||||
_setCredentials(args, logger);
|
||||
_setContext(args, logger);
|
||||
_useContext(args, logger);
|
||||
_setImage(args, logger);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user