Skip to content

Commit 964032d

Browse files
committed
add activate venv script
1 parent 3650f5e commit 964032d

10 files changed

+16
-10
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
REM Activate a virtual environment created by set_up_venv.bat. Also set the UV_TEMP_VENV var.
2+
REM this might be needed if ie. stop_ibex_server calls config_env and wipes env vars.
3+
set UV_TEMP_VENV=C:\Instrument\Var\tmp\.deployscriptvenv
4+
call %UV_TEMP_VENV%\scripts\activate

installation_and_upgrade/instrument_deploy.bat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ if "%DETECT_OLD_GALIL%" == "YES" (
8080
)
8181

8282
REM stop_ibex_server calls config_env which means we have to reactivate our venv
83-
call %UV_TEMP_VENV%\scripts\activate
83+
call "%~dp0_activate_venv.bat"
8484

8585
call python "%~dp0IBEX_upgrade.py" --release_dir "%SOURCE%" --release_suffix "%SUFFIX%" --server_arch %SERVER_ARCH% --confirm_step instrument_deploy_main
8686
IF %errorlevel% neq 0 exit /b %errorlevel%
@@ -89,6 +89,8 @@ ENDLOCAL
8989
start /i /wait cmd /c "%START_IBEX%"
9090

9191
REM start_ibex_server calls config_env which means we have to reactivate our venv
92+
call "%~dp0_activate_venv.bat"
93+
9294
call python "%~dp0IBEX_upgrade.py" --release_dir "%SOURCE%" --release_suffix "%SUFFIX%" --server_arch %SERVER_ARCH% --confirm_step instrument_deploy_post_start
9395
call rmdir /s /q %UV_TEMP_VENV%
9496

installation_and_upgrade/instrument_install.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ IF EXIST "C:\Instrument\Apps\EPICS" (start /wait cmd /c "%STOP_IBEX%")
3838

3939

4040
REM stop_ibex_server calls config_env which means we have to reactivate our venv
41-
call %UV_TEMP_VENV%\scripts\activate
41+
call "%~dp0_activate_venv.bat"
4242

4343
call python "%~dp0IBEX_upgrade.py" --release_dir "%SOURCE%" --release_suffix "%SUFFIX%" --server_arch %SERVER_ARCH% --confirm_step instrument_install
4444
if %errorlevel% neq 0 goto ERROR

installation_and_upgrade/instrument_install_latest_build_only.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ set "STOP_IBEX=C:\Instrument\Apps\EPICS\stop_ibex_server.bat"
2121
IF EXIST "C:\Instrument\Apps\EPICS" (
2222
call "%STOP_IBEX%"
2323
REM stop_ibex_server calls config_env which means we have to reactivate our venv
24-
call %UV_TEMP_VENV%\scripts\activate
24+
call "%~dp0_activate_venv.bat"
2525
) else (
2626
REM in case one has been left around running in the background
2727
taskkill /f /im caRepeater.exe

installation_and_upgrade/instrument_test.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ if %errorlevel% neq 0 goto ERROR
88
call "%LATEST_PYTHON%" "%~dp0IBEX_upgrade.py" --release_dir "%SOURCE%" --confirm_step instrument_test
99
if %errorlevel% neq 0 goto ERROR
1010

11-
call "%~dp0remove_genie_python.bat" %LATEST_PYTHON_DIR%
12-
1311
call rmdir /s /q %UV_TEMP_VENV%
1412

1513
exit /b 0

installation_and_upgrade/run_standalone_backup.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ call "%~dp0set_epics_ca_addr_list.bat"
55
call "%~dp0install_or_update_uv.bat"
66
call "%~dp0set_up_venv.bat"
77
IF %errorlevel% neq 0 EXIT /b %errorlevel%
8-
call cd "%~dp0"
9-
@REM Uses Python from the Shares, set as LATEST_PYTHON
108
call python "%~dp0ibex_install_utils\tasks\backup_tasks.py"
119
call rmdir /s /q %UV_TEMP_VENV%
1210
endlocal

installation_and_upgrade/upgrade_mysql.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ set "START_IBEX=C:\Instrument\Apps\EPICS\start_ibex_server"
1111

1212
start /wait cmd /c "%STOP_IBEX%"
1313

14-
call "%LATEST_PYTHON%" -u "%~dp0IBEX_upgrade.py" --release_dir "%SOURCE%" --release_suffix "%SUFFIX%" --confirm_step force_upgrade_mysql
14+
call "%~dp0_activate_venv.bat"
15+
call python -u "%~dp0IBEX_upgrade.py" --release_dir "%SOURCE%" --release_suffix "%SUFFIX%" --confirm_step force_upgrade_mysql
1516

1617
IF %errorlevel% neq 0 (
1718
set errcode = %ERRORLEVEL%

installation_and_upgrade/vhd_build.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ IF EXIST "C:\Instrument\Apps\EPICS\stop_ibex_server.bat" (
1212
start /wait cmd /c "C:\Instrument\Apps\EPICS\stop_ibex_server.bat"
1313
)
1414

15+
call "%~dp0_activate_venv.bat"
1516
call "%LATEST_PYTHON%" "%~dp0IBEX_upgrade.py" --kits_icp_dir "%KITS_ICP_PATH%" create_vhds --quiet --no_log_to_var
1617
IF %ERRORLEVEL% NEQ 0 (
1718
set errcode = %ERRORLEVEL%

installation_and_upgrade/vhd_build_force_cleanup.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ IF EXIST "C:\Instrument\Apps\EPICS\stop_ibex_server.bat" (
1111
start /wait cmd /c "C:\Instrument\Apps\EPICS\stop_ibex_server.bat"
1212
)
1313

14-
call "%LATEST_PYTHON%" "%~dp0IBEX_upgrade.py" --kits_icp_dir "%KITS_ICP_PATH%" request_dismount_vhds --quiet --no_log_to_var
14+
call "%~dp0_activate_venv.bat"
15+
call python "%~dp0IBEX_upgrade.py" --kits_icp_dir "%KITS_ICP_PATH%" request_dismount_vhds --quiet --no_log_to_var
1516

1617
IF %ERRORLEVEL% NEQ 0 (
1718
set errcode = %ERRORLEVEL%

installation_and_upgrade/vhd_build_release.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ IF EXIST "C:\Instrument\Apps\EPICS\stop_ibex_server.bat" (
1111
start /wait cmd /c "C:\Instrument\Apps\EPICS\stop_ibex_server.bat"
1212
)
1313

14-
call "%LATEST_PYTHON%" -u "%~dp0IBEX_upgrade.py" --release_dir "%SOURCE%" create_vhds --quiet --no_log_to_var
14+
call "%~dp0_activate_venv.bat"
15+
call python -u "%~dp0IBEX_upgrade.py" --release_dir "%SOURCE%" create_vhds --quiet --no_log_to_var
1516

1617
IF %ERRORLEVEL% NEQ 0 (
1718
set errcode = %ERRORLEVEL%

0 commit comments

Comments
 (0)