diff --git a/.github/workflows/ci-4.x-beta.yml b/.github/workflows/ci-4.x-beta.yml new file mode 100644 index 0000000..ced9709 --- /dev/null +++ b/.github/workflows/ci-4.x-beta.yml @@ -0,0 +1,80 @@ +name: CI - 4.x-beta + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + workflow_dispatch: + +jobs: + docker-build: + runs-on: ubuntu-latest + strategy: + matrix: + versions: + - CONTEXT: . + TAGS: + - wiremock/wiremock:test + PLATFORMS: + - linux/amd64 + - linux/arm64 + - linux/arm/v7 + - CONTEXT: alpine + TAGS: + - wiremock/wiremock:test-alpine + PLATFORMS: + - linux/amd64 + + steps: + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + with: + image: tonistiigi/binfmt:latest + platforms: all + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Checkout sources + uses: actions/checkout@main + +# TODO: Re-enable if rate limit becomes an issues +# - name: Login to Docker Hub +# uses: docker/login-action@v2 +# with: +# username: wiremock +# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build WireMock Docker image + uses: docker/build-push-action@v4 + with: + context: ${{ matrix.versions.CONTEXT }} + platforms: ${{ join(matrix.versions.PLATFORMS, ',') }} + push: false + file: ${{ matrix.versions.CONTEXT }}/Dockerfile + tags: ${{ matrix.versions.TAGS[0] }} + build-args: | + WIREMOCK_VERSION=4.0.0-beta.29 + + - name: Build Wiremock Docker image + run: docker buildx build --tag ${{ matrix.versions.TAGS[0] }} --load ${{ matrix.versions.CONTEXT }} --file ${{ matrix.versions.CONTEXT }}/Dockerfile --build-arg JAVA_VERSION=17 --build-arg WIREMOCK_VERSION=4.0.0-beta.29 + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'temurin' + cache: maven + + - name: Run integration test + working-directory: test/integration-tests + run: mvn -B -ntp package verify --file pom.xml -DargLine="-Dit.wiremock-image=${{ matrix.versions.TAGS[0] }}" + + container-image-scan: + uses: ./.github/workflows/container-image-scan.yml + needs: docker-build + with: + image_version: latest + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f264d0a..e60c179 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,14 +55,16 @@ jobs: push: false file: ${{ matrix.versions.CONTEXT }}/Dockerfile tags: ${{ matrix.versions.TAGS[0] }} + build-args: | + WIREMOCK_VERSION=3.13.2 - name: Build Wiremock Docker image - run: docker buildx build --tag ${{ matrix.versions.TAGS[0] }} --load ${{ matrix.versions.CONTEXT }} --file ${{ matrix.versions.CONTEXT }}/Dockerfile + run: docker buildx build --tag ${{ matrix.versions.TAGS[0] }} --load ${{ matrix.versions.CONTEXT }} --file ${{ matrix.versions.CONTEXT }}/Dockerfile --build-arg JAVA_VERSION=17 --build-arg WIREMOCK_VERSION=3.13.2 - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 11 + java-version: 17 distribution: 'temurin' cache: maven diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6126509..e4b19c4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,7 +65,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 11 + java-version: 17 distribution: 'temurin' cache: maven diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 4396ba2..b133170 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -66,7 +66,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 11 + java-version: 17 distribution: 'temurin' cache: maven diff --git a/.github/workflows/release-4.x-beta.yml b/.github/workflows/release-4.x-beta.yml index 035d9d1..a91dd43 100644 --- a/.github/workflows/release-4.x-beta.yml +++ b/.github/workflows/release-4.x-beta.yml @@ -28,10 +28,40 @@ jobs: LATEST_VERSION=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/wiremock/wiremock.git '4.*.*' | tail -1 | cut -d '/' -f3) echo "NEW_VERSION=${{ github.event.inputs.bundled-version }}-${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT - docker-build-push: + verify-container-startup: runs-on: ubuntu-latest needs: [check-new-version] if: needs.check-new-version.outputs.new_version + steps: + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Checkout sources + uses: actions/checkout@main + + - name: Build WireMock Docker image (local) + run: | + docker buildx build \ + --tag wiremock/wiremock:verify \ + --load \ + --build-arg "WIREMOCK_VERSION=${{ github.event.inputs.bundled-version }}" \ + --build-arg "JAVA_VERSION=17" \ + --file Dockerfile \ + . + + - name: Verify container startup + run: | + docker run -d --name wiremock-test -p 8080:8080 wiremock/wiremock:verify + timeout 30 bash -c 'until curl -sf http://localhost:8080/__admin/health; do sleep 1; done' + echo "WireMock container started and health check passed" + docker stop wiremock-test + docker rm wiremock-test + + docker-build-push: + runs-on: ubuntu-latest + needs: [check-new-version, verify-container-startup] + if: needs.check-new-version.outputs.new_version strategy: matrix: versions: @@ -96,7 +126,8 @@ jobs: push: true tags: ${{ join(matrix.versions.IMAGES, ',') }} build-args: | - "WIREMOCK_VERSION=${{ github.event.inputs.bundled-version }}" + WIREMOCK_VERSION=${{ github.event.inputs.bundled-version }} + JAVA_VERSION=17 container-image-scan: uses: ./.github/workflows/container-image-scan.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fcbe84a..56f382c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -95,7 +95,8 @@ jobs: push: true tags: ${{ join(matrix.versions.IMAGES, ',') }} build-args: | - "WIREMOCK_VERSION=${{ github.event.inputs.bundled-version }}" + WIREMOCK_VERSION=${{ github.event.inputs.bundled-version }} + JAVA_VERSION=17 container-image-scan: uses: ./.github/workflows/container-image-scan.yml diff --git a/.gitignore b/.gitignore index c6a5f72..b8c747d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ test/integration-tests/target test/integration-tests/integration-tests.iml + +.claude \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index b8403a6..e678063 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM eclipse-temurin:11.0.24_8-jre +ARG JAVA_VERSION=17 +FROM eclipse-temurin:${JAVA_VERSION}-jre LABEL maintainer="Rodolphe CHAIGNEAU " diff --git a/Dockerfile-nightly b/Dockerfile-nightly index 73d7bab..9f833b1 100644 --- a/Dockerfile-nightly +++ b/Dockerfile-nightly @@ -1,6 +1,6 @@ # BUILD -FROM gradle:7-jdk11 AS builder +FROM gradle:8-jdk17 AS builder WORKDIR /workdir @@ -12,7 +12,7 @@ RUN ./gradlew shadowJar # RUN -FROM eclipse-temurin:11.0.24_8-jre +FROM eclipse-temurin:17-jre LABEL maintainer="Rodolphe CHAIGNEAU " diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 5749109..4554080 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -1,4 +1,5 @@ -FROM eclipse-temurin:11-jre-alpine +ARG JAVA_VERSION=17 +FROM eclipse-temurin:${JAVA_VERSION}-jre-alpine LABEL maintainer="Rodolphe CHAIGNEAU " diff --git a/alpine/Dockerfile-nightly b/alpine/Dockerfile-nightly index 70d0a82..bb81c44 100644 --- a/alpine/Dockerfile-nightly +++ b/alpine/Dockerfile-nightly @@ -1,6 +1,6 @@ # BUILD -FROM gradle:7-jdk11 AS builder +FROM gradle:8-jdk17 AS builder WORKDIR /workdir @@ -10,7 +10,7 @@ RUN ./gradlew shadowJar # RUN -FROM eclipse-temurin:11.0.20_8-jre-alpine +FROM eclipse-temurin:17-jre-alpine LABEL maintainer="Rodolphe CHAIGNEAU " diff --git a/test/integration-tests/pom.xml b/test/integration-tests/pom.xml index 9615b1a..81c4942 100644 --- a/test/integration-tests/pom.xml +++ b/test/integration-tests/pom.xml @@ -16,7 +16,7 @@ - 11 + 17 ${java.version} ${java.version} 1.0-alpha-13