O'Reilly logo

Continuous Integration, Delivery, and Deployment by Sander Rossel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

C# .NET Core Deployment using SSH

Next up is the C# web application. We have already done most of the work; now set up SSH.

Fixing our Jenkinsfile so that it copies our archived files automatically should not be a problem. We can do this again using SSH. First, we need to make Jenkins the owner of the webshop-net folder:

sudo chown -R jenkins:jenkins /var/www/webshop-net

Again, this means that your root user loses privileges, and if you want to copy using WinSCP, you should use the jenkins user.

After that, it is pretty much the same as for the JavaScript webshop:

sh 'rm -rf /var/www/webshop-net/*'sh 'scp -r prod/* jenkins@ciserver:/var/www/webshop-net'

The complete code for the Archive Artifacts and Deployment steps looks as follows:

stage('Archiving ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required