mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-03 12:32:06 +08:00
91a2f9041b
old-commit-hash: af9091c8c4cb329d9e36b4a06ec684402b50f4a9
41 lines
819 B
Bash
Executable File
41 lines
819 B
Bash
Executable File
#!/usr/bin/bash -e
|
|
|
|
if [ -z "$SOURCE_DIR" ]; then
|
|
echo "SOURCE_DIR must be set"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$GIT_COMMIT" ]; then
|
|
echo "GIT_COMMIT must be set"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$TEST_DIR" ]; then
|
|
echo "TEST_DIR must be set"
|
|
exit 1
|
|
fi
|
|
|
|
umount /data/safe_staging/merged/ || true
|
|
sudo umount /data/safe_staging/merged/ || true
|
|
|
|
if [ -f "/EON" ]; then
|
|
rm -rf /data/core
|
|
rm -rf /data/neoupdate
|
|
rm -rf /data/safe_staging
|
|
fi
|
|
|
|
# set up environment
|
|
cd $SOURCE_DIR
|
|
git fetch --verbose origin $GIT_COMMIT
|
|
git reset --hard $GIT_COMMIT
|
|
git checkout $GIT_COMMIT
|
|
git clean -xdf
|
|
git submodule update --init --recursive
|
|
git submodule foreach --recursive "git reset --hard && git clean -xdf"
|
|
|
|
echo "git checkout done, t=$SECONDS"
|
|
|
|
rsync -a --delete $SOURCE_DIR $TEST_DIR
|
|
|
|
echo "$TEST_DIR synced with $GIT_COMMIT, t=$SECONDS"
|