Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gepetto
dashboard
Commits
b491b7ff
Commit
b491b7ff
authored
Feb 12, 2018
by
Guilhem Saurel
Browse files
Image.update’s pull option
parent
e8920bae
Changes
1
Hide whitespace changes
Inline
Side-by-side
rainboard/models.py
View file @
b491b7ff
...
...
@@ -598,9 +598,11 @@ class Image(models.Model):
def
push
(
self
):
return
[
'docker'
,
'push'
,
self
.
get_image_name
()]
def
update
(
self
):
def
update
(
self
,
pull
=
False
):
image
=
check_output
([
'docker'
,
'images'
,
'-q'
,
self
.
get_image_name
()]).
decode
().
strip
()
if
not
image
:
if
not
pull
:
return
try
:
logger
.
info
(
f
' pulling
{
self
}
'
)
check_output
(
self
.
pull
())
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment