Restart containers in Docker Executor? like `docker-compose down; docker-compose up -d`?


#1

Is it possible to restart containers in the Docker Executor?

The use-case is for resetting all datastores to a clean slate for integration testing. Rather than writing code to delete queues from rabbitmq, databases from postgres, keys from redis, indexes from ES, etc… it would be easier to do what we do with docker-compose, and just do a down and up to restart all services with a clean slate.

Any suggestions?


#2

You could use different jobs, share the artifacts between them and start the jobs sequentially inside a workflow.


#3

That works if you have like a 1 or 2 test cases (like smoke tests perhaps), but for a complex application with many features that interact with and “dirty” the databases with state that needs to be discarded, that’s not feasible.


#4

Just wondering, anyone from Circle can comment on this?


#5