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
9947bb47
Commit
9947bb47
authored
Jul 31, 2017
by
syed-awais-ali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing the docker file output
parent
eb7ea504
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
util/parsefiles.py
+19
-8
No files found.
util/parsefiles.py
View file @
9947bb47
...
...
@@ -339,18 +339,29 @@ def _get_modified_dockerfiles(files, git_dir):
:return:
"""
items
=
set
()
print
files
candidate_files
=
{
f
for
f
in
DOCKER_PATH_ROOT
.
glob
(
"*/Dockerfile"
)}
for
f
in
files
:
file_path
=
pathlib2
.
Path
(
git_dir
,
f
)
if
file_path
in
candidate_files
:
items
.
add
(
_get_play_name_from_dockerfile
(
file_path
))
return
items
for
play
in
plays
:
dockerfile
=
pathlib2
.
Path
(
DOCKER_PATH_ROOT
,
play
,
"Dockerfile"
)
for
f
in
files
:
file_path
=
pathlib2
.
Path
(
git_dir
,
f
)
def
_get_play_name_from_dockerfile
(
path
):
if
file_path
in
dockerfile
:
items
.
add
(
_get_playbook_name_from_file
(
file_path
))
"""
Gets name of play from the filepath, which is
the directory preceeding occurence of the word "Dockerfile".
return
items
Input:
path: A path to the role
"""
# get individual parts of a file path
dirs
=
path
.
parts
# name of play is the preceeding part of the file path before "Dockerfile"
return
dirs
[
dirs
.
index
(
"Dockerfile"
)
-
1
]
def
arg_parse
():
...
...
@@ -411,7 +422,7 @@ if __name__ == '__main__':
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
)
modified_docer_files
=
_get_modified_dockerfiles
(
change_set
,
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