Skip to content

Latest commit

 

History

History
57 lines (48 loc) · 1.3 KB

File metadata and controls

57 lines (48 loc) · 1.3 KB

devops-project-cicd

Jenkins Plugin requirements

Remote server config

  • 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

Setup manual

  1. 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>
  1. 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_rsa to Jenkins credential

credentials.png 3. Config Jenkins share library

  • On Jenkins UI Dashboard > Manage Jenkins > System > Global Pipeline Libraries
  • Add Share library as follows:

share-lib.png 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