bad assumption

This commit is contained in:
2025-11-29 23:03:53 -05:00
parent 3122bf4d29
commit 85f8bec61e

View File

@@ -16,6 +16,8 @@ export const deploy = async ({ host, commitHash }: DeployInstance) => {
console.log(`=== ${deploymentId} ===`); console.log(`=== ${deploymentId} ===`);
console.log({ host, commitHash }); console.log({ host, commitHash });
const deployerDir = await $`pwd`.text();
const service = config.services[host]; const service = config.services[host];
const { user, repo, branch, port } = indexedConfig[hash(service)]; const { user, repo, branch, port } = indexedConfig[hash(service)];
@@ -40,19 +42,20 @@ export const deploy = async ({ host, commitHash }: DeployInstance) => {
// Register service // Register service
const systemdServiceName = `deployer2-${host}.service`; const systemdServiceName = `deployer2-${host}.service`;
await l$`cat service.template | envsubst > ${serviceDir}/${systemdServiceName}`.env( await l$`cat ${path.join(
{ deployerDir,
host, "service.template"
port: port.toString(), )} | envsubst > ${path.join(serviceDir, systemdServiceName)}`.env({
repo, host,
branch, port: port.toString(),
commitHash, repo,
deploymentId, branch,
logsDir: path.join(serviceDir, "logs"), commitHash,
serviceDir, deploymentId,
user: isSelf(service) ? "root" : "drm", logsDir: path.join(serviceDir, "logs"),
} serviceDir,
); user: isSelf(service) ? "root" : "drm",
});
await l$`ln -sf ${serviceDir}/${systemdServiceName} ${config.systemServicesDir}/${systemdServiceName}`; await l$`ln -sf ${serviceDir}/${systemdServiceName} ${config.systemServicesDir}/${systemdServiceName}`;
// Start! // Start!