feat: pipe deployment logs to stdout

This commit is contained in:
James Murdza 2024-08-18 06:50:11 -07:00
parent cd59b19ac7
commit 170bb45143

View File

@ -26,6 +26,7 @@ export class SecureGitClient {
console.log(`Temporary directory created: ${tempDir}`); console.log(`Temporary directory created: ${tempDir}`);
// Write files to the temporary directory // Write files to the temporary directory
console.log(`Writing ${fileData.length} files.`);
for (const { id, data } of fileData) { for (const { id, data } of fileData) {
const filePath = path.join(tempDir, id); const filePath = path.join(tempDir, id);
const dirPath = path.dirname(filePath); const dirPath = path.dirname(filePath);
@ -33,8 +34,6 @@ export class SecureGitClient {
if (!fs.existsSync(dirPath)) { if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath, { recursive: true }); fs.mkdirSync(dirPath, { recursive: true });
} }
console.log("Writing ", filePath, data);
fs.writeFileSync(filePath, data); fs.writeFileSync(filePath, data);
} }
@ -43,7 +42,10 @@ export class SecureGitClient {
config: [ config: [
'core.sshCommand=ssh -i ' + this.sshKeyPath + ' -o IdentitiesOnly=yes' 'core.sshCommand=ssh -i ' + this.sshKeyPath + ' -o IdentitiesOnly=yes'
] ]
}); }).outputHandler((_command, stdout, stderr) => {
stdout.pipe(process.stdout);
stderr.pipe(process.stderr);
});;
// Initialize a new Git repository // Initialize a new Git repository
await git.init(); await git.init();