/sampo

Primary LanguageShellMIT LicenseMIT

sampo
A shell script API server for running your shell scripts.

joukahainen:~$ curl -i http://localhost:1042/echo/rusty-fork
HTTP/1.1 200 OK
Date: Sun, 06 Sep 2020 16:54:45 UTC
Version: HTTP/1.1
Accept: text/plain
Accept-Language: en-US
Server: sampo/1.0.0
Content-Type: text/plain

rusty-fork

How It Works

The sampo Kubernetes Deployment runs a sampo container, which is running a shell script that processes your API calls. Each endpoint can call any arbitrary shell code.

You can run sampo directly in your shell, but it works best in Kubernetes.

Details

Details can be found on this blog post.

Developing/testing

If you want to test this out yourself, you can. I run it on Kubernetes in Docker for Mac, but the instructions should basically be the same:

git clone https://github.com/jacobsalmela/sampo.git
cd sampo/
kubectl create -f sampo/

Testing changes

I use a simple build script to delete my current deployment, re-deploy it, and set up port forwarding (this all assumes local development on Docker for Mac). Then I just run:

./build.sh

I currently use bats-core in the script. It doesn't work all that well, but it's a nice indicator if something is immediately wrong.