Monday, 29 May 2017

How to use SSH in Jenkins Pipeline?

I have some Jenkins jobs defined using Jenkins Pipeline Model Definition, which build NPM projects. I use Docker containers to build these projects (using common image with just node+npm+yarn).

Result of the builds are contained in dist/ folder, that I zipped using zip pipeline command.

I want to copy this zip file to an other server using SSH/SCP (with private key auth). My private key is added to Jenkins environment (credentials manager), but when I use Docker containers, SSH connection cannot be established.

I tried to add agent { label 'master' } to use master Jenkins node for file transfer, but it seems to create a clean workspace with new Git fetch, and without my built files.

Thanks in advance for your support.



via lbar

No comments:

Post a Comment