I’m trying to create a deployment project containing SSH and SCP tasks using the authentication type SSH private key with shared credentials.
The DSL task ssh has the methods passwordAuth / keyWithoutPassphrase / keyWithPassphrase for setting the authType to one of these… but not for Shared Credentials.
I thought I could use SharedCredentialsAuth as follows
ssh(host: host, userName: username) { description desc bambooFacade.requireSharedCredentials(sharedCredentialsName) authType = new SharedCredentialsAuth(SharedCredentialsAuth.SharedCredentialsType.SSH, sharedCredentialsName, bambooFacade) command sshCommand }
But while this ran and created the tasks, the configuration details were missing (as they wouldn't be returned by SshTask.getConfig) and it resulted in an error in Bamboo
java.lang.NullPointerException: Name is null at java.lang.Enum.valueOf(Enum.java:236) at com.atlassian.bamboo.plugins.scp.AuthType.valueOf(AuthType.java:3) at com.atlassian.bamboo.plugins.scp.AuthType.byName(AuthType.java:32)
I can create these using custom tasks, but this requires the sharedCredentialsId instead of name. Also using the custom task for SCP task the artifactToScp is a combination of ids and pattern, which would be better for me to reference by artifactName.
I’m trying to create a deployment project containing SSH and SCP tasks using the authentication type SSH private key with shared credentials.
The DSL task ssh has the methods passwordAuth / keyWithoutPassphrase / keyWithPassphrase for setting the authType to one of these… but not for Shared Credentials.
I thought I could use SharedCredentialsAuth as follows
ssh(host: host, userName: username) { description desc bambooFacade.requireSharedCredentials(sharedCredentialsName) authType = new SharedCredentialsAuth(SharedCredentialsAuth.SharedCredentialsType.SSH, sharedCredentialsName, bambooFacade) command sshCommand }
But while this ran and created the tasks, the configuration details were missing (as they wouldn't be returned by SshTask.getConfig) and it resulted in an error in Bamboo
java.lang.NullPointerException: Name is null at java.lang.Enum.valueOf(Enum.java:236) at com.atlassian.bamboo.plugins.scp.AuthType.valueOf(AuthType.java:3) at com.atlassian.bamboo.plugins.scp.AuthType.byName(AuthType.java:32)
I can create these using custom tasks, but this requires the sharedCredentialsId instead of name. Also using the custom task for SCP task the artifactToScp is a combination of ids and pattern, which would be better for me to reference by artifactName.
Thanks for your time, M