import userConfig from "../config"; import hash from "object-hash"; export type DeployerService = { user: string; repo: string; branch: string; }; export type DeployerConfig = { services: { [host: string]: DeployerService }; giteaUrl: string; directory: string; basePort: number; token: string; systemServicesDir: string; }; export const config = userConfig as DeployerConfig; export const indexedConfig = Object.fromEntries( Object.entries(config.services).map(([host, service], i) => [ hash(service), { ...service, host, port: config.basePort + i, }, ]) ); export const isSelf = ({ user, repo }: DeployerService) => `${user}/${repo}` == "drm/deployer2";