Parse colors in output with ansi-color plugin.

master
Icedream 2018-05-07 20:31:54 +02:00
parent f110d78447
commit 828cc82bd5
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
1 changed files with 15 additions and 11 deletions

26
Jenkinsfile vendored
View File

@ -22,19 +22,23 @@ node("docker && linux && amd64") {
def tomcatVersion = version[0] def tomcatVersion = version[0]
def jreVersion = version[1] def jreVersion = version[1]
ansiColor {
def image = docker.build(
"${dockerNamespace}/${dockerBase}:tomcat${tomcatVersion}-jre${jreVersion}",
"--build-arg TOMCAT_VERSION=${tomcatVersion} --build-arg JRE_VERSION=${jreVersion} .")
}
def guacamoleVersion def guacamoleVersion
def image = docker.build(
"${dockerNamespace}/${dockerBase}:tomcat${tomcatVersion}-jre${jreVersion}",
"--build-arg TOMCAT_VERSION=${tomcatVersion} --build-arg JRE_VERSION=${jreVersion} .")
image.inside("-w /tmp") { image.inside("-w /tmp") {
sh """ ansiColor {
unzip /opt/guacamole/guacamole.war META-INF/maven/org.apache.guacamole/guacamole/pom.properties sh """
""" unzip /opt/guacamole/guacamole.war META-INF/maven/org.apache.guacamole/guacamole/pom.properties
guacamoleVersion = sh( """
script: "grep -Po '(?i)^version=\\K.+\\s*\$' META-INF/maven/org.apache.guacamole/guacamole/pom.properties", guacamoleVersion = sh(
returnStdout: true, script: "grep -Po '(?i)^version=\\K.+\\s*\$' META-INF/maven/org.apache.guacamole/guacamole/pom.properties",
).trim() returnStdout: true,
).trim()
}
} }
def imageTag = "${dockerNamespace}/${dockerBase}:${guacamoleVersion}-tomcat${tomcatVersion}-jre${jreVersion}" def imageTag = "${dockerNamespace}/${dockerBase}:${guacamoleVersion}-tomcat${tomcatVersion}-jre${jreVersion}"