environment test
This commit is contained in:
parent
a62cee565c
commit
b66ccf5202
7
Jenkinsfile
vendored
7
Jenkinsfile
vendored
|
@ -46,12 +46,15 @@ podTemplate(
|
|||
stage('Test') {
|
||||
try {
|
||||
container('gradle') {
|
||||
def projectDetails = sh(returnStdout: true, script: "gradle -q projectDetails").trim()
|
||||
def projectName = sh(returnStdout: true, script: "gradle -q projectName").trim()
|
||||
def projectVersion = sh(returnStdout: true, script: "gradle -q projectVersion").trim()
|
||||
env.PROJECT_NAME = projectName
|
||||
env.PROJECT_VERSION = projectVersion
|
||||
|
||||
sh """
|
||||
pwd
|
||||
echo "GIT_BRANCH=${gitBranch}" >> /etc/environment
|
||||
echo "GIT_COMMIT=${gitCommit}" >> /etc/environment
|
||||
echo "${projectDetails}" >> /etc/environment
|
||||
gradle test
|
||||
"""
|
||||
}
|
||||
|
|
10
build.gradle
10
build.gradle
|
@ -21,9 +21,13 @@ 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}"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user