forked from blallo/Feedati
FIX doit for docker/ subdirs
This commit is contained in:
parent
54bcd8dbb8
commit
46baadb8a1
2 changed files with 12 additions and 3 deletions
5
dodo.py
5
dodo.py
|
@ -5,7 +5,7 @@ from doit.tools import LongRunning
|
|||
|
||||
from dodo_utils import wait_net_service, wait_pgsql_db, \
|
||||
up2date_hasimage, up2date_anyimages, \
|
||||
run_task_func
|
||||
run_task_func, scan_dir
|
||||
|
||||
COMPOSE = 'docker-compose -p feedati'
|
||||
DOIT_CONFIG = {'default_tasks': ['up']}
|
||||
|
@ -17,8 +17,7 @@ def task_build():
|
|||
'uptodate': [up2date_anyimages],
|
||||
'file_dep': ['docker-compose.yml',
|
||||
'rss-bridge/Dockerfile',
|
||||
] + [os.path.join('docker', fname)
|
||||
for fname in os.listdir('docker')],
|
||||
] + list(scan_dir('docker')),
|
||||
'actions': [COMPOSE + ' build'],
|
||||
'clean': [run_task_func(task__build_rm),
|
||||
run_task_func(task__build_rmi)],
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import subprocess
|
||||
import time
|
||||
import os
|
||||
import fnmatch
|
||||
|
||||
from doit import loader
|
||||
|
||||
|
@ -105,3 +107,11 @@ def run_task_func(taskf):
|
|||
if tasks:
|
||||
fun.__doc__ = '\n'.join(t.doc for t in tasks)
|
||||
return fun
|
||||
|
||||
|
||||
def scan_dir(dirname, extension=None):
|
||||
if extension is None:
|
||||
extension = '*'
|
||||
for root, dirnames, filenames in os.walk(dirname):
|
||||
for fname in fnmatch.filter(filenames, extension):
|
||||
yield os.path.join(root, fname)
|
||||
|
|
Reference in a new issue