bbfdm/gitlab-ci/shared.sh
2021-05-03 18:29:28 +01:00

23 lines
280 B
Bash
Executable file

#!/bin/bash
function check_ret()
{
ret=$1
if [ "$ret" -ne 0 ]; then
echo "Validation of last command failed, ret(${ret})"
exit $ret
fi
}
function exec_cmd()
{
echo "executing $@"
$@ >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Failed to execute $@"
exit 1
fi
}