@hua-ri/dsh-ops 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/README.md +60 -2
- package/client.js +183 -0
- package/cordis.patch.yml +3 -0
- package/index.js +1079 -0
- package/lib/argocd/instances.mjs +50 -0
- package/lib/argocd/mod.mjs +221 -0
- package/lib/argowf/instances.mjs +52 -0
- package/lib/argowf/mod.mjs +219 -0
- package/lib/cli.mjs +95 -0
- package/lib/client.js +56 -0
- package/lib/helm/mod.mjs +281 -0
- package/lib/k8s/context.mjs +179 -0
- package/lib/k8s/mod.mjs +347 -0
- package/lib/ssh/config.mjs +53 -0
- package/lib/ssh/hosts.mjs +94 -0
- package/lib/ssh/keys.mjs +76 -0
- package/lib/ssh/mod.mjs +476 -0
- package/lib/ssh/snippet-vars.mjs +22 -0
- package/lib/ssh/tunnels.mjs +97 -0
- package/package.json +60 -4
- package/scripts/doctor.mjs +35 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { which } from '../lib/cli.mjs'
|
|
4
|
+
|
|
5
|
+
const deps = [
|
|
6
|
+
{ bin: 'ssh', module: 'ssh', install: 'macOS 自带', required: true },
|
|
7
|
+
{ bin: 'kubectl', module: 'k8s', install: 'brew install kubectl', required: true },
|
|
8
|
+
{ bin: 'helm', module: 'helm', install: 'brew install helm', required: false },
|
|
9
|
+
{ bin: 'argocd', module: 'argocd', install: 'brew install argocd', required: false },
|
|
10
|
+
{ bin: 'argo', module: 'argowf', install: 'brew install argo', required: false },
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
async function main() {
|
|
14
|
+
console.log('dsh-ops 依赖检查\n')
|
|
15
|
+
let allOk = true
|
|
16
|
+
|
|
17
|
+
for (const dep of deps) {
|
|
18
|
+
const path = await which(dep.bin)
|
|
19
|
+
const status = path ? '✓' : '✗'
|
|
20
|
+
const hint = path ? path : `未找到 — ${dep.install}`
|
|
21
|
+
const tag = dep.required ? '(默认启用)' : '(按需启用)'
|
|
22
|
+
console.log(` ${status} ${dep.bin.padEnd(10)} ${dep.module.padEnd(8)} ${tag} ${hint}`)
|
|
23
|
+
if (!path && dep.required) allOk = false
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
console.log('')
|
|
27
|
+
if (allOk) {
|
|
28
|
+
console.log('基础依赖就绪。argocd/argo 按需安装即可。')
|
|
29
|
+
} else {
|
|
30
|
+
console.log('⚠ 有必需依赖缺失,请先安装。')
|
|
31
|
+
process.exitCode = 1
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
main().catch((e) => { console.error(e); process.exitCode = 1 })
|