-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# Rsync repo to build machine; build and scp the ROM back | ||
# Push to SSH machine; build and scp build products back | ||
|
||
set +v | ||
set -e | ||
git_branch=$(git branch --show-current) | ||
git push build --force # ssh://merrbot:/home/ubuntu/pokeemerald | ||
ssh merrbot "cd pokeemerald && git reset --hard && git checkout $git_branch && make" | ||
scp merrbot:pokeemerald/pokeemerald.gba romhack.gba | ||
# See https://unix.stackexchange.com/a/13472 | ||
remote_host=$(git remote get-url build | sed -nr -e "s/ssh:\/\/(\w+@?\w*):.*/\1/p") # Extract remote host | ||
remote_path=$(git remote get-url build | sed -nr -e "s/ssh:\/\/\w+@?\w*://p") # Extract remote path | ||
set -x | ||
git push build --force | ||
# `nproc` must be escaped so that it executes on the remote machine | ||
ssh $remote_host "cd $remote_path && git reset --hard && git checkout $git_branch && \ | ||
echo \"Using \`nproc\` job(s)\" && make -j\`nproc\`" | ||
scp "$remote_host:$remote_path/pokeemerald.gba" romhack.gba |