Skip to content

Commit

Permalink
Merge pull request #53 from ovcharenko-di/feature/1cedtcli_edt2024
Browse files Browse the repository at this point in the history
Поддержка 1cedtcli и переход на базовый образ с JDK 17 для EDT 2024.1.0+
  • Loading branch information
nixel2007 authored Nov 10, 2024
2 parents 52ef0df + db9003d commit e7a928f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
11 changes: 11 additions & 0 deletions build-edt-k8s-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
else
BASE_IMAGE="eclipse-temurin"
BASE_TAG="11"
fi

last_arg='.'
if [ "${NO_CACHE}" = 'true' ] ; then
last_arg='--no-cache .'
Expand All @@ -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 \
Expand Down
14 changes: 13 additions & 1 deletion build-edt-swarm-agent.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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"
) 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 ^
Expand All @@ -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 ^
Expand Down
11 changes: 11 additions & 0 deletions build-edt-swarm-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
else
BASE_IMAGE="eclipse-temurin"
BASE_TAG="11"
fi

last_arg='.'
if [ "${NO_CACHE}" = 'true' ] ; then
last_arg='--no-cache .'
Expand All @@ -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 \
Expand Down
8 changes: 5 additions & 3 deletions edt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>, FirstBit"

Expand Down Expand Up @@ -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"

0 comments on commit e7a928f

Please sign in to comment.