Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
eb7ea504
Commit
eb7ea504
authored
Jul 27, 2017
by
syed-awais-ali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add modified dockerfiles to the list of plays
parent
6a3342cc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
util/parsefiles.py
+26
-0
No files found.
util/parsefiles.py
View file @
eb7ea504
...
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment