Compare commits
2 Commits
1a3f5c6654
...
fee4969910
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fee4969910 | ||
|
|
dabcb4cab3 |
@@ -58,6 +58,9 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
# Project directory - allows git pull and rebuild
|
# Project directory - allows git pull and rebuild
|
||||||
- .:/app/deploy
|
- .:/app/deploy
|
||||||
|
# SSH Keys for git authentication
|
||||||
|
- ~/.ssh/aurora_bot_key:/home/bun/.ssh/id_ed25519:ro
|
||||||
|
- ~/.ssh/known_hosts:/home/bun/.ssh/known_hosts:ro
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
|
|||||||
@@ -24,7 +24,14 @@ async function execWithTimeout(
|
|||||||
options: { cwd?: string } = {}
|
options: { cwd?: string } = {}
|
||||||
): Promise<{ stdout: string; stderr: string }> {
|
): Promise<{ stdout: string; stderr: string }> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const process = exec(cmd, { cwd: options.cwd }, (error: ExecException | null, stdout: string, stderr: string) => {
|
const child = exec(cmd, {
|
||||||
|
cwd: options.cwd,
|
||||||
|
env: {
|
||||||
|
...process.env,
|
||||||
|
GIT_TERMINAL_PROMPT: "0",
|
||||||
|
GIT_SSH_COMMAND: "ssh -o BatchMode=yes"
|
||||||
|
}
|
||||||
|
}, (error: ExecException | null, stdout: string, stderr: string) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(error);
|
reject(error);
|
||||||
} else {
|
} else {
|
||||||
@@ -33,11 +40,11 @@ async function execWithTimeout(
|
|||||||
});
|
});
|
||||||
|
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
process.kill("SIGTERM");
|
child.kill("SIGTERM");
|
||||||
reject(new Error(`Command timed out after ${timeoutMs}ms: ${cmd}`));
|
reject(new Error(`Command timed out after ${timeoutMs}ms: ${cmd}`));
|
||||||
}, timeoutMs);
|
}, timeoutMs);
|
||||||
|
|
||||||
process.on("exit", () => clearTimeout(timer));
|
child.on("exit", () => clearTimeout(timer));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -572,6 +579,7 @@ export class UpdateService {
|
|||||||
deployProcess.unref();
|
deployProcess.unref();
|
||||||
|
|
||||||
output += `🚀 Deploy triggered - container will restart\n`;
|
output += `🚀 Deploy triggered - container will restart\n`;
|
||||||
|
console.log("Deploy triggered successfully:", output);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user