As Jenkins is one of the most popular CI tools on the market with over a thousand plugins, in this article, we are going to set up a CI pipeline for a SpringBoot application. Use nsenter to attach the Jenkins container, and run commands in Jenkins container to generate ssh key, then the Jenkins server will have .ssh folder generated under ~, under the .ssh folder there are id_rsa (private key) and id_rsa.pub (public key). Copy the c ontent in id_rsa.pub, and go back to the remote server on which jenkins will SSH and execute shell scripts and deploy the application, and paste the content in ~/authorized_keys. Restart the ssh service in remote server, and create a folder to put scripts into it and modify the permission of it. Install the plugin “Publish over SSH” in Jenkins, and configure it, then test the connection.

Related Articles