From ed75f774575395e55e8e2af997a619ccc7e1afbb Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 1 Feb 2023 23:10:13 +0000 Subject: [PATCH] envrionment test --- Jenkinsfile | 6 ++++-- build.gradle | 11 ++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) 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