Skip to content

Instantly share code, notes, and snippets.

@antdking
Created February 22, 2019 14:21
Show Gist options
  • Save antdking/f066eec711c3b9d20225a3259fde77fc to your computer and use it in GitHub Desktop.
Save antdking/f066eec711c3b9d20225a3259fde77fc to your computer and use it in GitHub Desktop.
an example of compose tasks

here we have a very basic example of a compose task.

The concept is you can define tasks, and tasks can link to one another.

container dependence will be respected, so in this case before running app, the db will be launched. Tasks can depend on one another, so in this case before app test is run, db launch will be run.

version: "3.7"
services:
app:
build: .
depends_on:
- db
x-tasks:
test:
depends_on: db launch
command: bundle exec rspec
db:
build: db
x-tasks:
launch: |
# whatever command for waiting for db to be ready
echo "waiting for db"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment