environment test

This commit is contained in:
crusader 2023-02-01 22:39:33 +00:00
parent 85f5b778e8
commit a8778adaa8

21
Jenkinsfile vendored
View File

@ -1,3 +1,23 @@
import org.gradle.tooling.GradleConnector
import org.gradle.tooling.ProjectConnection
import org.gradle.tooling.model.GradleProject
def getIncludedProjectNamesMap(Project project) {
def projectNamesMap = new HashMap<String, String>()
project.gradle.includedBuilds.each { includedBuild ->
ProjectConnection connection = GradleConnector.newConnector()
.forProjectDirectory(includedBuild.projectDir)
.connect()
GradleProject includedProject = connection.getModel(GradleProject.class);
def name = includedProject.getName();
connection.close();
projectNamesMap.put includedBuild.name, name;
}
return projectNamesMap
}
def label = "worker-${UUID.randomUUID().toString()}"
podTemplate(
@ -45,6 +65,7 @@ podTemplate(
def app_version_value = sh(returnStdout: true, script: "cat build.gradle | grep -o 'version = [^,]*'").trim()
sh "echo Project in version value: $app_version_value"
def app_version = app_version_value.split(/=/)[1].trim()
println getIncludedProjectNamesMap(project)
stage('Test') {
try {