Skip to content

Instantly share code, notes, and snippets.

@mdempsky
Created December 17, 2020 20:59
Show Gist options
  • Save mdempsky/bbd5c60a48026329d0b796ddad1e3d9d to your computer and use it in GitHub Desktop.
Save mdempsky/bbd5c60a48026329d0b796ddad1e3d9d to your computer and use it in GitHub Desktop.
#!/bin/sh -e
remote=kyuubi
path=wd/go
# Make a snapshot commit of the current working tree.
git add -u
index=$(git write-tree)
commit=$(git commit-tree $index -p HEAD -m "gotry checkpoint")
# Copy commit to build server.
# TODO(mdempsky): Better ref to use for transient commit?
git push -q -f $remote:$path $commit:refs/remotes/gotry/next
# Test it out.
# TODO(mdempsky): Add git clean -f for src directory?
ssh $remote "
bash -l -e -c \"
set -x
cd $path/test
git checkout gotry/next
go install -toolexec=toolstash cmd/compile
go install -a -toolexec='toolstash -cmp' std
go run run.go
\"
"
# Move to new commit.
git reset $commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment