Skip to content
Snippets Groups Projects
Commit e313511c authored by Emanuele Aina's avatar Emanuele Aina
Browse files

Jenkinsfile: Simplify SSH code now that hacks are no longer needed


Since commit a3749cd5 removed the need to work around some NSS/SSH
shortcomings, we can now get rid of the last vestiges of the
workarounds, simplifying the code.

Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent 70f21e74
No related branches found
No related tags found
No related merge requests found
......@@ -151,16 +151,13 @@ if (buildOnlyList) {
}
}
// SSH complains loudly if the current user is not in the user database, so fake that
def withSshAgent(credentials, command) {
sshagent(credentials: [ credentials, ] ) {
sh(script: "${command}")
}
}
def uploadDirectory(source, target) {
withSshAgent(upload_credentials, "ssh -oStrictHostKeyChecking=no ${upload_host} mkdir -p ${upload_root}/${target}/")
withSshAgent(upload_credentials, "rsync -e 'ssh -oStrictHostKeyChecking=no' -aP ${source} ${upload_dest}/${target}/")
sshagent(credentials: [ upload_credentials, ] ) {
sh(script: """
ssh -oStrictHostKeyChecking=no ${upload_host} mkdir -p ${upload_root}/${target}/
rsync -e 'ssh -oStrictHostKeyChecking=no' -aP ${source} ${upload_dest}/${target}/
""")
}
}
def pushOstreeRepo(architecture, type, board) {
......@@ -169,7 +166,8 @@ def pushOstreeRepo(architecture, type, board) {
// push if the destination repository already exist, otherwise do a full repo upload
// but use --ignore-existing to mitigate the chance of races
withSshAgent(upload_credentials, """
sshagent(credentials: [ upload_credentials, ] ) {
sh(script: """
cd ${PIPELINE_VERSION}/${architecture}/${type}
if ssh -oStrictHostKeyChecking=no ${upload_host} test -e ${upload_root}/${ostree_path}
then
......@@ -179,6 +177,7 @@ def pushOstreeRepo(architecture, type, board) {
ssh -oStrictHostKeyChecking=no ${upload_host} mkdir -p ${upload_root}/${ostree_path}/
rsync -e 'ssh -oStrictHostKeyChecking=no' --ignore-existing -aP ${repo} ${upload_dest}/${ostree_path}
fi""")
}
// Cleanup uploaded branch
sh(script: """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment