diff --git a/ocr-service-v1/ocr-service-processor/build.gradle.kts b/ocr-service-v1/ocr-service-processor/build.gradle.kts index 0b0ad1b..8a39916 100644 --- a/ocr-service-v1/ocr-service-processor/build.gradle.kts +++ b/ocr-service-v1/ocr-service-processor/build.gradle.kts @@ -25,7 +25,7 @@ dependencies { api("io.github.karols:hocr4j:0.2.0") api("com.amazonaws:aws-java-sdk-kms:1.12.440") api("com.google.guava:guava:31.1-jre") - api("com.iqser.red.commons:pdftron-logic-commons:2.27.0") + api("com.iqser.red.commons:pdftron-logic-commons:2.30.0") api("com.knecon.fforesight:viewer-doc-processor:0.125.0") testImplementation("org.junit.jupiter:junit-jupiter:5.8.1") } diff --git a/ocr-service-v1/ocr-service-server/build.gradle.kts b/ocr-service-v1/ocr-service-server/build.gradle.kts index a7ba1d5..690c917 100644 --- a/ocr-service-v1/ocr-service-server/build.gradle.kts +++ b/ocr-service-v1/ocr-service-server/build.gradle.kts @@ -39,7 +39,7 @@ tasks.named("bootBuildImage") { environment.put("BPE_DELIM_JAVA_TOOL_OPTIONS", " ") environment.put("BPE_APPEND_JAVA_TOOL_OPTIONS", "-Dfile.encoding=UTF-8") - environment.put("BPE_GS_LIB", "/layers/fagiani_apt/apt/usr/share/ghostscript/9.26/Resource/Init/") // set ghostscript lib path + environment.put("BPE_GS_LIB", "/layers/fagiani_apt/apt/usr/share/ghostscript/9.55.0/Resource/Init/") // set ghostscript lib path, version in path must match version in Aptfile environment.put("BPE_FONTCONFIG_PATH", "/layers/fagiani_apt/apt/etc/fonts/") // set ghostscript fontconfig path var aptfile = layout.projectDirectory.file("src/main/resources/Aptfile").toString() diff --git a/ocr-service-v1/ocr-service-server/src/main/resources/Aptfile b/ocr-service-v1/ocr-service-server/src/main/resources/Aptfile index 4e28770..6ee2eb0 100644 --- a/ocr-service-v1/ocr-service-server/src/main/resources/Aptfile +++ b/ocr-service-v1/ocr-service-server/src/main/resources/Aptfile @@ -1,5 +1,5 @@ # you can list packages -ghostscript +ghostscript=9.55.0~dfsg1-0ubuntu5.9 pkg-config zip unzip @@ -11,6 +11,7 @@ libk5crypto3 libkrb5support0 libkeyutils1 libkrb5-3 +libbrotli1 # or include links to specific .deb files # http://ftp.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.8_all.deb diff --git a/publish-custom-image.sh b/publish-custom-image.sh index 9afa975..9bd4785 100755 --- a/publish-custom-image.sh +++ b/publish-custom-image.sh @@ -1,5 +1,9 @@ #!/bin/bash + +set -e + dir=${PWD##*/} + gradle assemble # Get the current Git branch @@ -11,5 +15,32 @@ commit_hash=$(git rev-parse --short=5 HEAD) # Combine branch and commit hash buildName="${USER}-${branch}-${commit_hash}" -gradle bootBuildImage --publishImage -PbuildbootDockerHostNetwork=true -Pversion=$buildName -echo "nexus.knecon.com:5001/ff/${dir}-server:$buildName" +gradle bootBuildImage --publishImage -PbuildbootDockerHostNetwork=true -Pversion=${buildName} + +newImageName="nexus.knecon.com:5001/ff/ocr-service-server:$buildName" + +echo "full image name:" +echo ${newImageName} +echo "" + +if [ -z "$1" ]; then + exit 0 +fi + +namespace=${1} +deployment_name="ocr-service-v1" + +echo "deploying to ${namespace}" + +oldImageName=$(rancher kubectl -n ${namespace} get deployment ${deployment_name} -o=jsonpath='{.spec.template.spec.containers[*].image}') + +if [ "${newImageName}" = "${oldImageName}" ]; then + echo "Image tag did not change, redeploying..." + rancher kubectl rollout restart deployment ${deployment_name} -n ${namespace} +else + echo "upgrading the image tag..." + rancher kubectl set image deployment/${deployment_name} ${deployment_name}=${newImageName} -n ${namespace} +fi +rancher kubectl rollout status deployment ${deployment_name} -n ${namespace} +echo "Built ${deployment_name}:${buildName} and deployed to ${namespace}" +