Skip to content

Commit

Permalink
feat: add maven wrapper support
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Laprun <[email protected]>
  • Loading branch information
metacosm committed Aug 13, 2024
1 parent 4c5e300 commit 4ab6c5d
Show file tree
Hide file tree
Showing 11 changed files with 460 additions and 33 deletions.
10 changes: 5 additions & 5 deletions .github/scripts/installOperatorUsingOlm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ CURRENT_PWD=$(pwd)
kubectl config set-context --current --namespace=$K8S_NAMESPACE

# Build manifests and images
cd $OPERATOR_LOCATION
mvn clean package -Dquarkus.container-image.build=true \
cd $OPERATOR_LOCATION || exit
"$CURRENT_PWD"/mvnw clean package -Dquarkus.container-image.build=true \
-Dquarkus.container-image.push=true \
-Dquarkus.container-image.insecure=true \
-Dquarkus.container-image.registry=$KIND_REGISTRY \
Expand Down Expand Up @@ -41,7 +41,7 @@ spec:
EOF

# Wait until the catalog source of our operator is up and running
if ! $CURRENT_PWD/.github/scripts/waitFor.sh pods $K8S_NAMESPACE Running "--selector=olm.catalogSource=$NAME-catalog -o jsonpath='{..status.phase}'"; then
if ! "$CURRENT_PWD"/.github/scripts/waitFor.sh pods $K8S_NAMESPACE Running "--selector=olm.catalogSource=$NAME-catalog -o jsonpath='{..status.phase}'"; then
exit 1;
fi

Expand All @@ -60,9 +60,9 @@ spec:
EOF

# Wait until the operator is up and running
if ! $CURRENT_PWD/.github/scripts/waitFor.sh csv $K8S_NAMESPACE Succeeded "$NAME-operator -o jsonpath='{.status.phase}'"; then
if ! "$CURRENT_PWD"/.github/scripts/waitFor.sh csv $K8S_NAMESPACE Succeeded "$NAME-operator -o jsonpath='{.status.phase}'"; then
exit 1;
fi

cd $CURRENT_PWD
cd "$CURRENT_PWD" || exit
exit 0;
36 changes: 18 additions & 18 deletions .github/workflows/build-for-quarkus-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ jobs:
git fetch origin pull/${{ github.event.inputs.josdk-pr }}/head:pr-to-check
git switch pr-to-check
fi
mvn install -DskipTests
echo "josdk_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
echo "josdk_f8_version=$(mvn help:evaluate -Dexpression=fabric8-client.version -q -DforceStdout)" >> $GITHUB_OUTPUT
./mvnw install -DskipTests
echo "josdk_version=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
echo "josdk_f8_version=$(./mvnw help:evaluate -Dexpression=fabric8-client.version -q -DforceStdout)" >> $GITHUB_OUTPUT
cd -
- name: Set JOSDK version from build PR if requested
if: "${{ inputs.josdk-pr != '' }}"
run: mvn versions:set-property -Dproperty='java-operator-sdk.version' -DnewVersion=${{ steps.build-josdk-pr.outputs.josdk_version }}
run: ./mvnw versions:set-property -Dproperty='java-operator-sdk.version' -DnewVersion=${{ steps.build-josdk-pr.outputs.josdk_version }}

- name: Check-out Quarkus if building from PR is requested
uses: actions/checkout@v4
Expand All @@ -142,7 +142,7 @@ jobs:
git fetch origin pull/${{ github.event.inputs.quarkus-pr }}/head:pr-to-check
git switch pr-to-check
./update-version.sh 999.${{ github.event.inputs.quarkus-pr }}-SNAPSHOT
echo "quarkus_f8_version=$(mvn help:evaluate -Dexpression=kubernetes-client.version -q -DforceStdout)" >> $GITHUB_OUTPUT
echo "quarkus_f8_version=$(./mvnw help:evaluate -Dexpression=kubernetes-client.version -q -DforceStdout)" >> $GITHUB_OUTPUT
./mvnw -Dquickly
cd -
Expand All @@ -160,9 +160,9 @@ jobs:
cd fkc
git fetch origin pull/${{ github.event.inputs.fkc-pr }}/head:pr-to-check
git switch pr-to-check
mvn versions:set -DnewVersion=999.${{ github.event.inputs.fkc-pr }}-SNAPSHOT versions:commit
echo "f8_pr_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
mvn clean install -DskipTests
./mvnw versions:set -DnewVersion=999.${{ github.event.inputs.fkc-pr }}-SNAPSHOT versions:commit
echo "f8_pr_version=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
./mvnw clean install -DskipTests
cd -
- name: Retrieve Quarkus version from platform
Expand Down Expand Up @@ -200,7 +200,7 @@ jobs:
- name: Change Quarkus version
run: |
echo "Using Quarkus ${{ steps.quarkus-version.outputs.quarkus_version }}"
mvn versions:set-property -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dproperty=quarkus.version -DnewVersion=${{ steps.quarkus-version.outputs.quarkus_version }}
./mvnw versions:set-property -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dproperty=quarkus.version -DnewVersion=${{ steps.quarkus-version.outputs.quarkus_version }}
- name: Change Fabric8 client version
id: fkc-version
Expand All @@ -213,25 +213,25 @@ jobs:
fkc_version=${{ steps.build-fkc-pr.outputs.f8_pr_version }}
fi
echo "Using Fabric8 ${fkc_version}"
mvn versions:set-property -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dproperty=fabric8-client.version -DnewVersion=${fkc_version}
./mvnw versions:set-property -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dproperty=fabric8-client.version -DnewVersion=${fkc_version}
echo "fkc_version=${fkc_version}" >> $GITHUB_OUTPUT
- name: Output versions being used
run: |
echo "QOSDK version: $(mvn help:evaluate -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dexpression=project.version -q -DforceStdout)"
echo "JOSDK version: $(mvn help:evaluate -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dexpression=java-operator-sdk.version -q -DforceStdout)"
echo "QOSDK version: $(./mvnw help:evaluate -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dexpression=project.version -q -DforceStdout)"
echo "JOSDK version: $(./mvnw help:evaluate -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dexpression=java-operator-sdk.version -q -DforceStdout)"
echo "JOSDK Fabric8 version: ${{ steps.build-josdk-pr.outputs.josdk_f8_version }}"
echo "JOSDK overridden Fabric8 version ${{ steps.fkc-version.outputs.fkc_version }}"
echo "Quarkus version: $(mvn help:evaluate -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dexpression=quarkus.version -q -DforceStdout)"
echo "Quarkus version: $(./mvnw help:evaluate -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dexpression=quarkus.version -q -DforceStdout)"
echo "Quarkus Fabric8 version: ${{ steps.build-quarkus-pr.outputs.quarkus_f8_version }}"
echo "Effective Fabric8 version: $(mvn 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)"
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: mvn -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}}' --file pom.xml

- name: Dependency tree on failure
if: failure()
run: mvn -B dependency:tree -Dverbose
run: ./mvnw -B dependency:tree -Dverbose

- name: Kubernetes KinD Cluster
uses: container-tools/kind-action@v2
Expand Down Expand Up @@ -267,7 +267,7 @@ jobs:
# Run operator in DEV mode
cd samples/joke
# Need to override application.properties setting to avoid using dev services instead of set up cluster
mvn quarkus:dev -Dquarkus.kubernetes-client.devservices.override-kubeconfig=false >app.log 2>&1 &
"$CURRENT_PWD"/mvnw quarkus:dev -Dquarkus.kubernetes-client.devservices.override-kubeconfig=false >app.log 2>&1 &
PID=$(echo $!)
cd $CURRENT_PWD
Expand Down Expand Up @@ -296,7 +296,7 @@ jobs:
path: samples/joke/app.log

- name: Build with Maven (Native)
run: mvn -B install -Dnative --file pom.xml -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -pl '${{inputs.native-modules}}' -amd
run: ./mvnw -B install -Dnative --file pom.xml -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -pl '${{inputs.native-modules}}' -amd

- name: Run Joke sample in native mode
if: ${{ contains(inputs.native-modules, 'samples') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

- name: Retrieve Quarkus version
id: quarkus-version
run: echo "quarkus_version=$(mvn help:evaluate -Dexpression=quarkus.version -q -DforceStdout -Puse-snapshots)" >> $GITHUB_OUTPUT
run: echo "quarkus_version=$(./mvnw help:evaluate -Dexpression=quarkus.version -q -DforceStdout -Puse-snapshots)" >> $GITHUB_OUTPUT

- name: Retrieve latest stable Quarkus version from platform
id: get-quarkus-version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:

- name: Perform quick build
run: |
mvn -Dquickly -Puse-snapshots
./mvnw -Dquickly -Puse-snapshots
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/release-quarkus-platform-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Update QOSDK version to ${{inputs.qosdk-version}} in quarkus-platform ${{inputs.quarkus-platform-branch}}
run: |
mvn -B versions:set-property -Dproperty=quarkus-operator-sdk.version -DnewVersion=${{inputs.qosdk-version}}
./mvnw -B versions:set-property -Dproperty=quarkus-operator-sdk.version -DnewVersion=${{inputs.qosdk-version}}
./mvnw -Dsync
- name: Create quarkus-platform pull request
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ jobs:
if: ${{ inputs.version != '' }}
run: |
echo "Set version to ${{inputs.version}}"
mvn versions:set -DnewVersion="${{inputs.version}}" versions:commit -Puse-snapshots
./mvnw versions:set -DnewVersion="${{inputs.version}}" versions:commit -Puse-snapshots
- name: Output information
run: echo "Release snapshot for branch ${{inputs.branch}} with version $(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
run: echo "Release snapshot for branch ${{inputs.branch}} with version $(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)"

- name: Deploy maven snapshot
run: |
mvn -B deploy -DperformRelease -Dno-samples -Dno-docs -Prelease,use-snapshots
./mvnw -B deploy -DperformRelease -Dno-samples -Dno-docs -Prelease,use-snapshots
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-update-java-operator-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
sed -i -e 's|<quarkus-sdk.version>.*</quarkus-sdk.version>|<quarkus-sdk.version>${{inputs.qosdk-version}}</quarkus-sdk.version>|' $(pwd)/testdata/quarkus/memcached-quarkus-operator/pom.xml
echo "Using Quarkus ${{ inputs.quarkus-version }}"
mvn versions:set-property -Dproperty=quarkus.version -DnewVersion=${{inputs.quarkus-version}} -f ./testdata/quarkus/memcached-quarkus-operator/pom.xml versions:commit
./mvnw versions:set-property -Dproperty=quarkus.version -DnewVersion=${{inputs.quarkus-version}} -f ./testdata/quarkus/memcached-quarkus-operator/pom.xml versions:commit
sed -i -e 's|<quarkus.version>.*</quarkus.version>|<quarkus.version>${{inputs.quarkus-version}}</quarkus.version>|' $(pwd)/pkg/quarkus/v1beta/scaffolds/internal/templates/pomxml.go
- name: Create java-operator-plugins pull request
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- name: Retrieve Quarkus version
id: quarkus-version
run: echo "quarkus_version=$(mvn help:evaluate -Dexpression=quarkus.version -q -DforceStdout)" >> $GITHUB_OUTPUT
run: echo "quarkus_version=$(./mvnw help:evaluate -Dexpression=quarkus.version -q -DforceStdout)" >> $GITHUB_OUTPUT

- uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -87,10 +87,10 @@ jobs:
fi
git checkout -b release
mvn -B release:prepare -Prelease -Darguments="-DperformRelease -Dno-samples -DskipTests" -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
./mvnw -B release:prepare -Prelease -Darguments="-DperformRelease -Dno-samples -DskipTests" -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
git checkout ${{github.base_ref}}
git rebase release
mvn -B release:perform -Darguments="-DperformRelease -Dno-samples -DskipTests" -DperformRelease -Prelease
./mvnw -B release:perform -Darguments="-DperformRelease -Dno-samples -DskipTests" -DperformRelease -Prelease
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
Expand Down
19 changes: 19 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip
Loading

0 comments on commit 4ab6c5d

Please sign in to comment.