@starship-ci/generator
Version:
Kubernetes manifest generator for Starship deployments
33 lines (32 loc) • 1.25 kB
JavaScript
import { EthereumConfigMapGenerator } from './configmap';
import { EthereumServiceGenerator } from './service';
import { EthereumStatefulSetGenerator } from './statefulset';
/**
* Main Ethereum builder
* Orchestrates ConfigMap, Service, and StatefulSet generation for all Ethereum chains
*/
export class EthereumBuilder {
config;
generators;
constructor(config) {
this.config = config;
this.generators = [];
// Filter ethereum chains
const ethereumChains = this.config.chains?.filter((chain) => chain.name === 'ethereum' || chain.name.startsWith('ethereum-')) || [];
if (ethereumChains.length === 0) {
return; // No ethereum chains to process
}
// Per-chain generators
ethereumChains.forEach((chain) => {
// ConfigMaps
this.generators.push(new EthereumConfigMapGenerator(chain, this.config));
// Services
this.generators.push(new EthereumServiceGenerator(chain, this.config));
// StatefulSets
this.generators.push(new EthereumStatefulSetGenerator(chain, this.config));
});
}
generate() {
return this.generators.flatMap((generator) => generator.generate());
}
}