We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e124265 + 456d102 commit 3b3bc30Copy full SHA for 3b3bc30
src/Deployer/Task/Common/PrepareSshTaskGlobal.php
@@ -19,13 +19,22 @@ class PrepareSshTaskGlobal extends TaskBase
19
{
20
private const BITBUCKET_KEY_PATH = '/opt/atlassian/pipelines/agent/ssh/id_rsa';
21
22
+ private const KEY_PATHS = [
23
+ self::BITBUCKET_KEY_PATH,
24
+ '~/.ssh/id_rsa',
25
+ '~/.ssh/id_ed25519'
26
+ ];
27
+
28
public function configure(Configuration $config): void
29
30
set('ssh_key_file', function () {
- if (testLocally('[ -f ' . self::BITBUCKET_KEY_PATH . ' ]')) {
- return self::BITBUCKET_KEY_PATH;
31
+ foreach (self::KEY_PATHS as $path) {
32
+ if (testLocally("[ -f $path ]")) {
33
+ return $path;
34
+ }
35
}
- return '~/.ssh/id_rsa';
36
37
+ return '~/.ssh/id_rsa'; // Fallback
38
});
39
40
task('prepare:ssh', function () {
0 commit comments