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
a475ab1d
Commit
a475ab1d
authored
5 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Ci upgrade
parent
500d5ba8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
publish_images.py
+14
-9
14 additions, 9 deletions
publish_images.py
with
15 additions
and
10 deletions
.gitlab-ci.yml
+
1
−
1
View file @
a475ab1d
...
...
@@ -17,7 +17,7 @@ before_script:
test
:
stage
:
test
script
:
-
git
diff-tree --no-commit-id --name-only -r HEAD
-
git
--no-pager diff --name-only origin/master
-
python publish_images.py -q
tags
:
-
docker
...
...
This diff is collapsed.
Click to expand it.
publish_images.py
+
14
−
9
View file @
a475ab1d
...
...
@@ -5,12 +5,15 @@ import sys
import
time
REGISTRY_URL
=
'
docker.km3net.de
'
SKIP_PUS
H
=
'
-
q
'
in
sys
.
argv
IS_TEST_BRANC
H
=
'
-
t
'
in
sys
.
argv
def
get_changed_dockerfiles
():
def
get_changed_dockerfiles
(
vs_master
=
False
):
"""
Checks the last Git commit and returns a list of changed Dockefiles
"""
diff_cmd
=
"
git diff-tree --no-commit-id --name-only -r HEAD
"
if
vs_master
:
diff_cmd
=
"
git --no-pager diff --name-only master
"
else
:
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
()
...
...
@@ -20,7 +23,7 @@ def get_changed_dockerfiles():
def
main
():
changed_dockerfiles
=
get_changed_dockerfiles
()
changed_dockerfiles
=
get_changed_dockerfiles
(
vs_master
=
IS_TEST_BRANCH
)
n_files
=
len
(
changed_dockerfiles
)
if
n_files
==
0
:
...
...
@@ -35,9 +38,9 @@ def main():
steps
=
[(
"
Building
"
,
"
docker build --pull -t {0}/{1} -f {1} .
"
.
format
(
REGISTRY_URL
,
fname
))]
if
not
SKIP_PUS
H
:
steps
.
append
(
(
"
Pushing
"
,
"
docker push {0}/{1}
"
.
format
(
REGISTRY_URL
,
fname
)))
if
not
IS_TEST_BRANC
H
:
steps
.
append
(
(
"
Pushing
"
,
"
docker push {0}/{1}
"
.
format
(
REGISTRY_URL
,
fname
)))
else
:
print
(
"
Skiping push...
"
)
...
...
@@ -45,8 +48,10 @@ def main():
for
step
,
cmd
in
steps
:
print
(
"
{} {}
'
{}
'"
.
format
(
progress
,
step
,
fname
))
child
=
sp
.
Popen
(
cmd
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
child
=
sp
.
Popen
(
cmd
,
shell
=
True
,
stdout
=
sys
.
stdout
,
stderr
=
sys
.
stderr
)
child
.
communicate
()
...
...
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