Elders
Enable you to run your command line tasks in containers.
Usage
Task
# Create a new task
# Params are `name`, `image` and `command`
task = Elder::Task.new 'sample', 'ruby', 'ruby'
# Start the task passing params to the command and ENV variables
task.start '-v'
# Wait until the task is finished
sleep 1
# Return it results
task.logs
# Remove the docker container used in this operation
task.clean
TODO
- Enable more options to the task (like
links
,volumes
,network
). - Create a method
:wait
for theElders::Task
, this will block the main thread until the task is completed. - Doc the
Elders::Stack
usage.
Development
- Running tests:
- Build the Docker image:
docker build -t elders .
- Run the RSpec:
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock elders bundle exec rspec
- Build the Docker image:
Extra
Interactive mode in the conteiner.
docker run --rm -it -v (PWD):/elders -v /var/run/docker.sock:/var/run/docker.sock elders /bin/bash