From c075a2fec566ba65f90a7b27f108caac84bfcef6 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Wed, 22 Jan 2025 19:09:53 +0100 Subject: [PATCH] Support CONDA_ENV_NAME for selecting Conda enviroments (#1243) Signed-off-by: Jose Luis Rivero --- jenkins-scripts/lib/colcon-default-devel-windows.bat | 5 +++-- jenkins-scripts/lib/windows_library.bat | 12 +++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/jenkins-scripts/lib/colcon-default-devel-windows.bat b/jenkins-scripts/lib/colcon-default-devel-windows.bat index 1b10f7ec2..aeaba2d3f 100644 --- a/jenkins-scripts/lib/colcon-default-devel-windows.bat +++ b/jenkins-scripts/lib/colcon-default-devel-windows.bat @@ -27,6 +27,7 @@ set LOCAL_WS_BUILD=%WORKSPACE%\build @if "%BUILD_TYPE%" == "" set BUILD_TYPE=Release @if "%ENABLE_TESTS%" == "" set ENABLE_TESTS=TRUE @if "%COLCON_AUTO_MAJOR_VERSION%" == "" set COLCON_AUTO_MAJOR_VERSION=false +@if "%CONDA_ENV_NAME%" == "" set CONDA_ENV_NAME=legacy setlocal ENABLEDELAYEDEXPANSION if "%COLCON_AUTO_MAJOR_VERSION%" == "true" ( @@ -88,8 +89,8 @@ if defined USE_PIXI ( call %win_lib% :pixi_installation || goto :error echo # END SECTION - echo # BEGIN SECTION: pixi: create legacy environment - call %win_lib% :pixi_create_gz_environment_legacy || goto :error + echo # BEGIN SECTION: pixi: create %CONDA_ENV_NAME% environment + call %win_lib% :pixi_create_gz_environment %CONDA_ENV_NAME% || goto :error echo # END SECTION ) diff --git a/jenkins-scripts/lib/windows_library.bat b/jenkins-scripts/lib/windows_library.bat index 0a1454453..439542098 100644 --- a/jenkins-scripts/lib/windows_library.bat +++ b/jenkins-scripts/lib/windows_library.bat @@ -401,12 +401,18 @@ goto :EOF :: ################################## :: :: Create a pixi environment -:pixi_create_gz_environment_legacy - +:pixi_create_gz_environment +:: arg1: environment name inside conda/envs in this repo +set ENV_NAME=%1 +set CONDA_ENV_PATH=%CONDA_ENVS_DIR%\%ENV_NAME% +if not exist %CONDA_ENV_PATH% ( + echo Can not find %CONDA_ENV_PATH% directory in the system + exit 1 +) if exist %PIXI_PROJECT_PATH% ( rmdir /s /q "%PIXI_PROJECT_PATH%") if errorlevel 1 exit 1 mkdir %PIXI_PROJECT_PATH% -copy %CONDA_ENVS_DIR%\legacy\pixi.* %PIXI_PROJECT_PATH% +copy %CONDA_ENV_PATH%\pixi.* %PIXI_PROJECT_PATH% if errorlevel 1 exit 1 pushd %PIXI_PROJECT_PATH% if errorlevel 1 exit 1