cookbook/container: example of building+running docker containers.
This got... long... and complicated. But I think it's a really good demonstration of getting redo to do complicated things elegantly. At least, I hope it is.
This commit is contained in:
parent
01497f55e9
commit
3923a7d3f8
38 changed files with 1375 additions and 7 deletions
13
docs/cookbook/container/default.gz.do
Normal file
13
docs/cookbook/container/default.gz.do
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
redo-ifchange "$2"
|
||||
|
||||
# On freebsd, 'gzip --rsyncable' fails but returns 0.
|
||||
# We have to detect lack of --rsyncable some other way.
|
||||
gzt=$(gzip --rsyncable -c </dev/null 2>/dev/null | wc -c)
|
||||
if [ "$gzt" -gt 0 ]; then
|
||||
# when available, --rsyncable makes compressed
|
||||
# files much more efficient to rsync when they
|
||||
# change slightly.
|
||||
gzip --rsyncable -c <$2 >$3
|
||||
else
|
||||
gzip -c <$2 >$3
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue