- Docker Plugin: https://plugins.jenkins.io/docker-plugin/
- On remote server (apllication server). Comment these line:
- from
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac- to
# If not running interactively, don't do anything
#case $- in
# *i*) ;;
# *) return;;
#esac- Generate SSH key and add to remote(application server)
# generate ssh
ssh-keygen
# copy ssh key to remote server
ssh-copy-id <user>@<server_ip>- Upload private key to Jenkins credential
- On Jenkins UI
Dashboard>Manage Jenkins>Credentials>System>Global credentials (unrestricted) - Click on
Add Credentials - Upload file
~/.ssh/id_rsato Jenkins credential
3. Config Jenkins share library
- On Jenkins UI
Dashboard>Manage Jenkins>System>Global Pipeline Libraries - Add Share library as follows:
4. After that we can use share library in Jenkins file as follows:
@Library("cicd")_
pipelineFileName() // file name in "vars" folder example:
@Library("cicd")_
frontend() // file name in "vars" folder