Skip to content

andrewhughes101/grub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GRUB: Git Remote User Build

Build your local git repository on a remote server

What It Does

GRUB synchronizes your local repository (including uncommitted changes) to a remote server and runs a build command there:

  1. Creates a patch file of all local changes (staged, unstaged, and untracked files)
  2. Pushes committed changes via git
  3. Transfers the patch file to the server
  4. Applies the patch on the server
  5. Runs your build command
  6. Downloads build output and errors

Your local git working directory is never modified.

Quick Start

Installation

Recommended (one-line install):

curl -fsSL https://raw.githubusercontent.com/andrewhughes101/grub/main/install.sh | bash

Or with wget:

wget -qO- https://raw.githubusercontent.com/andrewhughes101/grub/main/install.sh | bash

Then 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"

SSH Setup

Configure SSH with public/private key authentication. Add to ~/.ssh/config:

Host myserver
  HostName server.example.com
  User myusername

Usage

cd /path/to/your/repo
grub_client <server_root> <ssh_host> <git_path> [build_command]

Example:

grub_client /home/user/repos myserver /usr/bin ./build

With custom repo path:

grub_client --repo-path ~/projects/myapp /home/user/repos myserver /usr/bin make

VSCode Integration (Optional)

1. Create User Task

Press 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
      }
    }
  ]
}

2. Configure Settings

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"
}

3. Build

Press Cmd-Shift-B to run the build. Output streams in real-time to the terminal.

Options

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)

Defaults

  • 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
  • build_command: ./build

Environment Variables

  • TMPDIR: Temporary directory for local and remote files (default: /tmp)

Requirements

  • Git installed locally and on server
  • SSH with key-based authentication
  • Bash on server

About

git remote user build Originally forked from Mike Fultons version at https://github.com/MikeFultonDev/grub

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages