Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sympl
Sympl Testing Suite
Commits
79c1bd86
Commit
79c1bd86
authored
Apr 13, 2021
by
Paul Cammish
Browse files
Basic structure
parent
575c842b
Changes
2
Show whitespace changes
Inline
Side-by-side
sympl-tests
View file @
79c1bd86
#!/bin/bash
touch
/dev/shm/sympl-tests
wall
"
`
date
`
"
set
-e
set
-o
pipefail
if
[
"
$(
echo
"
$@
"
|
grep
-c
'\-\-debug'
)
"
!=
"0"
]
;
then
DEBUG
=
"true"
;
fi
##############################################################################
# Output Functions #
##############################################################################
_debug
()
{
if
[
$DEBUG
]
;
then
echo
-e
"
\0
33[2mDEBUG:
$@
\0
33[0m"
fi
}
_warn
()
{
echo
-e
"
\0
33[1m
\0
33[33m WARN:
\0
33[0m
$@
"
}
_error
()
{
echo
-e
"
\0
33[1m
\0
33[31mERROR:
\0
33[0m
$@
"
exit
1
}
_echo
()
{
if
[
$DEBUG
]
;
then
echo
" INFO:
$@
"
elif
[
$VERBOSE
]
;
then
echo
"
$@
"
fi
}
#############################################################################
# Set Defaults #
#############################################################################
TIMESTAMP
=
"
$(
date
+%s
)
"
TEST_PATH
=
"
$(
dirname
$0
)
"
VERBOSE
=
true
LOG
=
"/tmp/sympl-tests.log"
#############################################################################
# Read Command Line Parameters #
#############################################################################
_debug
"Command line parameters:
$@
"
PARAMETERS
=()
while
[
$#
-gt
0
]
;
do
key
=
"
$1
"
case
$key
in
--all
|
-a
)
ALL
=
true
shift
;;
--log
|
-l
)
LOG
=
"
$2
"
shift
;
shift
;;
--path
)
TEST_PATH
=
"
$2
"
shift
;
shift
;;
--cron
)
unset
VERBOSE
shift
;;
--quiet
)
unset
VERBOSE
QUIET
=
true
shift
;;
*
)
# unhandled parameter
PARAMETERS+
=(
"
$1
"
)
# save it in an array for later
shift
# past argument
;;
esac
done
_debug
"Command line variables:
------------------------------------------
UNKNOWN |
$PARAMETERS
VERBOSE |
$VERBOSE
LOG |
$LOG
TEST_PATH |
$TEST_PATH
DEBUG |
$DEBUG
"
TIMESTAMP
=
"
$(
date
+%s
)
"
_echo
"Starting run at
$(
date
;
if
[
"
$TEST_PATH
"
!=
"."
]
;
then
echo
", test path: '
$TEST_PATH
'"
;
fi
)
"
sympl-tests.cron
View file @
79c1bd86
* * * * * root cd /root/sympl-tests/ ; git pull ; /usr/bin/flock -n 3 /root/sympl-tests/sympl-tests --all
* * * * * root cd /root/sympl-tests/ ; git pull ; /usr/bin/flock -n 3 /root/sympl-tests/sympl-tests
--cron
--all
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment