From 5de8f6c5f017aeae10bb3537d17b13a1b8700e89 Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 1 Feb 2023 07:26:49 +0000 Subject: [PATCH] environment test --- Jenkinsfile | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5e2b0b9..c0bebf2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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" } } } - } } \ No newline at end of file