https://hongddo.tistory.com/208?category=869534
https://hongddo.tistory.com/209?category=869534
Dashboard -> Credentials -> System ->Global credentials (unrestricted) -> Add Credentials
http://localhost:7070/credentials/store/system/domain/_/newCredentials
Add Credentials 클릭 시 정보 입력 화면에서 정보 추가
Kind : Username with password 선택
Scope : Global 선택
Username : 깃 사용자명
Password : 깃 비밀번호
ID : pipeline 에서 사용할 ID
Description : 설명
ex)
====================================================================================================
Kind : Username with password
Scope : Global
Username : gitLoginId
Password : gitLoginPassword
ID : kimsc_git
Description : git의 로그인 계정
====================================================================================================
젠킨스에서 깃 체크아웃을 받을 때, 아래와 같이 작성해서 받으면 됨
git credentialsId: 'kimsc_git', url: 'https://github.com/kkimsungchul/stock.git', branch: 'master'
ex)
====================================================================================================
pipeline {
agent any
stages {
stage('Checkout') {
steps {
git credentialsId: 'kimsc_git', url: 'https://github.com/kkimsungchul/stock.git', branch: 'master'
}
}
}
}