diff --git a/Jenkinsfile b/Jenkinsfile index 5cff9bb..3ebf5f3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -49,8 +49,10 @@ podTemplate( stage('Test') { try { container('gradle') { - def project_details = sh(returnStdout: true, script: "gradle -q projectDetails").trim() - sh "echo Project details: $project_details" + def project_name = sh(returnStdout: true, script: "gradle -q projectName").trim() + sh "echo Project name: $project_name" + def project_version = sh(returnStdout: true, script: "gradle -q projectVersion").trim() + sh "echo Project version: $project_version" sh """ pwd diff --git a/build.gradle b/build.gradle index c6851a3..15eb41d 100644 --- a/build.gradle +++ b/build.gradle @@ -21,9 +21,14 @@ tasks.named('test') { useJUnitPlatform() } -task projectDetails { +task projectName { doLast { - println "PROJECT_NAME=${project.name}" - println "PROJECT_VERSION=${project.version}" + println "${project.name}" + } +} + +task projectVersion { + doLast { + println "${project.version}" } } \ No newline at end of file