2020-01-13 12:45:52 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if ! [[ -z "${repo}" ]]; then
|
|
|
|
if [[ -z "${branch}" ]]; then
|
|
|
|
git clone $repo /workspace
|
|
|
|
else
|
|
|
|
git clone -b $branch $repo /workspace
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d /workspace ]; then
|
|
|
|
cd /workspace
|
|
|
|
fi
|
|
|
|
|
2020-05-04 03:33:07 +00:00
|
|
|
#sleep infinity
|
2020-01-13 12:45:52 +00:00
|
|
|
|
|
|
|
# use eval because commands likes `key=value command` would cause file not found error when using $@, but this eval will ruin current environment
|
|
|
|
eval $@
|
|
|
|
|
2020-07-02 13:16:22 +00:00
|
|
|
code=$?
|
|
|
|
|
2020-05-04 03:33:07 +00:00
|
|
|
# Persist output
|
2020-05-04 07:19:25 +00:00
|
|
|
python /etc/save.py
|
2020-07-02 13:16:22 +00:00
|
|
|
|
|
|
|
exit $code
|