@starship-ci/generator
Version:
Kubernetes manifest generator for Starship deployments
37 lines (36 loc) • 1.39 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EthereumBuilder = void 0;
const configmap_1 = require("./configmap");
const service_1 = require("./service");
const statefulset_1 = require("./statefulset");
/**
* Main Ethereum builder
* Orchestrates ConfigMap, Service, and StatefulSet generation for all Ethereum chains
*/
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 configmap_1.EthereumConfigMapGenerator(chain, this.config));
// Services
this.generators.push(new service_1.EthereumServiceGenerator(chain, this.config));
// StatefulSets
this.generators.push(new statefulset_1.EthereumStatefulSetGenerator(chain, this.config));
});
}
generate() {
return this.generators.flatMap((generator) => generator.generate());
}
}
exports.EthereumBuilder = EthereumBuilder;