From eaa2cd23938a427eb9de57eabd861f94d60fae01 Mon Sep 17 00:00:00 2001 From: Jason Brodie Date: Mon, 8 Jan 2024 15:17:10 -0500 Subject: [PATCH 1/7] Try to see if the socket tmp file already exists --- lib/run.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/run.js b/lib/run.js index 015a4e6..b160529 100644 --- a/lib/run.js +++ b/lib/run.js @@ -37,9 +37,14 @@ function decrypt_key(deploy_key, enc_rsa_key_pth, options) { yield runner1.exec(); const authSock = '/tmp/ssh-auth.sock' - const runner2 = new toolrunner.ToolRunner('ssh-agent', ['-a', authSock]); - yield runner2.exec(); - + var socketExists = io.exists(authSock, (e) => { + console.log(e ? 'it exists' : 'no passwd!'); + }); + if (!socketExists) { + const runner2 = new toolrunner.ToolRunner('ssh-agent', ['-a', authSock]); + yield runner2.exec(); + } + core.exportVariable('SSH_AUTH_SOCK', authSock); const runner3 = new toolrunner.ToolRunner('ssh-add', ['config/deploy_id_rsa'], options); yield runner3.exec(); From 1dced0e26116c43d2733a07facfda01379cce4aa Mon Sep 17 00:00:00 2001 From: Jason Brodie Date: Mon, 8 Jan 2024 15:31:49 -0500 Subject: [PATCH 2/7] Updated the capistrano repo to a commit to test --- lib/run.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/run.js b/lib/run.js index b160529..581ec05 100644 --- a/lib/run.js +++ b/lib/run.js @@ -37,14 +37,15 @@ function decrypt_key(deploy_key, enc_rsa_key_pth, options) { yield runner1.exec(); const authSock = '/tmp/ssh-auth.sock' - var socketExists = io.exists(authSock, (e) => { - console.log(e ? 'it exists' : 'no passwd!'); - }); - if (!socketExists) { + console.log('Checking for socket file'); + console.log(yield io.exists(authSock)); + + // if (yield io.exists(authSock)) { + // console.log('Checking for socket file'); const runner2 = new toolrunner.ToolRunner('ssh-agent', ['-a', authSock]); yield runner2.exec(); - } - + // } + core.exportVariable('SSH_AUTH_SOCK', authSock); const runner3 = new toolrunner.ToolRunner('ssh-add', ['config/deploy_id_rsa'], options); yield runner3.exec(); From 43086aa32c24e4be32ca9e306031e72efd435e26 Mon Sep 17 00:00:00 2001 From: Jason Brodie Date: Mon, 8 Jan 2024 15:35:35 -0500 Subject: [PATCH 3/7] Trying to check if a file exists --- lib/run.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/run.js b/lib/run.js index 581ec05..2b93709 100644 --- a/lib/run.js +++ b/lib/run.js @@ -38,14 +38,13 @@ function decrypt_key(deploy_key, enc_rsa_key_pth, options) { const authSock = '/tmp/ssh-auth.sock' console.log('Checking for socket file'); - console.log(yield io.exists(authSock)); + console.log(exists(authSock)); // if (yield io.exists(authSock)) { // console.log('Checking for socket file'); const runner2 = new toolrunner.ToolRunner('ssh-agent', ['-a', authSock]); yield runner2.exec(); // } - core.exportVariable('SSH_AUTH_SOCK', authSock); const runner3 = new toolrunner.ToolRunner('ssh-add', ['config/deploy_id_rsa'], options); yield runner3.exec(); From a7bf96a314056a266a35c023ddeeedf2a5ea8431 Mon Sep 17 00:00:00 2001 From: Jason Brodie Date: Mon, 8 Jan 2024 15:38:45 -0500 Subject: [PATCH 4/7] Trying to check if a file exists --- lib/run.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/run.js b/lib/run.js index 2b93709..60e4000 100644 --- a/lib/run.js +++ b/lib/run.js @@ -38,7 +38,7 @@ function decrypt_key(deploy_key, enc_rsa_key_pth, options) { const authSock = '/tmp/ssh-auth.sock' console.log('Checking for socket file'); - console.log(exists(authSock)); + console.log(fs.exists(authSock)); // if (yield io.exists(authSock)) { // console.log('Checking for socket file'); From 22ad6b192c6c203684f6674f0596fe0508e4bf05 Mon Sep 17 00:00:00 2001 From: Jason Brodie Date: Mon, 8 Jan 2024 15:45:10 -0500 Subject: [PATCH 5/7] Trying to check if a file exists --- lib/run.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/run.js b/lib/run.js index 60e4000..4ef9046 100644 --- a/lib/run.js +++ b/lib/run.js @@ -37,9 +37,9 @@ function decrypt_key(deploy_key, enc_rsa_key_pth, options) { yield runner1.exec(); const authSock = '/tmp/ssh-auth.sock' - console.log('Checking for socket file'); - console.log(fs.exists(authSock)); - + if (existsSync(authSock)) { + console.log('The path exists.'); + } // if (yield io.exists(authSock)) { // console.log('Checking for socket file'); const runner2 = new toolrunner.ToolRunner('ssh-agent', ['-a', authSock]); From b7f7109aa0792073837b9094990d06b8aff2a2ef Mon Sep 17 00:00:00 2001 From: Jason Brodie Date: Mon, 8 Jan 2024 15:46:11 -0500 Subject: [PATCH 6/7] Trying to check if a file exists --- lib/run.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/run.js b/lib/run.js index 4ef9046..a942d9a 100644 --- a/lib/run.js +++ b/lib/run.js @@ -37,7 +37,7 @@ function decrypt_key(deploy_key, enc_rsa_key_pth, options) { yield runner1.exec(); const authSock = '/tmp/ssh-auth.sock' - if (existsSync(authSock)) { + if (fs.existsSync(authSock)) { console.log('The path exists.'); } // if (yield io.exists(authSock)) { From 4f704b6fb5dcad33d17409f75b9c5ea1e706a5de Mon Sep 17 00:00:00 2001 From: Jason Brodie Date: Mon, 8 Jan 2024 15:49:58 -0500 Subject: [PATCH 7/7] Trying to check if a file exists --- lib/run.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/run.js b/lib/run.js index a942d9a..19dc8e6 100644 --- a/lib/run.js +++ b/lib/run.js @@ -37,14 +37,10 @@ function decrypt_key(deploy_key, enc_rsa_key_pth, options) { yield runner1.exec(); const authSock = '/tmp/ssh-auth.sock' - if (fs.existsSync(authSock)) { - console.log('The path exists.'); - } - // if (yield io.exists(authSock)) { - // console.log('Checking for socket file'); + if (!fs.existsSync(authSock)) { const runner2 = new toolrunner.ToolRunner('ssh-agent', ['-a', authSock]); yield runner2.exec(); - // } + } core.exportVariable('SSH_AUTH_SOCK', authSock); const runner3 = new toolrunner.ToolRunner('ssh-add', ['config/deploy_id_rsa'], options); yield runner3.exec();