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,8 +42,10 @@ 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,
"service.template"
)} | envsubst > ${path.join(serviceDir, systemdServiceName)}`.env({
host, host,
port: port.toString(), port: port.toString(),
repo, repo,
@@ -51,8 +55,7 @@ export const deploy = async ({ host, commitHash }: DeployInstance) => {
logsDir: path.join(serviceDir, "logs"), logsDir: path.join(serviceDir, "logs"),
serviceDir, serviceDir,
user: isSelf(service) ? "root" : "drm", 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!