Go to file
Will Sinatra f7c03fb1a7 regenerate scripts, add gogs setup based off gitea setup 2023-09-18 20:38:37 -04:00
Generated regenerate scripts, add gogs setup based off gitea setup 2023-09-18 20:38:37 -04:00
Tasks patch issues with package 2023-09-03 14:55:05 -04:00
Templates regenerate scripts, add gogs setup based off gitea setup 2023-09-18 20:38:37 -04:00
src add deps to make file, add loki server and promtail client templates/tasks 2023-07-07 20:46:46 -04:00
.gitignore note on gns3, some tasks/templates for setting up k3s nodes 2023-03-21 22:46:43 -04:00
LICENSE GPL 2023-03-29 19:53:20 -04:00
README.md correct readme usage example 2023-02-24 23:49:41 -05:00

README.md

What?

Verkos: (Esperanto) will compose

Verkos will compose your shell snippets into functional monolithic setup scripts!

Build

Deps:

nim, nimble
cd src
nimble install yaml
make build

Usage:

Verkos arguments

Generate a Verkos Template:

verkos new template Templates/example.yaml

Generate a Task Template:

verkos new task pkgs

Generate a script from a template:

verkos compose Templates/something.yaml

Writing a Task

Here's a simple example, really you just need a task to be a simple shell function.

pkgs() {
	apk add $1
}

You can source and use that snippet like this:

Script: Generated/example.sh
Shell: '#!/bin/ash'
Variables:
Tasks:
  - Path: Tasks/apk_pkgs
    Invo: 'pkgs "emacs htop tmux"'

And the resulting script should come out like this:

#!/bin/ash

pkgs() {
	apk add $1
}

pkgs "emacs htop tmux"

You can also include variables in your tasks. The same task could look like this:

pkgs() {
	apk add $packages
}

In your template file you'd then need to provide a variable with your packages:

Script: Generated/example.sh
Shell: '#!/bin/ash'
Variables:
  - Name: packages
    Value: "emacs htop tmux"
Tasks:
  - Path: Tasks/apk_pkgs
    Invo: apk_pkgs

And the resulting script should come out like this:

#!/bin/ash
packages="emacs htop tmux"

pkgs() {
	apk add $packages
}

pkgs

A very simple difference, but intermingling these two paradigms allows you to build either reusable tasks you can import ubiquitously, or more complicated tasks you can provide flexible configuration for easily.

TODO

- Some sort of lint/checker for the template & task files?
- A variable checker, so if a task has a $var that isn't defined it warns during generation
- Vault style secret substitutions, or post generation modifier