Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 13 additions & 38 deletions .github/workflows/operator_upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,55 +23,30 @@
runs-on: ubuntu-latest

outputs:
image: ${{ steps.infinispan.outputs.image }}
version: ${{ steps.infinispan.outputs.version }}

steps:
- if: ${{ github.event_name != 'pull_request' }}
uses: actions/checkout@v5
with:
ref: ${{ github.ref_name }}
repository: infinispan/infinispan-images

- if: ${{ github.event_name == 'pull_request' }}
uses: actions/checkout@v5
with:
ref: ${{ github.base_ref }}
repository: infinispan/infinispan-images

- uses: actions/checkout@v5
with:
path: server

- name: Setup Java
uses: ./server/.github/actions/setup-java

- name: Build Infinispan
id: infinispan
working-directory: server
run: |
./mvnw install -DskipTests -am -pl server/runtime
SERVER_VERSION=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
OPERAND_VERSION=$(echo ${SERVER_VERSION} | cut -d '-' -f 1)
echo "version=${OPERAND_VERSION}" >> ${GITHUB_OUTPUT}
cd server/runtime/target
zip -r ${GITHUB_WORKSPACE}/server.zip infinispan-server-${SERVER_VERSION}

- name: Install CEKit
uses: cekit/[email protected]

- name: Create Dockerfile
run: |
SERVER_OVERRIDE="{\"artifacts\":[{\"name\":\"server\",\"path\":\"${GITHUB_WORKSPACE}/server.zip\"}]}"
cekit -v --descriptor server-openjdk.yaml build --overrides '{'version': '${{ github.sha }}'}' --overrides ${SERVER_OVERRIDE} --dry-run docker
uses: ./.github/actions/setup-java

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Image
id: infinispan
run: |

Check warning on line 40 in .github/workflows/operator_upgrade.yaml

View workflow job for this annotation

GitHub Actions / Lint GitHub Actions workflows

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2086:info:9:38: Double quote to prevent globbing and word splitting [shellcheck] Raw Output: i:.github/workflows/operator_upgrade.yaml:40:9: shellcheck reported issue in this script: SC2086:info:9:38: Double quote to prevent globbing and word splitting [shellcheck]

Check warning on line 40 in .github/workflows/operator_upgrade.yaml

View workflow job for this annotation

GitHub Actions / Lint GitHub Actions workflows

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2086:info:8:26: Double quote to prevent globbing and word splitting [shellcheck] Raw Output: i:.github/workflows/operator_upgrade.yaml:40:9: shellcheck reported issue in this script: SC2086:info:8:26: Double quote to prevent globbing and word splitting [shellcheck]

Check warning on line 40 in .github/workflows/operator_upgrade.yaml

View workflow job for this annotation

GitHub Actions / Lint GitHub Actions workflows

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2086:info:6:13: Double quote to prevent globbing and word splitting [shellcheck] Raw Output: i:.github/workflows/operator_upgrade.yaml:40:9: shellcheck reported issue in this script: SC2086:info:6:13: Double quote to prevent globbing and word splitting [shellcheck]

Check warning on line 40 in .github/workflows/operator_upgrade.yaml

View workflow job for this annotation

GitHub Actions / Lint GitHub Actions workflows

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2086:info:5:85: Double quote to prevent globbing and word splitting [shellcheck] Raw Output: i:.github/workflows/operator_upgrade.yaml:40:9: shellcheck reported issue in this script: SC2086:info:5:85: Double quote to prevent globbing and word splitting [shellcheck]

Check warning on line 40 in .github/workflows/operator_upgrade.yaml

View workflow job for this annotation

GitHub Actions / Lint GitHub Actions workflows

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2086:info:2:24: Double quote to prevent globbing and word splitting [shellcheck] Raw Output: i:.github/workflows/operator_upgrade.yaml:40:9: shellcheck reported issue in this script: SC2086:info:2:24: Double quote to prevent globbing and word splitting [shellcheck]
cat target/image/Dockerfile
docker buildx build --load -t localhost:5001/server:${{ github.sha }} target/image
docker save localhost:5001/server:${{ github.sha }} > /tmp/operand-image.tar
SERVER_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
OPERAND_VERSION=$(echo ${SERVER_VERSION} | cut -d '-' -f 1)
IMAGE="localhost:5001/server:${SERVER_VERSION}"

./mvnw install -DskipTests -am -pl server/runtime,server/image -Pimage -Dimage.name=${IMAGE}
docker save ${IMAGE} > /tmp/operand-image.tar

echo "image=${IMAGE}" >> ${GITHUB_OUTPUT}
echo "version=${OPERAND_VERSION}" >> ${GITHUB_OUTPUT}

- name: Upload
uses: actions/upload-artifact@v5
Expand All @@ -83,7 +58,7 @@
needs: image
uses: infinispan/infinispan-operator/.github/workflows/test_upgrades.yml@main
with:
operand: localhost:5001/server:${{ github.sha }}
operand: ${{ needs.image.outputs.image }}
operandArtifact: operand-image
operandVersion: ${{ needs.image.outputs.version }}
ref: main
Expand Down
3 changes: 2 additions & 1 deletion server/image/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<module.skipMavenRemoteResource>true</module.skipMavenRemoteResource>
<defaultTestGroup/>
<defaultExcludedTestGroup/>
<image.name>infinispan/server:${project.version}</image.name>
<image.platforms>linux/amd64,linux/arm64</image.platforms>
<server.output.dir>../runtime/target/${infinispan.brand.prefix}-server-${infinispan.brand.version}</server.output.dir>
<jdk.dist>https://api.adoptium.net/v3/binary/latest/25/ga/linux/${arch}/jdk/hotspot/normal/eclipse</jdk.dist>
Expand Down Expand Up @@ -67,7 +68,7 @@
<images>
<image>
<alias>infinispan</alias>
<name>infinispan/server:${project.version}</name>
<name>${image.name}</name>
<build>
<args>
<BRAND_NAME>${infinispan.brand.name}</BRAND_NAME>
Expand Down
Loading