-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmit_queue_gitexec.bat
More file actions
76 lines (64 loc) · 1.54 KB
/
submit_queue_gitexec.bat
File metadata and controls
76 lines (64 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@echo OFF
call submit_aff.bat %*
echo _______________________________________________________________________
echo Begin of the script...
date /T
time /T
echo _______________________________________________________________________
set GITDIR=%1
set GITCMD=%2
shift
shift
rem Build remaining parameters
set "GITARGS="
:LOOP
if "%1"=="" goto ENDLOOP
set "GITARGS=%GITARGS% %1"
shift
goto LOOP
:ENDLOOP
rem Check if directory exists
if not exist "%GITDIR%" (
echo Error: Directory "%GITDIR%" does not exist
exit 1
)
rem Change to directory
cd /d "%GITDIR%"
echo "Execution of: git %GITCMD%%GITARGS% on %CD%"
rem Check if git is installed
git --version >nul 2>&1
if %ERRORLEVEL% neq 0 (
echo Error: Git is not installed or not in PATH
exit 1
)
rem TEST Mode
if "%TOM_JOB_EXEC%" == "TEST" (
echo Job in TEST mode
%ABM_BIN%\tsend -sT -r0 -m"Job finished (TEST mode)"
%ABM_BIN%\vtgestlog
goto END
)
git %GITCMD%%GITARGS%
set RETCODE=%ERRORLEVEL%
if %RETCODE% equ 0 goto TERMINE
goto ERREUR
:ERREUR
%ABM_BIN%\tsend -sE -r%RETCODE% -m"Job in error (%RETCODE%)"
%ABM_BIN%\vtgestlog
echo _______________________________________________________________________
echo End of the script.
date /T
time /T
echo Exit [%RETCODE%]
echo _______________________________________________________________________
exit %RETCODE%
:TERMINE
%ABM_BIN%\tsend -sT -r%RETCODE% -m"Job finished (%RETCODE%)"
%ABM_BIN%\vtgestlog
echo _______________________________________________________________________
echo End of the script.
date /T
time /T
echo Exit [%RETCODE%]
exit %RETCODE%
:END