From c4b1067bf9b921c82ebce3c84e3f46445574d606 Mon Sep 17 00:00:00 2001 From: Dmitry Ovcharenko Date: Sun, 10 Nov 2024 13:34:55 +0300 Subject: [PATCH 1/2] 1cedtcli support and JDK 17 for EDT 2024.X.X --- build-edt-k8s-agent.sh | 11 +++++++++++ build-edt-swarm-agent.bat | 14 +++++++++++++- build-edt-swarm-agent.sh | 11 +++++++++++ edt/Dockerfile | 8 +++++--- 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/build-edt-k8s-agent.sh b/build-edt-k8s-agent.sh index 61e53fc..9931bbe 100755 --- a/build-edt-k8s-agent.sh +++ b/build-edt-k8s-agent.sh @@ -14,6 +14,15 @@ if [ "${DOCKER_SYSTEM_PRUNE}" = 'true' ] ; then docker system prune -af fi +#Если версия EDT >= 2024.1.0, использовать JDK 17 +if [[ "$(printf "%s\n" "$EDT_VERSION" "2024" | sort -V | head -n 1)" == "2024" ]]; then + BASE_IMAGE="azul/zulu-openjdk" + BASE_TAG="17.0.13-jdk" +else + BASE_IMAGE="eclipse-temurin" + BASE_TAG="11" +fi + last_arg='.' if [ "${NO_CACHE}" = 'true' ] ; then last_arg='--no-cache .' @@ -37,6 +46,8 @@ docker build \ --build-arg ONEC_USERNAME=$ONEC_USERNAME \ --build-arg ONEC_PASSWORD=$ONEC_PASSWORD \ --build-arg EDT_VERSION="$EDT_VERSION" \ + --build-arg BASE_IMAGE=$BASE_IMAGE \ + --build-arg BASE_TAG=$BASE_TAG \ --build-arg DOWNLOADER_REGISTRY_URL=$DOCKER_REGISTRY_URL \ --build-arg DOWNLOADER_IMAGE=oscript-downloader \ --build-arg DOWNLOADER_TAG=latest \ diff --git a/build-edt-swarm-agent.bat b/build-edt-swarm-agent.bat index 4940fd3..169d255 100644 --- a/build-edt-swarm-agent.bat +++ b/build-edt-swarm-agent.bat @@ -8,12 +8,22 @@ if %DOCKER_SYSTEM_PRUNE%=="true" docker system prune -af if %ERRORLEVEL% neq 0 goto end +for /f "delims=." %%a in ("%EDT_VERSION%") do set EDT_MAJOR_VERSION=%aa +if %EDT_MAJOR_VERSION% GEQ "2024" ( + set BASE_IMAGE="azul/zulu-openjdk" + set BASE_TAG="17.0.13-jdk" +) else ( + set BASE_IMAGE="eclipse-temurin" + set BASE_TAG="11" +) + +if %ERRORLEVEL% neq 0 goto end + if %NO_CACHE%=="true" (SET last_arg="--no-cache .") else (SET last_arg=".") set edt_version=%EDT_VERSION% set edt_escaped=%edt_version: =_% - docker build ^ --pull ^ --build-arg DOCKER_REGISTRY_URL=library ^ @@ -28,6 +38,8 @@ docker build ^ --build-arg ONEC_USERNAME=%ONEC_USERNAME% ^ --build-arg ONEC_PASSWORD=%ONEC_PASSWORD% ^ --build-arg EDT_VERSION=%EDT_VERSION% ^ + --build-arg BASE_IMAGE=%BASE_IMAGE% ^ + --build-arg BASE_TAG=%BASE_TAG% ^ --build-arg DOCKER_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^ --build-arg DOWNLOADER_IMAGE=oscript-downloader ^ --build-arg DOWNLOADER_TAG=latest ^ diff --git a/build-edt-swarm-agent.sh b/build-edt-swarm-agent.sh index d34d017..9cebf5b 100755 --- a/build-edt-swarm-agent.sh +++ b/build-edt-swarm-agent.sh @@ -14,6 +14,15 @@ if [ "${DOCKER_SYSTEM_PRUNE}" = 'true' ] ; then docker system prune -af fi +#Если версия EDT >= 2024.1.0, использовать JDK 17 +if [[ "$(printf "%s\n" "$EDT_VERSION" "2024" | sort -V | head -n 1)" == "2024" ]]; then + BASE_IMAGE="azul/zulu-openjdk" + BASE_TAG="17.0.13-jdk" +else + BASE_IMAGE="eclipse-temurin" + BASE_TAG="11" +fi + last_arg='.' if [ "${NO_CACHE}" = 'true' ] ; then last_arg='--no-cache .' @@ -37,6 +46,8 @@ docker build \ --build-arg ONEC_USERNAME=$ONEC_USERNAME \ --build-arg ONEC_PASSWORD=$ONEC_PASSWORD \ --build-arg EDT_VERSION="$EDT_VERSION" \ + --build-arg BASE_IMAGE=$BASE_IMAGE \ + --build-arg BASE_TAG=$BASE_TAG \ --build-arg DOWNLOADER_REGISTRY_URL=$DOCKER_REGISTRY_URL \ --build-arg DOWNLOADER_IMAGE=oscript-downloader \ --build-arg DOWNLOADER_TAG=latest \ diff --git a/edt/Dockerfile b/edt/Dockerfile index 12e28af..14255f0 100644 --- a/edt/Dockerfile +++ b/edt/Dockerfile @@ -38,7 +38,7 @@ ENV LC_ALL ru_RU.UTF-8 RUN /download.sh "$ONEC_USERNAME" "$ONEC_PASSWORD" "$EDT_VERSION" "edt" -FROM ${DOCKER_REGISTRY_URL}/${BASE_IMAGE}:${BASE_TAG} +FROM ${BASE_IMAGE}:${BASE_TAG} LABEL maintainer="Nikita Gryzlov , FirstBit" @@ -70,6 +70,8 @@ WORKDIR /tmp/${downloads} RUN chmod +x ./1ce-installer-cli \ && ./1ce-installer-cli install all --ignore-hardware-checks --ignore-signature-warnings\ && rm -rf /tmp/* \ - && mv $(dirname $(find /opt/1C/1CE -name ring)) /opt/1C/1CE/components/1c-enterprise-ring + && mv $(dirname $(find /opt/1C/1CE -name ring)) /opt/1C/1CE/components/1c-enterprise-ring \ + #1cedtcli отсутствует в EDT версии <2023.1.0 + && if [ -n "$(find /opt/1C/1CE -name 1cedtcli)" ]; then mv $(dirname $(find /opt/1C/1CE -name 1cedtcli)) /opt/1C/1CE/components/1cedtcli; fi -ENV PATH="/opt/1C/1CE/components/1c-enterprise-ring:$PATH" +ENV PATH="/opt/1C/1CE/components/1c-enterprise-ring:/opt/1C/1CE/components/1cedtcli:$PATH" From db9003d0c44d5b1618634da9721a6516ad32e321 Mon Sep 17 00:00:00 2001 From: Dmitry Ovcharenko Date: Sun, 10 Nov 2024 14:32:19 +0300 Subject: [PATCH 2/2] fix tag --- build-edt-k8s-agent.sh | 2 +- build-edt-swarm-agent.bat | 2 +- build-edt-swarm-agent.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build-edt-k8s-agent.sh b/build-edt-k8s-agent.sh index 9931bbe..92929f6 100755 --- a/build-edt-k8s-agent.sh +++ b/build-edt-k8s-agent.sh @@ -17,7 +17,7 @@ fi #Если версия EDT >= 2024.1.0, использовать JDK 17 if [[ "$(printf "%s\n" "$EDT_VERSION" "2024" | sort -V | head -n 1)" == "2024" ]]; then BASE_IMAGE="azul/zulu-openjdk" - BASE_TAG="17.0.13-jdk" + BASE_TAG="17" else BASE_IMAGE="eclipse-temurin" BASE_TAG="11" diff --git a/build-edt-swarm-agent.bat b/build-edt-swarm-agent.bat index 169d255..672afde 100644 --- a/build-edt-swarm-agent.bat +++ b/build-edt-swarm-agent.bat @@ -11,7 +11,7 @@ if %ERRORLEVEL% neq 0 goto end for /f "delims=." %%a in ("%EDT_VERSION%") do set EDT_MAJOR_VERSION=%aa if %EDT_MAJOR_VERSION% GEQ "2024" ( set BASE_IMAGE="azul/zulu-openjdk" - set BASE_TAG="17.0.13-jdk" + set BASE_TAG="17" ) else ( set BASE_IMAGE="eclipse-temurin" set BASE_TAG="11" diff --git a/build-edt-swarm-agent.sh b/build-edt-swarm-agent.sh index 9cebf5b..fbc6941 100755 --- a/build-edt-swarm-agent.sh +++ b/build-edt-swarm-agent.sh @@ -17,7 +17,7 @@ fi #Если версия EDT >= 2024.1.0, использовать JDK 17 if [[ "$(printf "%s\n" "$EDT_VERSION" "2024" | sort -V | head -n 1)" == "2024" ]]; then BASE_IMAGE="azul/zulu-openjdk" - BASE_TAG="17.0.13-jdk" + BASE_TAG="17" else BASE_IMAGE="eclipse-temurin" BASE_TAG="11"