DevOps/Jenkins
Jenkins 파이프라인
GOD동하
2019. 12. 24. 15:52
Jenkins 에서 pipeline script 설정에 대한 내용
이 외에 Test나 Security 같은 stage를 추가 할 수도 있다.
그건 나중에 Junit, Findbug 같은 다른 걸 연계할 때 고려하는 것으로
node { // Server Config def _stage_config = "dev_stage" // dev_stage, test_stage, gallery_stage def _deploy_server = "testserver" def _git_group = "shindh12" def _git_repo = "jenkins-deploy-test"
// Default Config def app def git_url = "https://github.com/" + _git_group + "/" + _git_repo + ".git"
stage('Preparation') {
// git 저장소에서 checkout 받는 부분 git branch: _branch, credentialsId: '', url: git_url checkout([$class: 'GitSCM', branches: [[name: '*/'+_branch]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '', url: git_url]]])
} stage('Build') { // Run the maven build if (isUnix()) { sh "mvn -Dmaven.test.failure.ignore clean package -DskipTests=true" } else { error 'windows' } } stage('Results') { archiveArtifacts 'target/*.war' }
stage('Deploy') {
// 여기서 ssh 배포 일어나는 곳 } }
|