728x90
Jenkins 에서 pipeline 으로 build 구성을 할때 아래와 같이 설정 하면 Git pull -> Build -> Run 순서를 가지는 Pipeline 이 구성된다.
pipeline {
agent any
// 반복 주기 설정
triggers {
cron('0 22 * * *')
}
// pipeline Step
stages {
stage('Git Pull') {
steps {
echo "Git Pull"
git branch: 'master',
credentialsId: '[Jenkins credetial 에서 추가]',
url: 'https://github.com/[project]'
}
}
stage('Build') {
steps {
echo "Build"
sh('gradle build')
}
}
stage('Run') {
steps {
echo "Run"
sh('gradle run')
}
}
}
options {
// build log 를 남기는 기준 설정,
// numToKeepStr : 최근 10개를 남기는 옵션
buildDiscarder(logRotator(numToKeepStr: '10') )
}
}
'개발' 카테고리의 다른 글
Spring Boot + Maven 으로 Liquibase ValidationFailedException : liquibase check sums error any changes not postgresql (0) | 2020.06.01 |
---|---|
Ubuntu Static IP Address Setting (0) | 2020.06.01 |
Raspberry Pi 에서 Puppeteer 사용하기 (0) | 2020.06.01 |
WSL(Window Subsystem Linux) Install & Terminal Color Change (0) | 2020.06.01 |
라즈베리 파이 온도 확인하기 (0) | 2020.06.01 |