30 lines
552 B
TypeScript
30 lines
552 B
TypeScript
import userConfig from "../config";
|
|
import hash from "object-hash";
|
|
|
|
export type DeployerConfig = {
|
|
services: {
|
|
[host: string]: {
|
|
user: string;
|
|
repo: string;
|
|
branch: string;
|
|
};
|
|
};
|
|
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,
|
|
},
|
|
])
|
|
);
|