|
|
@@ -1,8 +1,16 @@
|
|
|
checkout_eval_branch() {
|
|
|
if [ -z "$COMMIT_HASH" ]; then
|
|
|
echo "Commit hash not specified, use current git commit"
|
|
|
+ build_sandbox
|
|
|
return 0
|
|
|
fi
|
|
|
+
|
|
|
+ if git diff --quiet $COMMIT_HASH HEAD; then
|
|
|
+ echo "The given hash is equivalent to the current HEAD"
|
|
|
+ build_sandbox
|
|
|
+ return 0
|
|
|
+ fi
|
|
|
+
|
|
|
echo "Start to checkout opendevin version to $COMMIT_HASH, but keep current evaluation harness"
|
|
|
if ! git diff-index --quiet HEAD --; then
|
|
|
echo "There are uncommitted changes, please stash or commit them first"
|
|
|
@@ -15,8 +23,20 @@ checkout_eval_branch() {
|
|
|
echo "Failed to check out to $COMMIT_HASH"
|
|
|
exit 1
|
|
|
fi
|
|
|
+
|
|
|
echo "Revert changes in evaluation folder"
|
|
|
git checkout $current_branch -- evaluation
|
|
|
+
|
|
|
+ # Trap the EXIT signal to checkout original branch
|
|
|
+ trap checkout_original_branch EXIT
|
|
|
+
|
|
|
+ build_sandbox
|
|
|
+}
|
|
|
+
|
|
|
+build_sandbox() {
|
|
|
+ echo "Build sandbox locally"
|
|
|
+ docker build -t eval-sandbox -f containers/sandbox/Dockerfile /tmp
|
|
|
+ export SANDBOX_CONTAINER_IMAGE="eval-sandbox"
|
|
|
}
|
|
|
|
|
|
checkout_original_branch() {
|