I set up a Jenkins server (on Windows) with MSBuild and a Git server (on FreeBSD) to compile ABTokenTools and deploy them to my web site automatically.
It turned out the only difficult part was the deployment via ssh.
A few hints:
- The Jenkins account (mine is DOMAIN\Jenkins$) must have full control in the directory where Jenkins is installed ("C:\Program Files\Jenkins” in my case).
- The Jenkins account also needs full control of its profile directory (likely “C:\Users\Jenkins$” or something similar). This is probably the case already.
- The Jenkins account furthermore needs read and write access to other directories depending on what Jenkins jobs are supposed to be doing.
- If you are using a managed service account to run Jenkins, as you probably should, use psexec -u domain\jenkins$ -p ~ cmd from a ssh session to log into the Jenkins service account, assuming it is called jenkins$. (In an RDP session you should probably add -i to the psexec parameters. If you are running Jenkins as LocalSystem use -s.)
- Make use of the -v parameter of scp. It will tell you where scp is stuck.
- Make sure the known_hosts file is formatted correctly. You cannot have any questions unanswered when Jenkins runs scp.
- Use the -i parameter of scp to use a specific id_rsa secret key file.
- Use a batch file command powershell Compress-Archive -DestinationPath myzipfile -Path myfolderwithmyartefacts to zip the artefacts for deployment.
See the original article on ABTokenTools which I will hopefully update at some point.
Downloads (perhaps occassionally updated):