Skip to content

Commit

Permalink
Bump version to 6.10 because of new features.
Browse files Browse the repository at this point in the history
  • Loading branch information
sschnabe committed Aug 9, 2023
1 parent e2f0912 commit 7d247c7
Show file tree
Hide file tree
Showing 29 changed files with 367 additions and 408 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Add following dependency to your pom.xml:
<dependency>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.9.0</version>
<version>6.10.0</version>
</dependency>
```

Expand All @@ -49,7 +49,7 @@ The default setting is to construct the Helm download URL based upon the detecte
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.9.0</version>
<version>6.10.0</version>
<configuration>
<chartDirectory>${project.basedir}</chartDirectory>
<chartVersion>${project.version}</chartVersion>
Expand All @@ -70,7 +70,7 @@ If you leave `helmVersion` and `helmDownloadUrl` empty the plugin will determine
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.9.0</version>
<version>6.10.0</version>
<configuration>
<chartDirectory>${project.basedir}</chartDirectory>
<chartVersion>${project.version}</chartVersion>
Expand All @@ -94,7 +94,7 @@ When `useLocalHelmBinary` is enabled, the plugin by default will search for the
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.9.0</version>
<version>6.10.0</version>
<configuration>
<chartDirectory>${project.basedir}</chartDirectory>
<chartVersion>${project.version}</chartVersion>
Expand All @@ -117,7 +117,7 @@ and disables the auto-detection feature:
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.9.0</version>
<version>6.10.0</version>
<configuration>
<chartDirectory>${project.basedir}</chartDirectory>
<chartVersion>${project.version}</chartVersion>
Expand All @@ -141,7 +141,7 @@ and disables the auto-detection feature:
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.9.0</version>
<version>6.10.0</version>
<configuration>
<chartDirectory>${project.basedir}</chartDirectory>
<chartVersion>${project.version}</chartVersion>
Expand Down Expand Up @@ -173,7 +173,7 @@ and disables the auto-detection feature:
<plugin>
<groupId>io.kokuwa.maven</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>6.9.0</version>
<version>6.10.0</version>
<configuration>
<chartDirectory>${project.basedir}</chartDirectory>
<chartVersion>${project.version}</chartVersion>
Expand Down Expand Up @@ -311,9 +311,9 @@ Parameter | Type | User Property | Required | Description
`<kubeToken>` | string | helm.kubeToken | false | bearer token used for authentication
`<releaseName>` | string | helm.releaseName | false | Name of the release for upgrade goal
`<installAtomic>` | boolean | helm.install.atomic | false | Set this to `true` to delete the installation on failure.
`<installTimeout>` | boolean | helm.upgrade.imeout | false | Time in seconds to wait for any individual Kubernetes operation during install process. The default is 300 seconds if `installAtomic` is set to `true`.
`<installTimeout>` | boolean | helm.upgrade.imeout | false | Time in seconds to wait for any individual Kubernetes operation during install process. The default is 300 seconds (from helm) if `installAtomic` is set to `true`.
`<upgradeAtomic>` | boolean | helm.upgrade.atomic | false | Set this to `true` to rollback changes made in case of failed upgrade.
`<upgradeTimeout>` | boolean | helm.upgrade.imeout | false | Time in seconds to wait for any individual Kubernetes operation during upgrade process. The default is 300 seconds if `upgradeTimeout` is set to `true`.
`<upgradeTimeout>` | boolean | helm.upgrade.imeout | false | Time in seconds to wait for any individual Kubernetes operation during upgrade process. The default is 300 seconds (from helm) if `upgradeTimeout` is set to `true`.
`<upgradeDryRun>` | boolean | helm.upgrade.dryRun | false | Run upgrade goal only in dry run mode
`<templateOutputDir>` | file | helm.template.output-dir | false | Writes the executed templates to files in output-dir instead of stdout.
`<templateGenerateName>` | boolean | helm.template.generate-name | false | Generate the name (and omit the NAME parameter).
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<artifactId>helm-maven-plugin</artifactId>
<version>6.9.1-SNAPSHOT</version>
<version>6.10.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<name>Helm Maven Plugin</name>
Expand Down
2 changes: 1 addition & 1 deletion src/it/dependency-with-overwrite/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
invoker.os.family = linux, windows
invoker.os.family = linux, windows
35 changes: 22 additions & 13 deletions src/main/java/io/kokuwa/maven/helm/DependencyBuildMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,36 @@ public class DependencyBuildMojo extends AbstractHelmMojo {
private boolean skipDependencyBuild;

/**
* Controls whether a local path chart should be used for a chart dependency. When set to <code>true</code>,
* chart dependencies on a local path chart will be overwritten with the respective properties set by
* "helm.overwriteDependencyVersion" and "helm.overwriteDependencyRepository". This is helpful for deploying charts
* Controls whether a local path chart should be used for a chart dependency. When set to <code>true</code>, chart
* dependencies on a local path chart will be overwritten with the respective properties set by
* "helm.overwriteDependencyVersion" and "helm.overwriteDependencyRepository". This is helpful for deploying charts
* with intra repository dependencies, while still being able to use local path dependencies for development builds.
*
* Example usage:
* For development: mvn clean install
* For deployment: mvn clean deploy -Dhelm.overwriteLocalDependencies=true
* @since 6.9.1
* <ul>
* <li>For development: mvn clean install</li>
* <li>For deployment: mvn clean deploy -Dhelm.overwriteLocalDependencies=true</li>
* </ul>
*
* @since 6.10.0
*/
@Parameter(property = "helm.overwriteLocalDependencies", defaultValue = "false")
private boolean overwriteLocalDependencies;

/**
* Value used to overwrite a local path chart's version within a chart's dependencies. The property
* Value used to overwrite a local path chart's version within a chart's dependencies. The property
* "helm.overwriteLocalDependencies" must be set to <code>true</code> for this to apply.
*
* @since 6.9.1
* @since 6.10.0
*/
@Parameter(property = "helm.overwriteDependencyVersion")
private String overwriteDependencyVersion;

/**
* Value used to overwrite a local path chart's repository within a chart's dependencies. The property
* Value used to overwrite a local path chart's repository within a chart's dependencies. The property
* "helm.overwriteLocalDependencies" must be set to <code>true</code> for this to apply.
*
* @since 6.9.1
* @since 6.10.0
*/
@Parameter(property = "helm.overwriteDependencyRepository")
private String overwriteDependencyRepository;
Expand All @@ -70,10 +73,16 @@ public void execute() throws MojoExecutionException {
}

for (Path chartDirectory : getChartDirectories()) {

if (overwriteLocalDependencies) {
DependencyOverwriter dependencyOverwriter =
new DependencyOverwriter(overwriteDependencyRepository, overwriteDependencyVersion, getLog());
dependencyOverwriter.execute(chartDirectory);
if (overwriteDependencyRepository == null) {
throw new MojoExecutionException("Null value for 'overwriteDependencyRepository' is " +
"not allowed when using 'overwriteLocalDependencies'. See the README for more details.");
}
getLog().info("Overwriting dependencies that contain local path charts with "
+ overwriteDependencyRepository);
new DependencyOverwriter(overwriteDependencyRepository, overwriteDependencyVersion, getLog())
.execute(chartDirectory);
}

getLog().info("Build chart dependencies for " + chartDirectory + " ...");
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/kokuwa/maven/helm/InstallMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class InstallMojo extends AbstractHelmWithValueOverrideMojo {
* @since 6.10.0
*/
@Parameter(property = "helm.install.timeout")
private int installTimeout;
private Integer installTimeout;

/**
* Set this to <code>true</code> to skip invoking install goal.
Expand All @@ -66,11 +66,11 @@ public void execute() throws MojoExecutionException, MojoFailureException {
for (Path chartDirectory : getChartDirectories()) {
getLog().info(String.format("\n\nPerform install for chart %s...", chartDirectory) +
(installAtomic ? " with atomic" : "") +
(installTimeout > 0 ? String.format(" timeout %s", installTimeout) : ""));
(installTimeout != null ? installTimeout + "s" : ""));
helm()
.arguments(action, chartDirectory.getFileName().toString(), chartDirectory)
.flag("atomic", installAtomic)
.flag("timeout", installTimeout > 0 ? installTimeout + "s" : null)
.flag("timeout", installTimeout != null ? installTimeout + "s" : null)
.execute("Failed to deploy helm chart");
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/kokuwa/maven/helm/UpgradeMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class UpgradeMojo extends AbstractHelmWithValueOverrideMojo {
* @since 6.10.0
*/
@Parameter(property = "helm.upgrade.timeout")
private int upgradeTimeout;
private Integer upgradeTimeout;

/**
* Upgrade with install parameter.
Expand Down Expand Up @@ -79,15 +79,15 @@ public void execute() throws MojoExecutionException {
getLog().info("Upgrading the chart " +
(upgradeWithInstall ? "with install " : "") +
(upgradeAtomic ? "with atomic " : "") +
(upgradeTimeout > 0 ? String.format("timeout %s ", upgradeTimeout) : "") +
(upgradeTimeout != null ? upgradeTimeout + "s" : "") +
(upgradeDryRun ? "as dry run " : "") +
chartDirectory);
helm()
.arguments("upgrade", releaseName, chartDirectory)
.flag("install", upgradeWithInstall)
.flag("dry-run", upgradeDryRun)
.flag("atomic", upgradeAtomic)
.flag("timeout", upgradeTimeout > 0 ? upgradeTimeout + "s" : null)
.flag("timeout", upgradeTimeout != null ? upgradeTimeout + "s" : null)
.execute("Error occurred while upgrading the chart");
}
}
Expand Down
19 changes: 9 additions & 10 deletions src/main/java/io/kokuwa/maven/helm/pojo/Dependencies.java
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
package io.kokuwa.maven.helm.pojo;

import java.util.ArrayList;
import java.util.List;

import lombok.Data;

/**
* POJO for list of Chart.yaml dependencies
* POJO for list of "Chart.yaml" dependencies.
*
* @since 6.9.1
* @since 6.10.0
*/
@Data
public class Dependencies {
private ArrayList<Dependency> dependencies;

private List<Dependency> dependencies;

@Data
public static class Dependency {

private String name;
private String version;
private String repository;
private String version;

/**
* Determines whether the repository/version will be updated
* for a given dependency.
*/
private boolean overwrite = false;
/** Determines whether the repository/version will be updated for a given dependency. */
private boolean overwrite = false;
}
}
Loading

0 comments on commit 7d247c7

Please sign in to comment.