-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtom_submit.gitexec
More file actions
69 lines (57 loc) · 1.73 KB
/
tom_submit.gitexec
File metadata and controls
69 lines (57 loc) · 1.73 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
#!/bin/bash
# Absyss 2025
# RC GEN Redirect
if [ "$TOM_RESOURCE_EVAL" = "1" ] ; then
. $TOM_ADMIN/tom_submit.rcgen $*
exit $?
fi
# ----------------------------------------------------- #
# TOM SUBMITTER - GIT EXEC #
# ----------------------------------------------------- #
. $TOM_ADMIN/vtom_init.bash
if [ -n ${TOM_JOB_ID:-0} ] ; then
# Display information
. $TOM_ADMIN/tom_submit.aff $*
echo "_______________________________________________________________________"
date +"%A %d/%m/%Y - %H:%M:%S"
echo " Start of the git command execution..."
echo "_______________________________________________________________________"
echo " "
GITDIR=$1
GITCMD=$2
shift
shift
# Preserve and pass all remaining arguments safely.
# (remove previous eval-based arg array construction)
cd "$GITDIR"
echo "Execution of: git ${GITCMD} $* on $(pwd)"
# Mode TEST
if [ "${TOM_JOB_EXEC}" = "TEST" ] ; then
echo "Job execute in TEST mode"
${ABM_BIN}/tsend -sT -r0 -m"Job finished (TEST mode)"
${ABM_BIN}/vtgestlog
exit 0
fi
git "$GITCMD" "$@"
stat_fin_job=$?
# Exit management
echo "_______________________________________________________________________"
date +"%A %d/%m/%Y - %H:%M:%S"
echo "End of Script."
echo " "
if [ "${stat_fin_job}" = "0" ] ; then
echo "--> Exit [${stat_fin_job}]"
${ABM_BIN}/tsend -sT -r${stat_fin_job} -m"Job finished (${stat_fin_job})"
${ABM_BIN}/vtgestlog
else
echo "--> Exit [${stat_fin_job}]"
${ABM_BIN}/tsend -sE -r${stat_fin_job} -m"Job in error (${stat_fin_job})"
${ABM_BIN}/vtgestlog
fi
exit ${stat_fin_job}
else
echo " "
echo "--> Job not submitted by a Visual TOM engine."
echo " "
exit 1
fi