A service management tool for local development.
python 3
pipenv
git clone git@gitlab.com:mega-mac-slice/stacky.git
cd stacky
make install
stacky --help
brew tap mega-mac-slice/tap && brew install stacky
A "Stacky File" is a json file in a project directory typically named .stacky.json that looks like:
{
"name": "dev-application",
"commands": {
"start": "make start",
"status": "make status"
},
"stack": [
"git@gitlab.com:mega-mac-slice/dev-postgres.git",
"git@gitlab.com:mega-mac-slice/dev-redis.git",
"git@gitlab.com:mega-mac-slice/dev-elasticsearch.git"
],
"extra": {
"kafka": [
"git@gitlab.com:mega-mac-slice/dev-fast-data-dev.git"
]
}
}
Where we defined some commands for the project itself and also the project's dependencies on postgres, redis and elasticsearch.
stacky start
This will do the following:
- Iterate through each dependency defined in stack and retrieve it if it doesn't already exist locally.
- For each dependency, check if it also has a .stacky.json and retrieve those dependencies defined in stack locally.
- For each dependency, check it's status and start it if needed.
With our example .stacky.json we would begin with:
dev-application \
.stacky.json
Makefile
And after running stacky start
would have the dependencies checked out locally adjacent to the project.
dev-application \
.stacky.json
Makefile
dev-postgres \
.stacky.json
dev-redis \
.stacky.json
dev-elasticsearch \
.stacky.json
stacky status
This will iterate through the dependencies and check it's status. Letting you know if the stack for your application is running.
> stacky status
[INFO] dev-application - ok
[INFO] dev-postgres - ok
[INFO] dev-redis - ok
[INFO] dev-elasticsearch - ok
stacky stop
This will iterate through the dependencies and stop them.
> stacky stop
[INFO] stopping | dev-elasticsearch
[INFO] stopping | dev-redis
[INFO] stopping | dev-postgres
stacky run command-name
Additional commands can be defined in commands and invoked with run.
> stacky run reset
[INFO] dev-postgres - ok
[INFO] dev-redis - ok
[INFO] dev-elasticsearch - ok
With the following possible results:
ok
- command existed and ran successfully.fail
- command existed and ran unsuccessfully.skip
- command did not exist.
stacky paths
Provides porcelain output of dependency paths intended for usage with external tools.
> stacky paths
/dev/src/dev-elasticsearch
/dev/src/dev-redis
/dev/src/dev-postgres
> stacky paths | xargs rm -rf
- ssh -
git@gitlab.com:mega-mac-slice/dev-postgres.git
- https -
https://gitlab.com/mega-mac-slice/dev-postgres.git