Not able to run attlassian command in jenkins job under node

Logeshwari March 6, 2024

I have created a job for automation where code are copied to node and executed 

java -cp "./*" -p $NewPass


This command works in jira in cd /apps/jira/server/bin path

Working example securecrt:

[jira@cvjrad0004 bin]$ pwd
[jira@cvjrad0004 bin]$ PASS="newpass"
[jira@cvjrad0004 bin]$ ENC_PASS=`java -cp "./*" -p $PASS | grep '<password>' `
[jira@cvjrad0004 bin]$ echo $ENC_PASS 
[jira@cvjrad0004 bin]$

and not working if i add in job using ssh

sshpass -p $password ssh $username@$IP ' 
sudo su - jira << 'EOF'
cd /apps/jira/server/bin
java -cp "./*" -p $NewPass | grep '<password>'
EOF  '



Before adding line: Last login: Wed Mar 6 05:19:22 EST 2024 jira /apps/jira/server/bin [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline Finished: SUCCESS

after adding java cp command Eror:

password_rotation_automation/Aurora_Local_DB_Password_Rotation/Jira/ line 18: password: No such file or directory[Pipeline] }[Pipeline] // stage[Pipeline] }[Pipeline] // node[Pipeline] End of PipelineERROR: script returned exit code 1


0 answers

Suggest an answer

Log in or Sign up to answer