2020-01-13 20:45:52 +08: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 11:33:07 +08:00
|
|
|
#sleep infinity
|
2020-01-13 20:45:52 +08: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 21:16:22 +08:00
|
|
|
code=$?
|
|
|
|
|
|
2020-05-04 11:33:07 +08:00
|
|
|
# Persist output
|
2020-05-04 15:19:25 +08:00
|
|
|
python /etc/save.py
|
2020-07-02 21:16:22 +08:00
|
|
|
|
|
|
|
|
exit $code
|