Skip to content

Rapidly manage your WSL environments with a handful of commands.

Notifications You must be signed in to change notification settings

JosiahSiegel/rapid-wsl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rapid WSL

Open in Visual Studio Code

⚠️Disable Docker Desktop resource saver due to instability

Synopsis

Easily manage your WSL environment with a handful of generic commands. Applications are seperated into modules. Remote repository is cloned into distro if specified (-r).

Quick start

./rwsl init -d "Ubuntu-18.04" -m "generic" # -d:Distro, -m:Module, -u:User, -r:Repo

or

./rwsl init $(cat defaults/generic.sh)

Security

Place .pgp & .gitconfig files into the etc/ directory (ignored by git).

Example .gitconfig:

[core]
   editor = "vim"
[user]
	name = First Last
	email = my@email.com
	signingKey = xxx

[commit]
	gpgSign = True

How to import pgp files from keybase.io:

keybase pgp export -q xxx > etc/public.pgp
keybase pgp export -q xxx --secret > etc/private.pgp

For GitHub authorization, add GitHub personal access token file git.token to etc/.

Commands

  1. init (Re)initialize env.
  2. status Status of env.
  3. backup Backup env to .tar file.
  4. down Shutdown env.
  5. up Bring env up after shutdown.
  6. destroy Destroy env.
  7. restore Restore env from .tar file.
  8. test Run module specific env tests.
  9. fix Run module specific env fixes.

The following scripts can be run in various order, but some run orders are not compatible (e.g. destroy then test):

d="Ubuntu"; # Distro name
m="generic"; # Module name

./rwsl init -d $d -m $m;
./rwsl status -d $d -m $m;
./rwsl backup -d $d -m $m;
./rwsl down -d $d -m $m;
./rwsl up -d $d -m $m;
./rwsl destroy -d $d -m $m;
./rwsl restore -d $d -m $m;
./rwsl test -d $d -m $m;

Mandatory:

  • -d, --distro VAL Distro name (reference: wsl --list --online)
  • -m, --module VAL Application name

Optional:

  • -u, --user VAL username
  • -r, --repo VAL Repository url
  • -h, --help Prints this help

Examples:

  • ./rwsl [COMMAND] -d VAL -m VAL -u VAL
  • ./rwsl init -d 'Ubuntu-18.04' -m 'generic' -u 'user3' -r 'https://github.com/JosiahSiegel/rapid-wsl.git'

Tips

Quick re-use arguments:

  1. Create defaults/my_args.sh file
    • -d Ubuntu-20.04 -m generic -u user3
  2. Run script using default file
    • ./rwsl init $(cat defaults/my_args.sh)

Notes

Currently, only tested using Git Bash via Windows Terminal.

About

Rapidly manage your WSL environments with a handful of commands.

Topics

Resources

Stars

Watchers

Forks

Languages