paz-sh / paz

An open-source, in-house service platform with a PaaS-like workflow, built on Docker, CoreOS, Etcd and Fleet. This repository houses the documentation and installation scripts.
http://paz.sh
Other
1.08k stars 56 forks source link

Split unit files up into chained steps #30

Open lukebond opened 9 years ago

lukebond commented 9 years ago

I picked up this tip from the Giantswarm guys.

Currently our unit files do docker pull, docker kill, docker run, docker stop etc. all in messy multi-line bash statements in one unit file. If we separate these into separate unit files, eg. one for pulling, one for starting, one for stopping, etc., and chain them together with systemd requires/after directives then it makes neater unit files as well as making it easier to insert steps in between, such as mounting an EBS volume, starting/connecting to a weave network, etc. It will also unroll on stop/kill and allow you to disconnect these things in reverse order.

rimusz commented 9 years ago

cool, it looks as a nice tip :+1:

tomgco commented 9 years ago

@lukebond Sounds good, do you have any examples lying around?

lukebond commented 8 years ago

This is described well by Timo at 13:49 here: https://www.youtube.com/watch?v=OeVMu-1Au78