Skip to main content

write shell in sh.yml

Project description

Sometimes gnu make reminds me how old I am, shyml makes me feel like a baby again.

Getting started

Install with pip install shyml. Add

The shyml command will look for a file called sh.yml in the current directory and list the jobs it finds. It will merge them with the default jobs that are in the repository root and open for contributions ;)

Write your sh.yml file as such for example:

---
name: example
color: red          # yes, you can choose the color of your job
requires: other_job # disregard for now, it's for when your sh.yml grows up
script:
- myvar=x
- some
     --super
     --long=$myvar
     line

---
name: setup
hook: before jobs   # this will always execute before any job
script: |
  something cool
env:
  someglobal: foo

You see, we have hooks, choosing colors to jobs (I choose so far: green for non-writing, orange for writing, red for destructive), or doing super long lines of shell commands without backslashes at the end are typically the kind of things that make me feel like a baby again.

Without argument, shyml will just print out all jobs it finds.

With an argument that matches a defined job, it will just output the generated shell script, you can pipe it to a shell if you want to execute it:

shyml                       # lists jobs
shyml jobname               # print a job in bash
shyml jobname | bash -eux   # run a job in a local bash shell

Then you could see your generated bash with shyml example and execute it with shyml example | docker run -it yourcontainer sh or something.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shyml-0.6.4.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file shyml-0.6.4.tar.gz.

File metadata

  • Download URL: shyml-0.6.4.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.6

File hashes

Hashes for shyml-0.6.4.tar.gz
Algorithm Hash digest
SHA256 6ded652cd85fb3f7eb45546f03dec7e694b6b3a6e7fa63fa5f760659c0aa6d39
MD5 d40ea0ec68784ca5ad0cc949550d214d
BLAKE2b-256 7d4c11491166874a10198c590fc04d4a8d29f126c618e67dd9277106d5188768

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page