Skip to content

Commit ecc5eb6

Browse files
Clear logs more often to avoid erroneous reporting
1 parent 8065001 commit ecc5eb6

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

Jenkinsfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ pipeline {
7272
) else (
7373
md C:\\Instrument\\Apps\\EPICS-%MYJOB%
7474
)
75+
REM clear logs early to stop reporting previous errors
76+
REM in case install aborts
77+
call %WORKSPACE%\clear_logs.bat
7578
if exist "C:\\Instrument\\Apps\\EPICS" (
7679
@echo Removing EPICS directory link
7780
rmdir "C:\\Instrument\\Apps\\EPICS"
@@ -127,14 +130,8 @@ pipeline {
127130
if exist "C:\\Instrument\\Apps\\EPICS" (
128131
rmdir "C:\\Instrument\\Apps\\EPICS"
129132
)
130-
del /q C:\\Instrument\\Var\\logs\\ioc\\*.*
131-
del /q C:\\Instrument\\Var\\logs\\conserver\\*.*
132-
del /q C:\\Instrument\\Var\\logs\\gateway\\blockserver\\*.*
133-
del /q C:\\Instrument\\Var\\logs\\gateway\\external\\*.*
134-
del /q C:\\Instrument\\Var\\logs\\genie_python\\*.*
135-
del /q C:\\Instrument\\Var\\logs\\deploy\\*.*
136-
del /q C:\\Instrument\\Var\\logs\\ibex_server\\*.*
137-
del /q C:\\Instrument\\Var\\logs\\IOCTestFramework\\*.*
133+
REM as ELOCK is released between stages clear logs to be safe
134+
call %WORKSPACE%\clear_logs.bat
138135
mklink /J C:\\Instrument\\Apps\\EPICS C:\\Instrument\\Apps\\EPICS-%MYJOB%
139136
IF %errorlevel% NEQ 0 (
140137
@echo ERROR: unable to make EPICS directory junction link to EPICS-%MYJOB% - error %errorlevel%
@@ -231,6 +228,11 @@ pipeline {
231228
)
232229
rmdir "C:\\Instrument\\Apps\\EPICS" >NUL 2>&1
233230
rd /q /s %WORKSPACE:/=\\%\\my_venv>NUL 2>&1
231+
REM clear logs as we have already archived them. Though we clear
232+
REM logs before an install also remove them here in case
233+
REM next job git checkout aborts and tries to report same errors
234+
REM as now all over again
235+
call %WORKSPACE%\clear_logs.bat
234236
@echo Finished cleanup on node ${env.NODE_NAME}
235237
@echo ***
236238
@echo *** Any Office365connector Matched status FAILURE message below means

clear_logs.bat

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
setlocal
2+
pushd c:\
3+
del /q C:\Instrument\Var\logs\ioc\*.*
4+
del /q C:\Instrument\Var\logs\conserver\*.*
5+
del /q C:\Instrument\Var\logs\gateway\blockserver\*.*
6+
del /q C:\Instrument\Var\logs\gateway\external\*.*
7+
del /q C:\Instrument\Var\logs\genie_python\*.*
8+
del /q C:\Instrument\Var\logs\deploy\*.*
9+
del /q C:\Instrument\Var\logs\ibex_server\*.*
10+
del /q C:\Instrument\Var\logs\IOCTestFramework\*.*
11+
popd

0 commit comments

Comments
 (0)