From 0e03f8a52c7928e7688a01827b81708c5ef7f275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A3=D1=80=D1=8F=D0=BD=D1=81=D0=BA=D0=B8=D0=B9=20=D0=94?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=81?= Date: Fri, 27 Dec 2024 00:12:19 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D0=B1=D0=BE=D1=80=D0=BA=D0=B8?= =?UTF-8?q?=20edt=20=D0=BD=D0=B0=20windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + build-edt.bat | 34 ++++++++++++++++++++++------------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index c46904a..b9fe09c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .env .onec.env +env.bat build_info.txt .DS_Store dive.log diff --git a/build-edt.bat b/build-edt.bat index 2243f6b..73cc14f 100644 --- a/build-edt.bat +++ b/build-edt.bat @@ -1,6 +1,10 @@ @echo off -docker login -u %DOCKER_LOGIN% -p %DOCKER_PASSWORD% %DOCKER_REGISTRY_URL% +if "%DOCKER_LOGIN%%DOCKER_PASSWORD%" neq "" ( + docker login -u %DOCKER_LOGIN% -p %DOCKER_PASSWORD% %DOCKER_REGISTRY_URL% +) else ( + echo Skipping Docker login due to missing credentials +) if %ERRORLEVEL% neq 0 goto end @@ -8,7 +12,7 @@ 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 +for /f "delims=." %%a in ("%EDT_VERSION%") do set EDT_MAJOR_VERSION=%%a if %EDT_MAJOR_VERSION% GEQ "2024" ( set BASE_IMAGE="azul/zulu-openjdk" set BASE_TAG="17" @@ -19,33 +23,39 @@ if %EDT_MAJOR_VERSION% GEQ "2024" ( if %ERRORLEVEL% neq 0 goto end -if %NO_CACHE%=="true" (SET last_arg="--no-cache .") else (SET last_arg=".") +set no_cache_arg= +if "%NO_CACHE%"=="true" (SET no_cache_arg="--no-cache") +set last_arg=. set edt_version=%EDT_VERSION% set edt_escaped=%edt_version: =_% docker build ^ - --pull ^ - --build-arg DOCKER_REGISTRY_URL=library ^ + --pull ^ + %no_cache_arg% ^ + --build-arg DOCKER_REGISTRY_URL=library ^ --build-arg BASE_IMAGE=ubuntu ^ --build-arg BASE_TAG=20.04 ^ --build-arg ONESCRIPT_PACKAGES="yard" ^ -t %DOCKER_REGISTRY_URL%/oscript-downloader:latest ^ - -f oscript/Dockerfile ^ + -f oscript/Dockerfile ^ %last_arg% docker build ^ - --build-arg ONEC_USERNAME=%ONEC_USERNAME% ^ - --build-arg ONEC_PASSWORD=%ONEC_PASSWORD% ^ + %no_cache_arg% ^ + --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_REGISTRY_URL=%DOCKER_REGISTRY_URL% ^ --build-arg DOWNLOADER_IMAGE=oscript-downloader ^ --build-arg DOWNLOADER_TAG=latest ^ - -t %DOCKER_REGISTRY_URL%/onec-client:%edt_escaped% ^ - -f edt/Dockerfile ^ - %last_arg% + -t %DOCKER_REGISTRY_URL%/edt:%edt_escaped% ^ + -f edt/Dockerfile ^ + %last_arg% if %ERRORLEVEL% neq 0 goto end +:end +echo End of program.