Skip to content

Commit

Permalink
Merge pull request #5 from kokuwaio/upload-verification
Browse files Browse the repository at this point in the history
Merge main into PR
  • Loading branch information
Cho-William committed Dec 4, 2023
2 parents 35e43f4 + dc91659 commit db6cb0d
Show file tree
Hide file tree
Showing 24 changed files with 36 additions and 35 deletions.
14 changes: 7 additions & 7 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.12.0</version>
<version>6.13.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.12.0</version>
<version>6.13.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.12.0</version>
<version>6.13.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.12.0</version>
<version>6.13.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.12.0</version>
<version>6.13.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.12.0</version>
<version>6.13.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.12.0</version>
<version>6.13.0</version>
<configuration>
<chartDirectory>${project.basedir}</chartDirectory>
<chartVersion>${project.version}</chartVersion>
Expand Down
4 changes: 2 additions & 2 deletions 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.12.1-SNAPSHOT</version>
<version>6.13.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<name>Helm Maven Plugin</name>
Expand Down Expand Up @@ -88,7 +88,7 @@
<!-- we have flaky tests with caching of Authenticator.setDefault() -->
<surefire.rerunFailingTestsCount>3</surefire.rerunFailingTestsCount>

<invoker.debug>true</invoker.debug>
<invoker.debug>false</invoker.debug>
<invoker.parallelThreads>0.5C</invoker.parallelThreads>
<invoker.settingsFile>${project.basedir}/src/it/settings.xml</invoker.settingsFile>

Expand Down
Binary file added src/bin/aarch64/helm
Binary file not shown.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/it/dependency-with-overwrite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<configuration>
<autoDetectLocalHelmBinary>false</autoDetectLocalHelmBinary>
<useLocalHelmBinary>true</useLocalHelmBinary>
<helmExecutableDirectory>${project.basedir}/..</helmExecutableDirectory>
<helmExecutableDirectory>${test.helmExecutableDirectory}</helmExecutableDirectory>
<helmExtraRepos>
<helmExtraRepo>
<name>kokuwaio</name>
Expand Down
2 changes: 1 addition & 1 deletion src/it/extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<configuration>
<autoDetectLocalHelmBinary>false</autoDetectLocalHelmBinary>
<useLocalHelmBinary>true</useLocalHelmBinary>
<helmExecutableDirectory>${project.basedir}/..</helmExecutableDirectory>
<helmExecutableDirectory>${test.helmExecutableDirectory}</helmExecutableDirectory>
<helmExtraRepos>
<helmExtraRepo>
<name>kokuwaio</name>
Expand Down
2 changes: 1 addition & 1 deletion src/it/init-with-debug/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<configuration>
<autoDetectLocalHelmBinary>false</autoDetectLocalHelmBinary>
<useLocalHelmBinary>true</useLocalHelmBinary>
<helmExecutableDirectory>${project.basedir}/..</helmExecutableDirectory>
<helmExecutableDirectory>${test.helmExecutableDirectory}</helmExecutableDirectory>
<helmExtraRepos>
<helmExtraRepo>
<name>kokuwaio-with-credentials</name>
Expand Down
2 changes: 1 addition & 1 deletion src/it/init-with-helm-from-directory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<configuration>
<autoDetectLocalHelmBinary>false</autoDetectLocalHelmBinary>
<useLocalHelmBinary>true</useLocalHelmBinary>
<helmExecutableDirectory>${project.basedir}/..</helmExecutableDirectory>
<helmExecutableDirectory>${test.helmExecutableDirectory}</helmExecutableDirectory>
<addDefaultRepo>false</addDefaultRepo>
<chartDirectory>${project.basedir}/src/main/helm</chartDirectory>
<chartVersion>1.0.0</chartVersion>
Expand Down
3 changes: 2 additions & 1 deletion src/it/init-with-helm-from-directory/postbuild.bsh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// verify that configured helm was used

System.out.println(basedir);
return org.codehaus.plexus.util.FileUtils
.fileRead(basedir + "/build.log")
.contains("Using local HELM binary [" + basedir + "/../helm]")
.contains("Using local HELM binary [" + basedir + "/../../../src/bin/amd64/helm]")
2 changes: 1 addition & 1 deletion src/it/init-without-k8s-warning/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<configuration>
<autoDetectLocalHelmBinary>false</autoDetectLocalHelmBinary>
<useLocalHelmBinary>true</useLocalHelmBinary>
<helmExecutableDirectory>${project.basedir}/..</helmExecutableDirectory>
<helmExecutableDirectory>${test.helmExecutableDirectory}</helmExecutableDirectory>
<addDefaultRepo>false</addDefaultRepo>
<chartDirectory>${project.basedir}/src/main/helm</chartDirectory>
<chartVersion>1.0.0</chartVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/it/lint-with-dependency/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<configuration>
<autoDetectLocalHelmBinary>false</autoDetectLocalHelmBinary>
<useLocalHelmBinary>true</useLocalHelmBinary>
<helmExecutableDirectory>${project.basedir}/..</helmExecutableDirectory>
<helmExecutableDirectory>${test.helmExecutableDirectory}</helmExecutableDirectory>
<helmExtraRepos>
<helmExtraRepo>
<name>kokuwaio</name>
Expand Down
2 changes: 1 addition & 1 deletion src/it/path with spaces/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<configuration>
<autoDetectLocalHelmBinary>false</autoDetectLocalHelmBinary>
<useLocalHelmBinary>true</useLocalHelmBinary>
<helmExecutableDirectory>${project.basedir}/..</helmExecutableDirectory>
<helmExecutableDirectory>${test.helmExecutableDirectory}</helmExecutableDirectory>
<helmExtraRepos>
<helmExtraRepo>
<name>kokuwaio</name>
Expand Down
2 changes: 2 additions & 0 deletions src/it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<maven.compiler.source>@maven.compiler.source@</maven.compiler.source>
<maven.compiler.target>@maven.compiler.target@</maven.compiler.target>

<test.helmExecutableDirectory>${project.basedir}/../../../src/bin/amd64</test.helmExecutableDirectory>

<!-- ===================================================================== -->
<!-- ============================= Libaries ============================== -->
<!-- ===================================================================== -->
Expand Down
2 changes: 1 addition & 1 deletion src/it/push-with-auth-from-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<configuration>
<autoDetectLocalHelmBinary>false</autoDetectLocalHelmBinary>
<useLocalHelmBinary>true</useLocalHelmBinary>
<helmExecutableDirectory>${project.basedir}/..</helmExecutableDirectory>
<helmExecutableDirectory>${test.helmExecutableDirectory}</helmExecutableDirectory>
<addDefaultRepo>false</addDefaultRepo>
<chartDirectory>${project.basedir}/src/main/helm</chartDirectory>
<chartVersion>1.0.0</chartVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/it/push-with-auth-from-pom/postbuild.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

return org.codehaus.plexus.util.FileUtils
.fileRead(basedir + "/build.log")
.contains(basedir + "/../helm registry login 127.0.0.1 --username auth-from-pom --password-stdin\n")
.contains(basedir + "/../../../src/bin/amd64/helm registry login 127.0.0.1 --username auth-from-pom --password-stdin\n")
2 changes: 1 addition & 1 deletion src/it/push-with-auth-from-settings/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<configuration>
<autoDetectLocalHelmBinary>false</autoDetectLocalHelmBinary>
<useLocalHelmBinary>true</useLocalHelmBinary>
<helmExecutableDirectory>${project.basedir}/..</helmExecutableDirectory>
<helmExecutableDirectory>${test.helmExecutableDirectory}</helmExecutableDirectory>
<addDefaultRepo>false</addDefaultRepo>
<chartDirectory>${project.basedir}/src/main/helm</chartDirectory>
<chartVersion>1.0.0</chartVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/it/push-with-auth-from-settings/postbuild.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

return org.codehaus.plexus.util.FileUtils
.fileRead(basedir + "/build.log")
.contains(basedir + "/../helm registry login 127.0.0.1 --username auth-from-settings --password-stdin\n")
.contains(basedir + "/../../../src/bin/amd64/helm registry login 127.0.0.1 --username auth-from-settings --password-stdin\n")
2 changes: 1 addition & 1 deletion src/it/push-without-auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<configuration>
<autoDetectLocalHelmBinary>false</autoDetectLocalHelmBinary>
<useLocalHelmBinary>true</useLocalHelmBinary>
<helmExecutableDirectory>${project.basedir}/..</helmExecutableDirectory>
<helmExecutableDirectory>${test.helmExecutableDirectory}</helmExecutableDirectory>
<addDefaultRepo>false</addDefaultRepo>
<chartDirectory>${project.basedir}/src/main/helm</chartDirectory>
<chartVersion>1.0.0</chartVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/it/push-without-auth/postbuild.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

return org.codehaus.plexus.util.FileUtils
.fileRead(basedir + "/build.log")
.contains(basedir + "/../helm push " + basedir + "/target/helm/repo/app-1.0.0.tgz oci://127.0.0.1\n")
.contains(basedir + "/../../../src/bin/amd64/helm push " + basedir + "/target/helm/repo/app-1.0.0.tgz oci://127.0.0.1\n")
2 changes: 1 addition & 1 deletion src/it/template-with-additional-arguments/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<configuration>
<autoDetectLocalHelmBinary>false</autoDetectLocalHelmBinary>
<useLocalHelmBinary>true</useLocalHelmBinary>
<helmExecutableDirectory>${project.basedir}/..</helmExecutableDirectory>
<helmExecutableDirectory>${test.helmExecutableDirectory}</helmExecutableDirectory>
<addDefaultRepo>false</addDefaultRepo>
<chartDirectory>${project.basedir}/src/main/helm</chartDirectory>
<chartVersion>1.0.0</chartVersion>
Expand Down
5 changes: 2 additions & 3 deletions src/test/java/io/kokuwa/maven/helm/HelmMojoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ class Executable {
void fixed(LintMojo mojo) {
mojo.setUseLocalHelmBinary(true);
mojo.setAutoDetectLocalHelmBinary(false);
mojo.setHelmExecutableDirectory(MojoExtension.determineHelmExecutableDirectory());
Path expected = Paths.get(MojoExtension.determineHelmExecutableDirectory().toString())
.resolve(HELM).toAbsolutePath();
mojo.setHelmExecutableDirectory(MojoExtension.determineHelmExecutableDirectory().toFile());
Path expected = MojoExtension.determineHelmExecutableDirectory().resolve(HELM);
Path actual = assertDoesNotThrow(() -> mojo.getHelmExecutablePath());
assertEquals(expected, actual);
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/io/kokuwa/maven/helm/InitMojoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void localHelm(InitMojo mojo) {
mojo.setUseLocalHelmBinary(true);
mojo.setFallbackBinaryDownload(false);
mojo.setHelmVersion(null);
mojo.setHelmExecutableDirectory(MojoExtension.determineHelmExecutableDirectory());
mojo.setHelmExecutableDirectory(MojoExtension.determineHelmExecutableDirectory().toFile());
assertHelm(mojo, "version", "repo add stable " + InitMojo.STABLE_HELM_REPO);
}

Expand Down
13 changes: 6 additions & 7 deletions src/test/java/io/kokuwa/maven/helm/junit/MojoExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import java.io.File;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -114,7 +116,7 @@ public Object resolveParameter(ParameterContext parameterContext, ExtensionConte
// preconfigure

mojo.setChartDirectory(new File("src/test/resources/simple")); // set some sane defaults for tests
mojo.setHelmExecutableDirectory(determineHelmExecutableDirectory());
mojo.setHelmExecutableDirectory(determineHelmExecutableDirectory().toFile()); // avoid download helm
mojo.setHelmVersion("3.12.0"); // avoid github api

return mojo;
Expand All @@ -125,13 +127,10 @@ public Object resolveParameter(ParameterContext parameterContext, ExtensionConte

/**
* Determines which helm executable to use based on the machine's architecture.
*
* @return location of appropriate helm executable
*/
public static File determineHelmExecutableDirectory() {
if (System.getProperty("os.arch").equals("aarch64")) {
return new File("src/it/helm-executables/aarch64-helm/");
} else {
return new File("src/it/helm-executables/x86_64-helm/");
}
public static Path determineHelmExecutableDirectory() {
return Paths.get("src/bin/" + System.getProperty("os.arch")).toAbsolutePath();
}
}

0 comments on commit db6cb0d

Please sign in to comment.