bad assumption
This commit is contained in:
@@ -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!
|
||||
|
||||
Reference in New Issue
Block a user