Commit eb7ea504 by syed-awais-ali

add modified dockerfiles to the list of plays

parent 6a3342cc
......@@ -330,6 +330,29 @@ def _get_role_name(role):
LOGGER.warning("role %s could not be resolved to a role name." % role)
return None
def _get_modified_dockerfiles(files, git_dir):
"""
Return Playbooks whose dockerfile has been changed/modified
:param files:
:param git_dir:
:return:
"""
items = set()
for play in plays:
dockerfile = pathlib2.Path(DOCKER_PATH_ROOT, play, "Dockerfile")
for f in files:
file_path = pathlib2.Path(git_dir, f)
if file_path in dockerfile:
items.add(_get_playbook_name_from_file(file_path))
return items
def arg_parse():
parser = argparse.ArgumentParser(description = 'Given a commit range, analyze Ansible dependencies between roles and playbooks '
......@@ -387,5 +410,8 @@ if __name__ == '__main__':
# filter out docker plays without a Dockerfile
docker_plays = filter_docker_plays(docker_plays, TRAVIS_BUILD_DIR)
# Add playbooks to the list whose docker file has been modified
modified_docer_files = _get_modified_dockerfiles(docker_plays, TRAVIS_BUILD_DIR)
# prints Docker plays
print " ".join(str(play) for play in docker_plays)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment