From 11dd15cde7ab516fa0470fcf82668191335e01d1 Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 1 Feb 2023 07:11:40 +0000 Subject: [PATCH] environment test --- Jenkinsfile | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d8ce430..77d32c4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,30 +1,28 @@ -pipeline { - agent any // 사용 가능한 에이전트에서 이 파이프라인 또는 해당 단계를 실행 - - stages { - stage('Build') { - steps { - // gralew이 있어야됨. git clone해서 project를 가져옴. - sh 'chmod +x gradlew' - sh './gradlew clean build' +podTemplate( + containers: [ + containerTemplate( + name: 'gradle', + image: 'gradle:4.5.1-jdk9', + command: 'cat', + ttyEnabled: true + ) + ], + + volumes: [ + hostPathVolume( + mountPath: '/home/gradle/.gradle', + hostPath: '/tmp/jenkins/.gradle' + ), + ] +) - - sh 'ls -al ./build' - } - post { - success { - echo 'gradle build success' - } - - failure { - echo 'gradle build failed' - } - } - } - stage('Test') { - steps { - echo '테스트 단계와 관련된 몇 가지 단계를 수행합니다.' +{ + node(POD_LABEL) { + stage('Build') { + container('gradle') { + sh "gradle build" } } } + } } \ No newline at end of file