opsilon

command module
v0.5.6-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

README

Opsilon

Test golangci-lint Go Report Card Go Reference codecov

A customizable CLI for collaboratively running container-native workflows

opsilon

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

Quickstart

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
$ helm install https://github.com/jatalocks/opsilon/releases/download/opsilon-0.4.2-helm/opsilon-0.4.2-helm.tgz

Usage

Make sure you have Docker installed on your computer (or connected to a kubernetes cluster --kubernetes).

EITHER

  1. 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
  1. List available workflows
$ opsilon list
  1. Run a workflow!
$ opsilon run # --kubernetes (kubernetes instead of docker)

OR

  1. Start the web server
$ opsilon server -p 8080 # See extra flags below
  1. List available API actions
$ Go to http://localhost:8080/api/v1/docs

OR

  1. Start the slack server
$ export SLACK_BOT_TOKEN=xoxb-123
$ export SLACK_APP_TOKEN=xapp-123
$ opsilon slack # See extra flags below
  1. Install the app from the manifest in Manifest
  2. Go to the Opsilon app in your slack
$ help

list repos - List Available Workflows
  Example: list
  Example: list myteam
  Example: list examples,myteam
run
Extra Flags

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

Demo

$> 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.

Contribution

Every contribution is welcome. Below is some information to help you get started.

Development Features
Project Layout
  • 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
Makefile Targets
$> 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
Thanks

This project was made possible by https://github.com/FalcoSuessgott/golang-cli-template

Documentation

Overview

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Directories

Path Synopsis
internal
db
get
pkg
run
web

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL