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