Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Dockerfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aart Heijboer
Dockerfiles
Commits
235246de
Commit
235246de
authored
6 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Use shell instead of gitpython
parent
80d58f4e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
publish_images.py
+12
-6
12 additions, 6 deletions
publish_images.py
with
12 additions
and
6 deletions
publish_images.py
+
12
−
6
View file @
235246de
...
...
@@ -4,16 +4,22 @@ import subprocess as sp
import
sys
import
time
import
git
REGISTRY_URL
=
'
docker.km3net.de
'
def
get_changed_dockerfiles
():
"""
Checks the last Git commit and returns a list of changed Dockefiles
"""
diff_cmd
=
"
git diff-tree --no-commit-id --name-only -r HEAD
"
child
=
sp
.
Popen
(
diff_cmd
,
shell
=
True
,
stdout
=
sp
.
PIPE
,
stderr
=
sp
.
PIPE
)
out
,
_
=
child
.
communicate
()
changed_files
=
[
l
.
decode
().
rstrip
()
for
l
in
out
.
split
(
b
'
\n
'
)]
changed_dockerfiles
=
[
f
for
f
in
changed_files
if
f
.
startswith
(
"
base/
"
)]
return
changed_dockerfiles
def
main
():
changed_dockerfiles
=
[
f
.
a_path
for
f
in
git
.
Repo
(
'
.
'
).
index
.
diff
(
"
HEAD~1
"
)
if
f
.
a_path
.
startswith
(
"
base/
"
)
]
changed_dockerfiles
=
get_changed_dockerfiles
()
n_files
=
len
(
changed_dockerfiles
)
if
n_files
==
0
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment