Skip to content

Commit

Permalink
Support CONDA_ENV_NAME for selecting Conda enviroments (#1243)
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <[email protected]>
  • Loading branch information
j-rivero authored Jan 22, 2025
1 parent 343aad7 commit c075a2f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 3 additions & 2 deletions jenkins-scripts/lib/colcon-default-devel-windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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" (
Expand Down Expand Up @@ -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
)

Expand Down
12 changes: 9 additions & 3 deletions jenkins-scripts/lib/windows_library.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c075a2f

Please sign in to comment.