This my Jenkins pipeline script. TOOL_CREDS_USR and TOOL_CREDS_PSW variables are not passed to the remote host. Since variables are null, my job hangs asking for username
I verified python command works, verified it by running directly on remote host with variables substituted
pipeline {
environment {
TOOL_CREDS = credentials('hello')
}
stages {
stage('Deploy') {
steps {
echo 'Deploying....'
sshPublisher(
continueOnError: false,
failOnError: true,
publishers: [
sshPublisherDesc(
configName: "world",
sshTransfer(execCommand: 'python3 -m pip install --index-url https://$TOOL_CREDS_USR:[email protected]/repository/pypi-hosted/simple testpackage')
],
verbose: true
)
]
)
}
}
}
}
I tried ${} but that also fails. Please help
question from:
https://stackoverflow.com/questions/65834063/credential-variable-in-jenkins-publish-over-ssh 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…