A customizable CLI for collaboratively running container-native workflows
For full usage, please refer to the: Docs.
This project serves the purpose of giving developers, operations and other personal the ability to run custom workflows on their personal computer using a container environment, without them writing code and having to understand the meaning behind the script.
Download the latest release for your os: (this example uses version v0.5.6
).
For Mac:
$ curl -L https://github.com/jatalocks/opsilon/releases/download/v0.5.6-alpha/opsilon_0.5.6-alpha_Darwin_x86_64.tar.gz \
| tar -xz opsilon | chmod u+x opsilon
Test if the Opsilon CLI works: (When it doesn't work, you may have downloaded the wrong file or your device/os isn't supported)
$ ./opsilon version
Move the executable to a folder on your $PATH
:
$ mv opsilon /usr/local/bin/opsilon # or /usr/bin/opsilon
$ helm install https://github.com/jatalocks/opsilon/releases/download/opsilon-0.4.2-helm/opsilon-0.4.2-helm.tgz
Make sure you have Docker installed on your computer (or connected to a kubernetes cluster --kubernetes
).
EITHER
- Connect to the examples folder present in this repository
$ opsilon repo add --git -n examples -d examples -s examples/workflows -p https://github.com/jatalocks/opsilon.git -b main
# For private repositories, use https://myuser:github_token@github.com/myprivateorg/>myprivaterepo.git
- List available workflows
$ opsilon list
- Run a workflow!
$ opsilon run # --kubernetes (kubernetes instead of docker)
OR
- Start the web server
$ opsilon server -p 8080 # See extra flags below
- List available API actions
$ Go to http://localhost:8080/api/v1/docs
OR
- Start the slack server
$ export SLACK_BOT_TOKEN=xoxb-123
$ export SLACK_APP_TOKEN=xapp-123
$ opsilon slack # See extra flags below
- Install the app from the manifest in Manifest
- Go to the Opsilon app in your slack
$ help
list repos - List Available Workflows
Example: list
Example: list myteam
Example: list examples,myteam
run
--kubernetes
- (kubernetes instead of docker)
server
or slack
will usually come with:
--consul
- Enable a consul server as a configuration endpoint. Allows for a distributed remote configuration of workflows and repositories instead of a local file.
--consul_uri
=localhost:8500
by default--consul_key
=default
by default (which key to load configuration from)
--database
- Enable a mongodb database. Allows for logging and viewing workflow runs.
--mongodb_uri
=mongodb://localhost:27017
by default
$> opsilon
A customizable CLI for collaboratively running container-native workflows
Usage:
opsilon [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
list List all workflows available in your repositories
repo Operate on workflow repositories
run Run an available workflow
server Runs an api server that functions the same as the CLI
slack Runs opsilon as a socket-mode slack bot
version Displays opsilon version
Flags:
--config string config file (default is $HOME/.opsilon.yaml)
--consul Run using a Consul Key/Value store. This is for distributed installation.
--consul_key string Consul Config Key. Can be set using ENV variable. (default "default")
--consul_uri string Consul URI. Can be set using ENV variable. (default "localhost:8500")
--database Run using a MongoDB database.
-h, --help help for opsilon
--kubernetes Run in Kubernetes instead of Docker. You must be connected to a Kubernetes Context
--local Run using a local file as config. Not a database. True for CLI. (default true)
--mongodb_uri string Mongodb URI. Can be set using ENV variable. (default "mongodb://localhost:27017")
Use "opsilon [command] --help" for more information about a command.
Every contribution is welcome. Below is some information to help you get started.
- goreleaser with
deb.
and.rpm
package releasing - golangci-lint for linting and formatting
- Github Actions Stages (Lint, Test, Build, Release)
- Gitlab CI Configuration (Lint, Test, Build, Release)
- cobra CLI parser
- Makefile - with various useful targets and documentation (see Makefile Targets)
- Github Pages using jekyll-theme-minimal (checkout https://jatalocks.github.io/opsilon/)
- pre-commit-hooks for formatting and validating code before committing
- assets/ => docs
- cmd/ => commandline configurartions (flags, subcommands)
- pkg/ => the entrypoints of the CLI commands
- internal/ => packages that are the main core function of the project
tools/
=> for automatically shipping all required dependencies when runninggo get
(ormake bootstrap
) such asgolang-ci-lint
(see: https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module) )
$> make
bootstrap install build deps
build build golang binary
clean clean up environment
cover display test coverage
docker-build dockerize golang application
fmt format go files
help list makefile targets
install install golang binary
lint lint go files
pre-commit run pre-commit hooks
run run the app
test display test coverage
This project was made possible by https://github.com/FalcoSuessgott/golang-cli-template