Project

seijaku

0.0
The project is in a healthy, maintained state
CLI tool ingesting YAML files to execute tasks on different shells with pre and post routines.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.3
~> 7.2
 Project Readme

Seijaku

Seijaku version

Seijaku is a program that allows you to execute shell commands listed in YAML payload files, ensuring that they are executed correctly. It includes a lightweight scheduler that will take care of executing payloads with specific delay between two executions.

Concepts

Payloads are YAML files that describe the various tasks Seijaku will have to perform (in order). Each task contains one or more steps.

A step is a shell command to be executed. Seijaku currently supports the following shells: bash, sh and ssh.

Each task can have "pre" and "post" tasks, for example to create and delete folders, or install and uninstall software needed to run a task.

A step sometimes needs variables in order to be performed correctly: Seijaku supports the direct definition of variables or from an environment variable of the shell running Seijaku.

A scheduler is a file listing payloads that must be executed with unique specifications: a name, a delay between two runs and the path to the concerned payload.

Example

name: my payload

ssh:
  - host: my-host
    user: user
    port: 22

variables:
  MY_VARIABLE: a static variable
  MY_ENV_VARIABLE: $MY_ENV_VARIABLE

tasks:
  - name: do something useful
    steps:
      - sh: echo "$MY_VARIABLE"		# "a static variable"
      - bash: echo "$MY_ENV_VARIABLE"	# given from executive shell

  - name: task with more settings
    pre:
      - sh: "do something before"
    steps:
      - sh: echo "$MY_VARIABLE"
        output: true
      - sh: echo "something" && exit 1
        soft_fail: true
    post:
      - sh: "do something after"
  
  - name: task with SSH executor
    host: my-host
    steps:
      - ssh: echo "executed on host"

Scheduler

name: my-scheduler

payloads:
  - payload: ./test/my-payload.yaml
    name: My test Payload
    every: 3600				# executed every hour

  - payload: ./test/another-payload.yaml
    name: Another payload
    every: 60				# executed every minute

Installation

Dependencies

  • Ruby 2.5+
  • Rubygem

Install Seijaku using Gem:

gem install seijaku

Usage

seijaku -h
seijaku -f ./my-payload.yaml # one-time payload execution
seijaku -s ./my-scheduler.yaml # recurrent payloads execution with delay