Skip to content

Commit

Permalink
Merge branch 'release/2.13.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pvorb committed Apr 21, 2023
2 parents 9f57387 + 4ece0fc commit e89a3a8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

## Unreleased
## Version 2.13.0

* Support escaping placeholders with backslash e.g. `\${MY_ENV_VAR}` will no longer be expanded

## Version 2.12.0

* Converted README and CHANGELOG to Markdown
* Add option to provide additional values files
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

<groupId>com.deviceinsight.helm</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>2.12.0</version>
<version>2.13.0</version>
<packaging>maven-plugin</packaging>

<name>Helm Maven Plugin</name>
<description>A Maven Plugin for Helm Charts</description>
<url>https://github.com/deviceinsight/helm-maven-plugin</url>

<properties>
<kotlin.version>1.8.10</kotlin.version>
<kotlin.version>1.8.20</kotlin.version>
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<maven.version>3.6.2</maven.version>
<maven.version>3.8.1</maven.version>
<maven-project.version>2.2.1</maven-project.version>

<jackson-bom.version>2.14.2</jackson-bom.version>
Expand All @@ -28,7 +28,7 @@
<junit.jupiter.version>5.9.2</junit.jupiter.version>
<assertj-core.version>3.24.2</assertj-core.version>

<dokka-maven-plugin.version>1.7.20</dokka-maven-plugin.version>
<dokka-maven-plugin.version>1.8.10</dokka-maven-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<gitflow-maven-plugin.version>1.19.0</gitflow-maven-plugin.version>
Expand Down
16 changes: 11 additions & 5 deletions src/main/kotlin/com/deviceinsight/helm/PackageMojo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import java.io.IOException
class PackageMojo : ResolveHelmMojo(), ServerAuthentication {

companion object {
private val PLACEHOLDER_REGEX = Regex("""\$\{(.*?)}""")
private val PLACEHOLDER_REGEX = Regex("""(\\?)\$\{(.*?)}""")
private val SUBSTITUTED_EXTENSIONS = setOf("json", "tpl", "yml", "yaml")
}

Expand Down Expand Up @@ -173,11 +173,17 @@ class PackageMojo : ResolveHelmMojo(), ServerAuthentication {
file.useLines { lines ->
lines.map { line ->
PLACEHOLDER_REGEX.replace(line) { matchResult ->
val property = matchResult.groupValues[1]

when (val propertyValue = findPropertyValue(property, targetFile.absolutePath)) {
null -> matchResult.groupValues[0]
else -> propertyValue
val isEscaped = matchResult.groupValues[1] == "\\"
val property = matchResult.groupValues[2]

if (isEscaped) {
matchResult.groupValues[0].substring(1)
} else {
when (val propertyValue = findPropertyValue(property, targetFile.absolutePath)) {
null -> matchResult.groupValues[0]
else -> propertyValue
}
}
}
}.forEach {
Expand Down

0 comments on commit e89a3a8

Please sign in to comment.