Skip to content

TIKA-4836: update google oauth, google cloud, aws, oak #352

TIKA-4836: update google oauth, google cloud, aws, oak

TIKA-4836: update google oauth, google cloud, aws, oak #352

#
# 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.
#
name: Docker snapshot - tika-server and tika-grpc
on:
push:
branches: [ main ]
paths-ignore:
- 'docs/**'
- '*.md'
jobs:
# Gate: publish snapshot images ONLY for -SNAPSHOT versions. The
# maven-release-plugin 'prepare release' commit briefly sets project.version
# to the bare release version (e.g. 4.0.0-beta-1) and pushes it to main; without
# this gate that push would publish release-named images to Docker Hub before the
# vote. Release/GA images are published post-vote by docker-release.yml.
gate:
runs-on: ubuntu-latest
outputs:
publish: ${{ steps.check.outputs.publish }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- id: check
name: Publish only for -SNAPSHOT versions
run: |
V=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "Resolved project.version=$V"
if [[ "$V" == *-SNAPSHOT ]]; then
echo "publish=true" >> "$GITHUB_OUTPUT"
else
echo "::notice::Version '$V' is not a -SNAPSHOT (likely a maven-release-plugin 'prepare release' commit); skipping snapshot image publish so release-named images are not pushed to Docker Hub before the vote."
echo "publish=false" >> "$GITHUB_OUTPUT"
fi
build:
needs: gate
if: needs.gate.outputs.publish == 'true'
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Extract version from pom
id: version
run: |
TIKA_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "tika_version=${TIKA_VERSION}" >> "$GITHUB_OUTPUT"
- name: Set build metadata
id: meta
run: |
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
echo "created=$(git show -s --format=%cI HEAD)" >> "$GITHUB_OUTPUT"
- name: Build with Maven (skip tests)
run: mvn clean install -DskipTests -B "-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Set up QEMU for multi-arch
run: docker run --privileged --rm tonistiigi/binfmt --install all
- name: Login to Docker Hub
uses: docker/login-action@c99871dec2022cc055c062a10cc1a1310835ceb4 # v4.3.0
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# --- tika-server (minimal) ---
- name: Prepare tika-server minimal build context
run: |
TIKA_VERSION="${{ steps.version.outputs.tika_version }}"
OUT_DIR=target/tika-server-minimal-docker
mkdir -p "${OUT_DIR}/tika-server"
unzip -q "tika-server/tika-server-standard/target/tika-server-standard-${TIKA_VERSION}.zip" -d "${OUT_DIR}/tika-server"
cp "tika-server/docker-build/minimal/Dockerfile.snapshot" "${OUT_DIR}/Dockerfile"
- name: Build tika-server minimal image for smoke test
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
context: target/tika-server-minimal-docker
platforms: linux/amd64
load: true
build-args: |
TIKA_VERSION=${{ steps.version.outputs.tika_version }}
REVISION=${{ steps.meta.outputs.sha }}
CREATED=${{ steps.meta.outputs.created }}
tags: tika-server-minimal-smoke:ci
- name: Smoke test tika-server minimal image
run: |
cleanup() {
status=$?
if [ "$status" -ne 0 ]; then
docker logs tika-server-minimal-smoke || true
fi
docker rm -f tika-server-minimal-smoke >/dev/null 2>&1 || true
exit "$status"
}
trap cleanup EXIT
docker run -d --name tika-server-minimal-smoke -p 9998:9998 tika-server-minimal-smoke:ci
for i in $(seq 1 20); do
if docker logs tika-server-minimal-smoke 2>&1 | grep -q "Started Apache Tika server"; then
echo "tika-server minimal started successfully"
exit 0
fi
sleep 2
done
echo "ERROR: tika-server minimal did not start within 40 seconds"
exit 1
- name: Build and push tika-server minimal snapshot
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
context: target/tika-server-minimal-docker
platforms: linux/amd64,linux/arm64,linux/s390x
push: true
build-args: |
TIKA_VERSION=${{ steps.version.outputs.tika_version }}
REVISION=${{ steps.meta.outputs.sha }}
CREATED=${{ steps.meta.outputs.created }}
tags: |
apache/tika:${{ steps.version.outputs.tika_version }}
# --- tika-server (full) ---
- name: Prepare tika-server full build context
run: |
TIKA_VERSION="${{ steps.version.outputs.tika_version }}"
OUT_DIR=target/tika-server-full-docker
mkdir -p "${OUT_DIR}/tika-server"
unzip -q "tika-server/tika-server-standard/target/tika-server-standard-${TIKA_VERSION}.zip" -d "${OUT_DIR}/tika-server"
cp "tika-server/docker-build/full/Dockerfile.snapshot" "${OUT_DIR}/Dockerfile"
- name: Build tika-server full image for smoke test
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
context: target/tika-server-full-docker
platforms: linux/amd64
load: true
build-args: |
TIKA_VERSION=${{ steps.version.outputs.tika_version }}
REVISION=${{ steps.meta.outputs.sha }}
CREATED=${{ steps.meta.outputs.created }}
tags: tika-server-full-smoke:ci
- name: Smoke test tika-server full image
run: |
cleanup() {
status=$?
if [ "$status" -ne 0 ]; then
docker logs tika-server-full-smoke || true
fi
docker rm -f tika-server-full-smoke >/dev/null 2>&1 || true
exit "$status"
}
trap cleanup EXIT
docker run -d --name tika-server-full-smoke -p 9999:9998 tika-server-full-smoke:ci
for i in $(seq 1 20); do
if docker logs tika-server-full-smoke 2>&1 | grep -q "Started Apache Tika server"; then
echo "tika-server full started successfully"
exit 0
fi
sleep 2
done
echo "ERROR: tika-server full did not start within 40 seconds"
exit 1
- name: Build and push tika-server full snapshot
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
context: target/tika-server-full-docker
platforms: linux/amd64,linux/arm64,linux/s390x
push: true
build-args: |
TIKA_VERSION=${{ steps.version.outputs.tika_version }}
REVISION=${{ steps.meta.outputs.sha }}
CREATED=${{ steps.meta.outputs.created }}
tags: |
apache/tika:${{ steps.version.outputs.tika_version }}-full
# --- tika-grpc ---
- name: Prepare tika-grpc Docker build context
run: |
TIKA_VERSION="${{ steps.version.outputs.tika_version }}"
OUT_DIR=target/tika-grpc-docker
mkdir -p "${OUT_DIR}/libs/tika-grpc" "${OUT_DIR}/plugins" "${OUT_DIR}/config" "${OUT_DIR}/bin"
cp "tika-grpc/target/tika-grpc-${TIKA_VERSION}.jar" "${OUT_DIR}/libs/"
mvn -pl tika-grpc dependency:copy-dependencies \
-DoutputDirectory="${PWD}/${OUT_DIR}/libs/tika-grpc" \
-DincludeScope=runtime -q -B
# Copy tika-pipes plugin zip files
for dir in tika-pipes/tika-pipes-plugins/*/; do
plugin_name=$(basename "$dir")
zip_file="${dir}target/${plugin_name}-${TIKA_VERSION}.zip"
if [ -f "$zip_file" ]; then
cp "$zip_file" "${OUT_DIR}/plugins/"
fi
done
# Copy parser packages
for parser_package in \
"tika-parsers/tika-parsers-standard/tika-parsers-standard-package" \
"tika-parsers/tika-parsers-extended/tika-parser-scientific-package" \
"tika-parsers/tika-parsers-extended/tika-parser-sqlite3-package" \
"tika-parsers/tika-parsers-ml/tika-parser-nlp-package"; do
package_name=$(basename "$parser_package")
jar_file="${parser_package}/target/${package_name}-${TIKA_VERSION}.jar"
if [ -f "$jar_file" ]; then
cp "$jar_file" "${OUT_DIR}/plugins/"
fi
done
cp "tika-grpc/docker-build/start-tika-grpc.sh" "${OUT_DIR}/bin/"
cp "tika-grpc/docker-build/Dockerfile" "${OUT_DIR}/Dockerfile"
- name: Build tika-grpc image for smoke test
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
context: target/tika-grpc-docker
platforms: linux/amd64
load: true
build-args: |
VERSION=${{ steps.version.outputs.tika_version }}
REVISION=${{ steps.meta.outputs.sha }}
CREATED=${{ steps.meta.outputs.created }}
tags: tika-grpc-smoke:ci
- name: Smoke test tika-grpc image
run: |
cleanup() {
status=$?
if [ "$status" -ne 0 ]; then
docker logs tika-grpc-smoke || true
docker ps -a --filter "name=^tika-grpc-smoke$" || true
docker inspect -f '{{.State.ExitCode}}' tika-grpc-smoke || true
fi
docker rm -f tika-grpc-smoke >/dev/null 2>&1 || true
exit "$status"
}
trap cleanup EXIT
docker run -d --name tika-grpc-smoke -p 9090:9090 tika-grpc-smoke:ci
for i in $(seq 1 15); do
if docker logs tika-grpc-smoke 2>&1 | grep -q "Server started, listening on"; then
echo "tika-grpc started successfully"
exit 0
fi
sleep 2
done
echo "ERROR: tika-grpc did not start within 30 seconds"
exit 1
- name: Build and push tika-grpc snapshot
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
context: target/tika-grpc-docker
platforms: linux/amd64,linux/arm64
push: true
build-args: |
VERSION=${{ steps.version.outputs.tika_version }}
REVISION=${{ steps.meta.outputs.sha }}
CREATED=${{ steps.meta.outputs.created }}
tags: |
apache/tika-grpc:${{ steps.version.outputs.tika_version }}