first pass
This commit is contained in:
29
src/config.ts
Normal file
29
src/config.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
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,
|
||||
},
|
||||
])
|
||||
);
|
||||
Reference in New Issue
Block a user