Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cbluth/gsh
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.0.1
Choose a base ref
...
head repository: cbluth/gsh
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Aug 16, 2020

  1. more docs

    cbluth committed Aug 16, 2020
    Copy the full SHA
    e707740 View commit details
Showing with 85 additions and 1 deletion.
  1. +8 −0 Readme.md
  2. +48 −1 docs/groups.md
  3. +9 −0 docs/hosts.md
  4. +20 −0 docs/labels.md
8 changes: 8 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -10,6 +10,8 @@ This should work on any linux host, like your workstation. Mac os builds are bei
Access to some ssh servers is needed to use all the features of `gsh`. Currently only bash is supported, with plans for more languages.

### Installation
You can download the latest release here: https://github.com/cbluth/gsh/releases <br />
Or use these options:

#### A) Use Go Install
To build with go install:
@@ -52,6 +54,12 @@ This is a new project, with lots of issues, if you see any bugs, please report t
To hack on this project, git clone to anywhere, and edit the code directly.
After applying edits to the codebase, you can use `./gsh.sh` to compile and run `gsh` via go, with the same arguments as running the program normally; eg: `./gsh.sh make host dev0 address=dev0.local`

## TODO
- Implement `copy` feature
- Cleanup orphaned files/scripts in ~/.gsh
- Implement `sudo=true` feature for scripts
- Support other languages like python, nodejs, and ruby

## License

This project is licensed under the MIT License, see the [LICENSE](LICENSE) file for details.
49 changes: 48 additions & 1 deletion docs/groups.md
Original file line number Diff line number Diff line change
@@ -1 +1,48 @@
# Groups (TODO)
# Groups
A group represents collection of [`hosts`](hosts.md) on the network.

Aliases:
- `group`
- `groups`

## Making, Updating, Deleting, and Listing Groups
Your group inventory is empty until you have added a group.<br />
A group will only contain hosts if the hosts also have matching labels.
These are the types operations you can do with a group:
- [`make`](make.md) # Make or Update a group in inventory
- [`delete`](delete.md) # Delete a group from inventory
- [`show`](show.md) # Show or List group
- [`execute`](execute.md) # Execute scripts on groups of hosts
- [`copy`](copy.md) # Copy files/scripts to groups of hosts

## Special Labels

Groups use their assigned labels to determine which hosts are in the group.
For example a group made as: `gsh make group baz project=baz`, this will create a group called `baz` and all hosts with `project=baz` as a label will be in the group.

## Examples:

```bash
$ # making a group with labels
$ gsh make group develop develop=true
╔═══════╕ Set!
║ Group └─────────╮
╿ Name : Labels
└ develop : develop=true
```
```bash
$ # updating the same group with different labels
$ gsh make group develop environment=develop
╔═══════╕ Set!
║ Group └─────────╮
╿ Name : Labels
└ develop : environment=develop
```
```bash
$ # deleting a group
$ gsh del group demo1
╔═══════╕ Deleted!
║ Group └─────────╮
╿ Name : Labels
└ demo1 : demo=true
```
9 changes: 9 additions & 0 deletions docs/hosts.md
Original file line number Diff line number Diff line change
@@ -41,6 +41,15 @@ $ gsh make host dev0 address=dev0.local develop=true project=bar
└ dev0 : address=dev0.local develop=true project=bar
```
```bash
$ # showing hosts with a label
$ gsh show hosts demo=true
╔═══════╕ Total: 2
║ Hosts └─────────╮
╿ Name : Labels
├ demo2 : address=demo2.local demo=true
└ demo3 : address=demo3.local demo=true
```
```bash
$ # deleting a host
$ gsh del host demo1
╔══════╕ Deleted!
20 changes: 20 additions & 0 deletions docs/labels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Labels

A label it just a key value pair, and is typically desgniated by the `=` equals sign in the middle of a string, like so:
- `color=green`
- `develop=true`
- `environment=production`
- `project=foobar`

Labels are heavily used by `gsh`. You can add a label to any item in your inventory, and some inventory items take or use specific labels.


## Hosts
Hosts use the `address` label to connect via ssh client, eg: `address=myhost.example.org`

## Groups
Groups use assigned labels to select hosts with the same label. <br />
For example, doing `gsh make group green color=green` would create a group called "green", and all hosts that have `color=green` labels assigned to them, then the same hosts would be in the group.

## Scripts