728x90 pipeline SSH Agent1 [Jenkins] SSH 사용 - pipeline SSH Agent - jenkins 관리 > Manage Credentials - Stores scoped to Jenkins > global > Add Credntials 선택 - ssh 정보 입력 1 ) PIPELINE 에서 SSH 사용하기 env.TARGET_HOST = "hsnam@192.168.0.2" node { try { stage('ssh-test') { sshagent (credentials: ['192.168.0.2-ssh']) { sh 'ssh -o StrictHostKeyChecking=no "uptime"' } } } catch (env) { echo 'error = ' + env throw env } } 위와 같이 pipline script를 작성하고 job을 실행 하면 해당 서버의 uptime .. 2023. 7. 10. 이전 1 다음 728x90