Build your local git repository on a remote server
GRUB synchronizes your local repository (including uncommitted changes) to a remote server and runs a build command there:
- Creates a patch file of all local changes (staged, unstaged, and untracked files)
- Pushes committed changes via git
- Transfers the patch file to the server
- Applies the patch on the server
- Runs your build command
- Downloads build output and errors
Your local git working directory is never modified.
Recommended (one-line install):
curl -fsSL https://raw.githubusercontent.com/andrewhughes101/grub/main/install.sh | bashOr with wget:
wget -qO- https://raw.githubusercontent.com/andrewhughes101/grub/main/install.sh | bashThen add to your shell profile (~/.bashrc, ~/.zshrc, etc.):
export PATH="$HOME/.grub/bin:$PATH"Alternative - Manual Installation:
# Download latest release
wget https://github.com/andrewhughes101/grub/releases/latest/download/grub-*.tar.gz
tar -xzf grub-*.tar.gz
export PATH="$PWD/grub/bin:$PATH"Alternative - Clone from source:
cd ~/tools
git clone git@github.com:andrewhughes101/grub.git
export PATH="$HOME/tools/grub/bin:$PATH"Configure SSH with public/private key authentication. Add to ~/.ssh/config:
Host myserver
HostName server.example.com
User myusername
cd /path/to/your/repo
grub_client <server_root> <ssh_host> <git_path> [build_command]Example:
grub_client /home/user/repos myserver /usr/bin ./buildWith custom repo path:
grub_client --repo-path ~/projects/myapp /home/user/repos myserver /usr/bin makePress Cmd-Shift-P → "Tasks: Open User Tasks" and add:
{
"version": "2.0.0",
"tasks": [
{
"label": "GRUB Build",
"type": "shell",
"command": "${config:grub.client_build_tool}",
"args": [
"--repo-path", "${workspaceFolder}",
"${config:grub.server}"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}Press Cmd-Shift-P → "Preferences: Open User Settings (JSON)" and add:
{
"grub.server": "myserver",
"grub.client_build_tool": "/Users/you/tools/grub/bin/grub_client"
}Optional settings (if you need to override defaults):
{
"grub.server": "myserver",
"grub.client_build_tool": "/Users/you/tools/grub/bin/grub_client",
"grub.server_root": "/u/user/projects",
"grub.git_dir": "/opt/git/bin"
}Press Cmd-Shift-B to run the build. Output streams in real-time to the terminal.
grub_client [options] <server> [build_command]
Options:
-v, --verbose Verbose output
-o, --output Print stdout/stderr from downloaded files
-h, --help Show help
--version Show version
--repo-path <path> Repository path (default: current directory)
--server-root <path> Remote root directory (default: ~/dev)
--git-dir <path> Git directory on server (default: auto-detect)
Arguments:
server SSH host from ~/.ssh/config
build_command Command to run (default: ./build)
- server_root:
~/dev(expands to remote user's home directory) - git_dir: Auto-detected based on platform
- z/OS:
/usr/lpp/IBM/foz/v1r1/bin - Other:
/usr/bin
- z/OS:
- build_command:
./build
TMPDIR: Temporary directory for local and remote files (default:/tmp)
- Git installed locally and on server
- SSH with key-based authentication
- Bash on server