cicd-java-spring-boot/Jenkinsfile

26 lines
999 B
Plaintext
Raw Normal View History

2023-02-01 07:26:49 +00:00
/* pipeline 변수 설정 */
def DOCKER_IMAGE_NAME = "twofootdog/project-repo" // 생성하는 Docker image 이름
def DOCKER_IMAGE_TAGS = "batch-visualizer-auth" // 생성하는 Docker image 태그
def NAMESPACE = "ns-project"
def VERSION = "${env.BUILD_NUMBER}"
def DATE = new Date();
2023-02-01 07:11:40 +00:00
2023-02-01 07:26:49 +00:00
podTemplate(label: 'builder',
containers: [
containerTemplate(name: 'gradle', image: 'gradle:7.6-jdk11', command: 'cat', ttyEnabled: true),
],
volumes: [
hostPathVolume(mountPath: '/home/gradle/.gradle', hostPath: '/tmp/jenkins/.gradle'),
]) {
node('builder') {
stage('Checkout') {
checkout scm // gitlab으로부터 소스 다운
}
2023-02-01 07:11:40 +00:00
stage('Build') {
container('gradle') {
2023-02-01 07:26:49 +00:00
/* 도커 이미지를 활용하여 gradle 빌드를 수행하여 ./build/libs에 jar파일 생성 */
sh "gradle -x test build"
2023-01-31 13:42:28 +00:00
}
}
}
}