Skip to content

Commit

Permalink
feat: build using an arbitrary Fabric8 version without code changes (#…
Browse files Browse the repository at this point in the history
…945)

* feat: build using an arbitrary Fabric8 version without code changes

Signed-off-by: Chris Laprun <[email protected]>

* fix: remove quotes around mvn arguments

Signed-off-by: Chris Laprun <[email protected]>

---------

Signed-off-by: Chris Laprun <[email protected]>
  • Loading branch information
metacosm authored Sep 9, 2024
1 parent c3a1376 commit 07f5fe6
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 11 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/build-for-quarkus-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ on:
quarkus-version:
type: string
required: false
josdk-pr:
description: 'JOSDK PR number (or main) to use to build QOSDK with'
type: string
required: false
quarkus-pr:
description: 'Quarkus PR number to use to run a QOSDK build with'
type: string
required: false
fkc-pr:
description: 'Fabric8 client PR number to use to run a QOSDK build with'
type: string
required: false
fkc-version:
description: 'Fabric8 client version to run a QOSDK build with'
type: string
required: false
java-version:
type: string
required: true
Expand All @@ -29,6 +45,10 @@ on:
type: string
required: false
default: 'default'
mvnArgs:
type: string
description: 'Extra maven arguments to build QOSDK'
required: false
workflow_dispatch:
inputs:
quarkus-version-jq-cmd:
Expand Down Expand Up @@ -242,7 +262,7 @@ jobs:
echo "Effective Fabric8 version: $(./mvnw dependency:tree -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dincludes=io.fabric8:kubernetes-client-api -pl core/deployment | grep io.fabric8:kubernetes-client-api -m1 | cut -d ':' -f 4)"
- name: Build with Maven (JVM)
run: ./mvnw -B formatter:validate install -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' --file pom.xml
run: ./mvnw -B formatter:validate install -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' ${{inputs.mvnArgs}} --file pom.xml

- name: Dependency tree on failure
if: failure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
build-for-latest-quarkus-version:
uses: ./.github/workflows/build-for-quarkus-version.yml
with:
quarkus-version-jq-cmd: '.platforms[0]."current-stream-id" as $current | .platforms[0].streams[] | select(.id == $current) | .releases[0].version'
quarkus-pr: 42335
java-version: 21
branch: "next-fabric8-version"
native-modules: "integration-tests,samples"
profiles: "use-snapshots"
profiles: "use-snapshots,override-fkc"
mvnArgs: "-Dfkc.version=7.0-SNAPSHOT -Ddefault=false"

release-snapshot:
uses: ./.github/workflows/release-snapshot.yml
Expand Down
7 changes: 0 additions & 7 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom</artifactId>
<version>${quarkus.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.javaoperatorsdk</groupId>
<artifactId>operator-framework-core</artifactId>
Expand Down
61 changes: 61 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,27 @@
</snapshotRepository>
</distributionManagement>
<profiles>
<profile>
<!-- Quarkus BOM is added automatically via an activated by default profile, this is done so that we can override the Fabric8 client version using the override-fkc profile -->
<id>quarkus-bom</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>!default</name>
</property>
</activation>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom</artifactId>
<version>${quarkus.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</profile>
<profile>
<id>default</id>
<activation>
Expand Down Expand Up @@ -170,6 +191,46 @@
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>override-fkc</id>
<activation>
<property>
<!-- We need to activate the profile by using the opposite of the property used for the default profiles -->
<name>default</name>
</property>
</activation>
<dependencyManagement>
<dependencies>
<!-- Add the FKC BOM before the Quarkus one to override the client version -->
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client-bom</artifactId>
<version>${fkc.version}</version>
<scope>import</scope>
<type>pom</type>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom</artifactId>
<version>${quarkus.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>bom</module>
<module>build-parent</module>
<module>annotations</module>
<module>common</module>
<module>common-deployment</module>
<module>cli</module>
<module>core</module>
<module>bundle-generator</module>
<module>integration-tests</module>
</modules>
</profile>
</profiles>
</project>

0 comments on commit 07f5fe6

Please sign in to comment.