@starship-ci/client
Advanced tools
Comparing version 2.4.0 to 2.5.0
@@ -12,3 +12,2 @@ import { StarshipConfig } from './config'; | ||
helmNamespace?: string; | ||
kindCluster?: string; | ||
verbose?: boolean; | ||
@@ -63,3 +62,3 @@ curdir?: string; | ||
private ensureFileExists; | ||
deploy(): void; | ||
deploy(options?: string[]): void; | ||
debug(): void; | ||
@@ -66,0 +65,0 @@ deleteHelm(): void; |
@@ -61,2 +61,3 @@ "use strict"; | ||
rpc: 26657, | ||
grpc: 9090, | ||
rest: 1317, | ||
@@ -179,2 +180,3 @@ exposer: 8081, | ||
args.push('--namespace', this.ctx.helmNamespace); | ||
args.push('--create-namespace'); | ||
} | ||
@@ -228,6 +230,6 @@ return args; | ||
} | ||
deploy() { | ||
deploy(options = []) { | ||
this.ensureFileExists(this.ctx.helmFile); | ||
this.log("Installing the helm chart. This is going to take a while....."); | ||
this.exec([ | ||
const cmd = [ | ||
'helm', | ||
@@ -242,3 +244,19 @@ 'install', | ||
...this.getArgs(), | ||
]); | ||
...options, | ||
]; | ||
// Determine the data directory of the config file | ||
const datadir = (0, path_1.resolve)((0, path_1.dirname)(this.ctx.helmFile)); | ||
// Iterate through each chain to add script arguments | ||
this.config.chains.forEach((chain, chainIndex) => { | ||
if (chain.scripts) { | ||
Object.keys(chain.scripts).forEach(scriptKey => { | ||
const script = chain.scripts?.[scriptKey]; | ||
if (script && script.file) { | ||
const scriptPath = (0, path_1.resolve)(datadir, script.file); | ||
cmd.push(`--set-file chains[${chainIndex}].scripts.${scriptKey}.data=${scriptPath}`); | ||
} | ||
}); | ||
} | ||
}); | ||
this.exec(cmd); | ||
this.log("Run \"starship get-pods\" to check the status of the cluster"); | ||
@@ -248,13 +266,3 @@ } | ||
this.ensureFileExists(this.ctx.helmFile); | ||
this.exec([ | ||
'helm', | ||
'install', | ||
'--dry-run', | ||
'--debug', | ||
'-f', | ||
this.ctx.helmFile, | ||
this.ctx.helmName, | ||
this.ctx.helmChart, | ||
...this.getArgs(), , | ||
]); | ||
this.deploy(['--dry-run', '--debug']); | ||
} | ||
@@ -387,2 +395,4 @@ deleteHelm() { | ||
this.forwardPort(chain, chain.ports.rest, chainPodPorts.rest); | ||
if (chain.ports?.grpc) | ||
this.forwardPort(chain, chain.ports.grpc, chainPodPorts.grpc); | ||
if (chain.ports?.exposer) | ||
@@ -389,0 +399,0 @@ this.forwardPort(chain, chain.ports.exposer, chainPodPorts.exposer); |
@@ -57,4 +57,21 @@ export interface Ports { | ||
ports?: Ports; | ||
scripts?: { | ||
createGenesis?: Script; | ||
updateGenesis?: Script; | ||
updateConfig?: Script; | ||
createValidator?: Script; | ||
transferTokens?: Script; | ||
buildChain?: Script; | ||
ibcConnection?: Script; | ||
}; | ||
ics?: { | ||
enabled: boolean; | ||
image?: string; | ||
}; | ||
resources?: Resources; | ||
} | ||
export interface Script { | ||
file?: string; | ||
data?: string; | ||
} | ||
export interface Relayer { | ||
@@ -61,0 +78,0 @@ name: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
; |
@@ -32,2 +32,3 @@ import chalk from 'chalk'; | ||
rpc: 26657, | ||
grpc: 9090, | ||
rest: 1317, | ||
@@ -150,2 +151,3 @@ exposer: 8081, | ||
args.push('--namespace', this.ctx.helmNamespace); | ||
args.push('--create-namespace'); | ||
} | ||
@@ -199,6 +201,6 @@ return args; | ||
} | ||
deploy() { | ||
deploy(options = []) { | ||
this.ensureFileExists(this.ctx.helmFile); | ||
this.log("Installing the helm chart. This is going to take a while....."); | ||
this.exec([ | ||
const cmd = [ | ||
'helm', | ||
@@ -213,3 +215,19 @@ 'install', | ||
...this.getArgs(), | ||
]); | ||
...options, | ||
]; | ||
// Determine the data directory of the config file | ||
const datadir = resolve(dirname(this.ctx.helmFile)); | ||
// Iterate through each chain to add script arguments | ||
this.config.chains.forEach((chain, chainIndex) => { | ||
if (chain.scripts) { | ||
Object.keys(chain.scripts).forEach(scriptKey => { | ||
const script = chain.scripts?.[scriptKey]; | ||
if (script && script.file) { | ||
const scriptPath = resolve(datadir, script.file); | ||
cmd.push(`--set-file chains[${chainIndex}].scripts.${scriptKey}.data=${scriptPath}`); | ||
} | ||
}); | ||
} | ||
}); | ||
this.exec(cmd); | ||
this.log("Run \"starship get-pods\" to check the status of the cluster"); | ||
@@ -219,13 +237,3 @@ } | ||
this.ensureFileExists(this.ctx.helmFile); | ||
this.exec([ | ||
'helm', | ||
'install', | ||
'--dry-run', | ||
'--debug', | ||
'-f', | ||
this.ctx.helmFile, | ||
this.ctx.helmName, | ||
this.ctx.helmChart, | ||
...this.getArgs(), , | ||
]); | ||
this.deploy(['--dry-run', '--debug']); | ||
} | ||
@@ -358,2 +366,4 @@ deleteHelm() { | ||
this.forwardPort(chain, chain.ports.rest, chainPodPorts.rest); | ||
if (chain.ports?.grpc) | ||
this.forwardPort(chain, chain.ports.grpc, chainPodPorts.grpc); | ||
if (chain.ports?.exposer) | ||
@@ -360,0 +370,0 @@ this.forwardPort(chain, chain.ports.exposer, chainPodPorts.exposer); |
@@ -0,1 +1,2 @@ | ||
; | ||
export {}; |
{ | ||
"name": "@starship-ci/client", | ||
"version": "2.4.0", | ||
"version": "2.5.0", | ||
"author": "Dan Lynch <pyramation@gmail.com>", | ||
@@ -58,3 +58,3 @@ "description": "Starship CI Client", | ||
}, | ||
"gitHead": "1d60f55c631b4d0f92a43ad92e9a935298aa3aa5" | ||
"gitHead": "5e2417e3ada8aed63fae80cb7c69cc9e8de06909" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57080
1348