Skip to content

Commit

Permalink
Cr 1885 revert3 (#604)
Browse files Browse the repository at this point in the history
* Revert "rename provider (#603)"

This reverts commit 7435919

* Revert "- fix spelling mistake (#602)"

This reverts commit 6e97b80

* Revert "Cr 1885 inst contr (#598)"

This reverts commit f613666

* Revert "Cr 1885 inst contr (#598)"

This reverts commit f613666
  • Loading branch information
andrii-codefresh authored Dec 10, 2020
1 parent 7435919 commit 0c31cc1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 189 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ module.exports = {
'code': 140,
'ignoreComments': true
}],
'no-console': 0,
'object-curly-newline': 0,
'no-console': 0
},
'env': {
'jest': true,
Expand Down
114 changes: 0 additions & 114 deletions lib/interface/cli/commands/gitops/install-argocd.js

This file was deleted.

64 changes: 11 additions & 53 deletions lib/interface/cli/commands/gitops/install.cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ const installRoot = require('../root/install.cmd');
const { detectProxy } = require('../../helpers/general');
const { downloadProvider } = require('../hybrid/helper');
const { Runner, components } = require('../../../../binary');
const { install: installArgocd } = require('./install-argocd');

const installArgoCmd = new Command({
root: false,
parent: installRoot,
command: 'gitops <provider>',
description: 'Install gitops',
description: 'Install gitops agent',
webDocs: {
category: 'Gitops',
title: 'Install',
Expand All @@ -21,14 +20,14 @@ const installArgoCmd = new Command({
.env('CF_ARG_')
.positional('provider', {
describe: 'Gitops provider',
choices: ['codefresh', 'argocd-agent'],
choices: ['argocd-agent'],
required: true,
})
.option('git-integration', {
describe: 'Name of git integration in Codefresh',
})
.option('codefresh-integration', {
describe: 'Name of gitops integration in Codefresh',
describe: 'Name of argocd integration in Codefresh',
})
.option('argo-host', {
describe: 'Host of argocd installation',
Expand All @@ -37,14 +36,13 @@ const installArgoCmd = new Command({
describe: 'Token of argocd installation. Preferred auth method',
})
.option('argo-username', {
default: 'admin',
describe: 'Username of existing argocd installation. Should be used with argo-password',
describe: 'Username of argocd installation. Should be used with argo-password',
})
.option('argo-password', {
describe: 'Password of existing argocd installation. Should be used with argo-username',
describe: 'Username of argocd installation. Should be used with argo-username',
})
.option('update', {
describe: 'Update gitops integration if exists',
describe: 'Update argocd integration if exists',
})
.option('kube-config-path', {
describe: 'Path to kubeconfig file (default is $HOME/.kube/config)',
Expand Down Expand Up @@ -72,53 +70,16 @@ const installArgoCmd = new Command({
})
.option('https-proxy', {
describe: 'https proxy to be used in the runner',
})
// argocd options
.option('install-manifest', {
describe: 'Url of argocd install manifest',
default: 'https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml',
})
.option('set-argo-password', {
describe: 'Set password for admin user of new argocd installation',
}),
handler: async (argv) => {
let {
// eslint-disable-next-line prefer-const
'kube-config-path': kubeConfigPath,
// eslint-disable-next-line prefer-const
provider,
'http-proxy': httpProxy,
'https-proxy': httpsProxy,
'argo-host': argoHost,
'argo-username': argoUsername,
'argo-password': argoPassword,
} = argv;
const {
'kube-config-path': kubeConfigPath,
'install-manifest': installManifest,
'kube-namespace': kubeNamespace,
'set-argo-password': setArgoPassword,
} = argv;

if (provider === 'codefresh') {
if (!setArgoPassword) {
console.error('\nMissing required argument: set-argo-password');
process.exit(1);
}

if (!kubeNamespace) {
console.error('\nMissing required argument: kube-namespace');
process.exit(1);
}

const result = await installArgocd({
installManifest,
kubeNamespace,
setArgoPassword,
});

provider = 'argocd-agent';
argoHost = result.host;
argoUsername = 'admin';
argoPassword = setArgoPassword;
}

const binLocation = await downloadProvider({ provider });
const componentRunner = new Runner(binLocation);
Expand All @@ -132,11 +93,8 @@ const installArgoCmd = new Command({
commands.push(kubeConfigPath);
}

const installOptions = _.pick(argv, ['git-integration', 'codefresh-integration', 'argo-token', 'output',
'update', 'kube-context-name', 'kube-namespace', 'sync-mode', 'sync-apps']);
installOptions['argo-host'] = argoHost;
installOptions['argo-username'] = argoUsername;
installOptions['argo-password'] = argoPassword;
const installOptions = _.pick(argv, ['git-integration', 'codefresh-integration', 'argo-host', 'argo-token', 'output',
'argo-username', 'argo-password', 'update', 'kube-context-name', 'kube-namespace', 'sync-mode', 'sync-apps']);

_.forEach(installOptions, (value, key) => {
if (_.isArray(value)) {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codefresh",
"version": "0.73.27",
"version": "0.73.28",
"description": "Codefresh command line utility",
"main": "index.js",
"preferGlobal": true,
Expand Down Expand Up @@ -64,7 +64,6 @@
"mongodb": "^3.0.1",
"ora": "^3.0.0",
"prettyjson": "^1.2.1",
"promise-retry": "^2.0.1",
"recursive-readdir": "^2.2.1",
"request": "^2.88.0",
"request-promise": "^4.2.2",
Expand Down
18 changes: 0 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1924,11 +1924,6 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0:
dependencies:
once "^1.4.0"

err-code@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9"
integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==

error-ex@^1.2.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
Expand Down Expand Up @@ -5467,14 +5462,6 @@ [email protected], progress@^2.0.0, progress@~2.0.0:
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==

promise-retry@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-2.0.1.tgz#ff747a13620ab57ba688f5fc67855410c370da22"
integrity sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==
dependencies:
err-code "^2.0.2"
retry "^0.12.0"

prompts@^0.1.9:
version "0.1.14"
resolved "https://registry.yarnpkg.com/prompts/-/prompts-0.1.14.tgz#a8e15c612c5c9ec8f8111847df3337c9cbd443b2"
Expand Down Expand Up @@ -5984,11 +5971,6 @@ retry@^0.10.0:
resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4"
integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=

retry@^0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b"
integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=

rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2:
version "2.7.1"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
Expand Down

0 comments on commit 0c31cc1

Please sign in to comment.