environment test

This commit is contained in:
crusader 2023-02-01 07:26:49 +00:00
parent 43790c426c
commit 5de8f6c5f0

40
Jenkinsfile vendored
View File

@ -1,28 +1,26 @@
podTemplate(
containers: [
containerTemplate(
name: 'gradle',
image: 'gradle:jdk11',
command: 'cat',
ttyEnabled: true
)
],
/* 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();
volumes: [
hostPathVolume(
mountPath: '/home/gradle/.gradle',
hostPath: '/tmp/jenkins/.gradle'
),
]
)
{
node(POD_LABEL) {
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으로부터 소스 다운
}
stage('Build') {
container('gradle') {
sh "gradle build"
/* 도커 이미지를 활용하여 gradle 빌드를 수행하여 ./build/libs에 jar파일 생성 */
sh "gradle -x test build"
}
}
}
}
}