From 4db20b26604ed651f138e5a3be7140ade382aa24 Mon Sep 17 00:00:00 2001 From: Ioannis Canellos Date: Wed, 25 Sep 2024 18:44:26 +0300 Subject: [PATCH 1/5] chore: troubleshoot build-test --- .github/workflows/build-test.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 5fd400b..44dd73a 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -68,6 +68,9 @@ jobs: alias quarkus="java -jar ${GITHUB_WORKSPACE}/quarkus-cli.jar" echo "## Create a Quarkus project" + + TMP_DIR=$(mktemp -d) + pushd $TMP_DIR quarkus create app cd code-with-quarkus @@ -87,6 +90,10 @@ jobs: echo "## Compile the quarkus app" mvn -B install -Dno-format + + # Troubleshooting information + ls -al + git log echo "## Generate the Argo CD application" quarkus argocd application generate @@ -106,4 +113,5 @@ jobs: echo "## ArgoCD file has not been generated properly !" cat ".argocd/code-with-quarkus-deploy.yaml" exit 1 - fi \ No newline at end of file + fi + popd From 081765e98dfb7d82f2223b566f8ddfcd54cbae36 Mon Sep 17 00:00:00 2001 From: Ioannis Canellos Date: Wed, 25 Sep 2024 19:00:09 +0300 Subject: [PATCH 2/5] chore: use https instead of ssh as it causes key related issues --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 44dd73a..82842fd 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -79,7 +79,7 @@ jobs: git config user.email "coder@quarkus.io" git config user.name "Quarkus coder" - git remote add origin git@github.com:quarkiverse/code-with-quarkus.git + git remote add origin https://github.com/quarkiverse/code-with-quarkus.git git add . git commit -asm "Initial upload" From 7bd4d0f01811727ee18b009df27299904142b751 Mon Sep 17 00:00:00 2001 From: Ioannis Canellos Date: Thu, 26 Sep 2024 15:30:05 +0300 Subject: [PATCH 3/5] chore: bump to latest quarkus version --- deployment/pom.xml | 3 +++ pom.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/deployment/pom.xml b/deployment/pom.xml index e05e9a6..77fc7cd 100644 --- a/deployment/pom.xml +++ b/deployment/pom.xml @@ -70,6 +70,9 @@ ${quarkus.version} + + -AlegacyConfigRoot=true + diff --git a/pom.xml b/pom.xml index 5caa3a3..e6cfeb9 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ 17 UTF-8 UTF-8 - 3.12.2 + 3.14.4 0.103.1 1.18.26 6.13.1 From 138c99d123f8dd4c18cfae8429b12a27cc7dc3a1 Mon Sep 17 00:00:00 2001 From: Ioannis Canellos Date: Thu, 26 Sep 2024 15:30:20 +0300 Subject: [PATCH 4/5] chore: force quarkus-argocd as a dependency from the cli --- cli/pom.xml | 6 ++++++ .../cli/application/GenerationBaseCommand.java | 14 +++++++++++++- cli/src/main/resources/version | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 cli/src/main/resources/version diff --git a/cli/pom.xml b/cli/pom.xml index b94f9cd..3af1a1d 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -67,6 +67,12 @@ + + + src/main/resources + true + + io.quarkus diff --git a/cli/src/main/java/io/quarkiverse/argocd/cli/application/GenerationBaseCommand.java b/cli/src/main/java/io/quarkiverse/argocd/cli/application/GenerationBaseCommand.java index dbfa1f5..d1ac83b 100644 --- a/cli/src/main/java/io/quarkiverse/argocd/cli/application/GenerationBaseCommand.java +++ b/cli/src/main/java/io/quarkiverse/argocd/cli/application/GenerationBaseCommand.java @@ -12,6 +12,7 @@ import java.util.concurrent.Callable; import java.util.function.Consumer; +import io.dekorate.utils.Strings; import io.quarkiverse.argocd.cli.handlers.GetArgoCDApplicationHandler; import io.quarkiverse.argocd.cli.utils.Git; import io.quarkiverse.argocd.spi.ArgoCDApplicationListBuildItem; @@ -22,11 +23,15 @@ import io.quarkus.bootstrap.app.QuarkusBootstrap; import io.quarkus.devtools.project.BuildTool; import io.quarkus.devtools.project.QuarkusProjectHelper; +import io.quarkus.maven.dependency.ArtifactDependency; import picocli.CommandLine.ExitCode; import picocli.CommandLine.Option; public abstract class GenerationBaseCommand extends ApplicationBaseCommand implements Callable { + private static final ArtifactDependency QUARKUS_ARGOCD = new ArtifactDependency("io.quarkiverse.argocd", "quarkus-argocd", + null, "jar", GenerationBaseCommand.getVersion()); + @Option(names = { "-n", "--namespace" }, description = "The target namespace") Optional namespace = Optional.empty(); @@ -68,9 +73,12 @@ public Integer call() { .setApplicationRoot(getWorkingDirectory()) .setProjectRoot(getWorkingDirectory()) .setTargetDirectory(targetDirecotry) - .setLocalProjectDiscovery(true) .setIsolateDeployment(false) + .setRebuild(true) + .setLocalProjectDiscovery(true) .setBaseClassLoader(ClassLoader.getSystemClassLoader()) + .setForcedDependencies(List.of(QUARKUS_ARGOCD)) + .setDependencyInfoProvider(null) .build(); List resultBuildItemFQCNs = new ArrayList<>(); @@ -112,4 +120,8 @@ protected void writeStringSafe(Path p, String content) { protected Path getWorkingDirectory() { return Paths.get(System.getProperty("user.dir")); } + + private static String getVersion() { + return Strings.read(GenerationBaseCommand.class.getClassLoader().getResourceAsStream("version")); + } } diff --git a/cli/src/main/resources/version b/cli/src/main/resources/version new file mode 100644 index 0000000..ad96e7c --- /dev/null +++ b/cli/src/main/resources/version @@ -0,0 +1 @@ +${project.version} From c6bd5bdaa4b5ef67daeb05da4f2a42d0ffb96dbf Mon Sep 17 00:00:00 2001 From: Ioannis Canellos Date: Thu, 26 Sep 2024 15:52:30 +0300 Subject: [PATCH 5/5] chore: rename workflow to CLI integration test --- .github/workflows/{build-test.yml => cli-integration-test.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{build-test.yml => cli-integration-test.yml} (99%) diff --git a/.github/workflows/build-test.yml b/.github/workflows/cli-integration-test.yml similarity index 99% rename from .github/workflows/build-test.yml rename to .github/workflows/cli-integration-test.yml index 82842fd..d023b29 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/cli-integration-test.yml @@ -1,4 +1,4 @@ -name: Build and test the plugin +name: CLI integration test on: workflow_dispatch: