Minimalistic template for modular development from Siberia with love
SiberianSeed is probably the simpliest template ever.
git clone https://github.com/ilya-khaustov/siberianseed.git myApp && cd myApp
sudo ./seed --new myApp --owner $(whoami)
Name your project and set a project owner.echo 'printf "Hello world!";' > bin/hello.sh
Create a task.myApp hello
Execute a task.
mkdir bin/say
echo 'printf "Bye $root!";' > bin/say/bye.sh
Variable$root
is predefined. It contains absolute path of a project.myApp say /bye
Slash-prefixed argument executes frombin
subdirectory given as previous non-prefixed argument.myApp hello say /bye
Execute a sequence.myApp say /bye hello
Omit slash and execute directly frombin
.mv bin/hello.sh bin/say/hello.sh
myApp say /hello /bye
This way it looks more consistent.
--new <project_shortcut>
Creates shortcut for system-wide access.--owner <user>
Sets owner for shortcut file and other project files.--name <project_shortcut> [<task> [/<subtask> ... ] ... ]
Alternative way of executing tasks, e.g. when creating system-wide shortcut is not allowed.
root
Seed-project path.userpwd
PWD whereseed
script was called.
- Type
. myApp
andcd
to project root directory. myApp
redirects arguments to theseed
script with additional--name
argument. Executing./seed --name myApp
from a project root is exactly the same asmyApp
.- Task name can include spaces.
myApp 'make a sandwich'
looks formake a sandwich.sh
file inside abin
directory. - If project is moved to another directory the
seed
shortcut (myApp
in this README) stops working. Executesudo ./seed --new myApp --owner $(whoami)
once again to fix it. - Tasks from a sequence are executed inside their child processes and can't interact with each other using shell variables or pipes. Tasks are supposed to interact through
share
directory. It is auto-created if not found on every task run. Save temporary data like logs, pid files or exported distributions insideshare
and access it later in subsequent tasks. - Pay attention to the
--owner
argument. It is strongly discouraged to makeroot
a project owner. First, it is unsafe to run software likebower
ornpm
with root privelegies. Second, files and folders created or processes started by root cause access errors when running tasks as a non-root user. Set project owner wisely to save your time and stay secure. - Use shebangs in tasks.
You could probably notice a bunch of files in the bin
directory. Don't worry - they are only examples and seed
doesn't depend on them. You can delete them in any moment if you feel right about it.
This README is as basic as it can be to keep things simple and decisions unbiased. However, if you would like to know more about developing practices, you are welcome to explore and use existing tasks.