with updated readme
Some checks reported errors
continuous-integration/drone/push Build encountered an error
continuous-integration/drone/pr Build encountered an error

This commit is contained in:
Kasper Juul Hermansen 2022-11-27 12:28:37 +01:00
parent 991861db99
commit ba40b46b70
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912

View File

@ -14,19 +14,19 @@ are so many of them. Octopush aims to change that.
## Features ## Features
- Uses an actions repository, where you store all your pending commands or - [x] Uses an actions repository, where you store all your pending commands or
queries to be performed across your fleet of repositories. (See \_examples) queries to be performed across your fleet of repositories. (See
- Actions can both execute changes, open pull-requests or in some cases commit \_examples)
directly to your preferred branch - [x] Actions can both execute changes, open pull-requests or in some cases
- Actions natively use either shell, go or docker files to execute changes commit directly to your preferred branch
- [x] Actions natively use either shell, go or docker files to execute changes
(see \_examples/actions) (see \_examples/actions)
- Actions can also be analytical, so you can query your fleet for whatever you - [ ] Actions can also be analytical, so you can query your fleet for whatever
would like you would like
- Works both as a client, or as a server
- Supports SSH/https for fetching repos - Supports SSH/https for fetching repos
- Supports GPG signing - [ ] Supports GPG signing
- Supports dry-run mode for easy testing when developing your actions (enabled - [ ] Supports dry-run mode for easy testing when developing your actions
by default on the cli) (enabled by default on the cli)
## Roadmap ## Roadmap
@ -34,10 +34,8 @@ Refer to [roadmap.md](roadmap.md)
## Installation ## Installation
Octopush comes in two modes. Client or Client -> Server. Octopush can stand Octopush runs on your client and acts on your behalf, unless of course it is
alone as a client, for smaller and less secure changes. However, for setup on a remote server
organisations, it may be useful to use Octopush in server mode, which supports
more features, and has extra security built in.
### Client (CLI) ### Client (CLI)
@ -55,8 +53,8 @@ docker run --rm kasperhermansen/octopushcli:latest version
git clone https://github.com/kjuulh/octopush.git git clone https://github.com/kjuulh/octopush.git
cd octopush cd octopush
go build cmd/octopush/octopush.go cargo build --release --target=x64_86-unknown-linux_musl
./octopush version ./target/x64_86-unknown-linux_musl/octopush version
``` ```
#### Or Build with cuddle #### Or Build with cuddle
@ -68,49 +66,12 @@ cd octopush
cuddle_cli x build_cli cuddle_cli x build_cli
``` ```
### Server
We prefer to run the server directly as a docker image.
```bash
docker pull kasperhermansen/octopushserver:latest
docker run -p 9090:80 --rm kasperhermansen/octopushserver:latest
```
#### Or Build from source
```bash
git clone https://github.com/kjuulh/octopush.git
cd octopush
go build cmd/server/server.go
./server version
```
#### Or Build with cuddle
```bash
git clone https://github.com/kjuulh/octopush.git
cd octopush
cuddle_cli x build_server
```
## Usage ## Usage
**DISCLAIMER:** It is still early days, and the api of the CLI is subject to **DISCLAIMER:** It is still early days, and the api of the CLI is subject to
change, this provides the aim of the project, but as it is currently in flux, change, this provides the aim of the project, but as it is currently in flux,
there may not be as much handholding in the actual usage. there may not be as much handholding in the actual usage.
I will focus on the client here, as the server provides the same features,
though available through the cli, but instead as configuration options (see
[CONFIGURATION_SERVER.md](CONFIGURATION_SERVER.md))
Octopush ships with autocomplete built in (courtesy of spf13/cobra). To add:
- Bash: `echo 'source <(octopush completion bash)' >> ~/.bashrc`
- Zsh: `echo 'source <(octopush completion zsh)' >> ~/.zshrc`
### Creating a new action ### Creating a new action
Creating a new action Creating a new action
@ -118,13 +79,14 @@ Creating a new action
```bash ```bash
git init my-actions # should only be done once git init my-actions # should only be done once
cd my-actions cd my-actions
octopush tmpl init write-a-readme --command octopush tmpl init write-a-readme --action
cat write-a-readme/octopush.yml cat write-a-readme/octopush.yml
# Output # Output
# apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1 # apiVersion: action
# name: write-a-readme # name: write-a-readme
# select: # select:
# git:
# repositories: [] # repositories: []
# actions: # actions:
# - type: shell # - type: shell
@ -143,9 +105,9 @@ cat << EOF > write-a-readme/octopush.yml
apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1 apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1
name: write-a-readme name: write-a-readme
select: select:
providers: # new gitea: # new
- gitea: https://git.front.kjuulh.io # new repositories: # new
organisation: "kjuulh" # new "kjuulh/octopush" # new
actions: actions:
- type: shell - type: shell
entry: "main.sh" entry: "main.sh"
@ -234,16 +196,5 @@ outside core maintainers.
Simply: Simply:
```bash ```bash
go run cmd/octopush/octopush.go # CLI cargo build
go run cmd/server/server.go # Server
```
We follow the `gofmt` formatting, along with optionally but recommend `golines`
If using cuddle
```
cuddle_cli x run # Run both server and client, will do a quick test sweep on the cli
cuddle_cli x watch_run # Automatically refresh both
cuddle_cli x fmt # will format the current code
``` ```