Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LakeDropsDrupalDev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
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
Docker
LakeDropsDrupalDev
Commits
48066a67
Commit
48066a67
authored
5 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
#33
Improve reset feature
parent
45a3d44e
No related branches found
Branches containing commit
Tags
1.9.0-rc12
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
run/scripts/update
+21
-29
21 additions, 29 deletions
run/scripts/update
with
21 additions
and
29 deletions
run/scripts/update
+
21
−
29
View file @
48066a67
#!/bin/bash
function
cleanup
{
NEWIMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/l3d/php-
${
PHP_VERSION
}
:
${
VERSION
}
|
head
-1
)
while
true
;
do
if
[[
$L3D_FORCE_UPDATE
-eq
1
]]
;
then
IMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/l3d/php-
${
PHP_VERSION
}
)
else
IMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/l3d/php-
${
PHP_VERSION
}
|
grep
-v
${
NEWIMAGEID
}
)
fi
if
[[
-n
${
IMAGEID
}
]]
;
then
while
true
;
do
ID
=
$(
docker container
ls
--all
-q
-f
ancestor
=
${
IMAGEID
}
)
if
[[
-n
${
ID
}
]]
;
then
echo
"Removing outdated container ..."
docker
kill
${
ID
}
>
/dev/null
docker
rm
${
ID
}
>
/dev/null
else
break
fi
done
if
[[
$L3D_FORCE_UPDATE
-eq
0
]]
;
then
echo
"Removing outdated image ..."
docker rmi
${
IMAGEID
}
>
/dev/null
fi
else
break
fi
done
IMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/node:8-jessie-slim
)
function
removecontainer
{
if
[[
"
$1
"
==
"selective"
]]
;
then
IMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/l3d/
$2
|
grep
-v
${
NEWIMAGEID
}
)
else
IMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/l3d/
$2
)
fi
if
[[
-n
${
IMAGEID
}
]]
;
then
while
true
;
do
ID
=
$(
docker container
ls
--all
-q
-f
ancestor
=
${
IMAGEID
}
)
if
[[
-n
${
ID
}
]]
;
then
echo
"Removing outdated
node
container ..."
echo
"Removing outdated container ..."
docker
kill
${
ID
}
>
/dev/null
docker
rm
${
ID
}
>
/dev/null
else
break
fi
done
if
[[
"
$1
"
==
"selective"
]]
;
then
echo
"Removing outdated image ..."
docker rmi
${
IMAGEID
}
>
/dev/null
fi
fi
}
function
cleanup
{
if
[[
$L3D_FORCE_UPDATE
-eq
1
]]
;
then
removecontainer all php-
${
PHP_VERSION
}
else
NEWIMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/l3d/php-
${
PHP_VERSION
}
:
${
VERSION
}
|
head
-1
)
removecontainer selective php-
${
PHP_VERSION
}
fi
removecontainer all node:8-jessie-slim
}
if
[[
-n
${
PHP_VERSION
}
]]
;
then
...
...
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