티스토리 뷰

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 배포 일어나는 곳
    }
}

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함