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
0fe7c953
Commit
0fe7c953
authored
5 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
#33
Improve reset feature
parent
39062079
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
run/scripts/reset
+3
-0
3 additions, 0 deletions
run/scripts/reset
run/scripts/selfupdate
+1
-0
1 addition, 0 deletions
run/scripts/selfupdate
run/scripts/update
+42
-33
42 additions, 33 deletions
run/scripts/update
with
46 additions
and
33 deletions
run/scripts/reset
+
3
−
0
View file @
0fe7c953
#!/bin/bash
echo
"Reset L3D container"
if
[[
-z
${
L3D_FORCE_UPDATE
}
]]
;
then
export
L3D_FORCE_UPDATE
=
1
fi
export
PHP_VERSION
=
7.0
/usr/local/bin/update
...
...
This diff is collapsed.
Click to expand it.
run/scripts/selfupdate
+
1
−
0
View file @
0fe7c953
...
...
@@ -21,4 +21,5 @@ fi
echo
"Self update to version
${
NEWVERSION
}
succeeded!"
export
VERSION
=
${
NEWVERSION
}
export
L3D_FORCE_UPDATE
=
0
/usr/local/bin/reset
This diff is collapsed.
Click to expand it.
run/scripts/update
+
42
−
33
View file @
0fe7c953
#!/bin/bash
if
[[
-n
${
PHP_VERSION
}
]]
;
then
IMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/l3d/php-
${
PHP_VERSION
}
|
head
-1
)
if
[[
!
-n
${
IMAGEID
}
]]
;
then
exit
fi
echo
"Updating the image ..."
STATUS
=
$(
docker pull registry.lakedrops.com/docker/l3d/php-
${
PHP_VERSION
}
:
${
VERSION
}
)
if
[[
"
$STATUS
"
==
*
"Status: Image is up to date"
*
]]
;
then
echo
"Already up to date"
else
echo
"Image updated"
NEWIMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/l3d/php-
${
PHP_VERSION
}
:
${
VERSION
}
|
head
-1
)
while
true
;
do
IMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/l3d/php-
${
PHP_VERSION
}
|
grep
-v
${
NEWIMAGEID
}
)
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
echo
"Removing outdated image ..."
docker rmi
${
IMAGEID
}
>
/dev/null
else
break
fi
done
IMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/node:8-jessie-slim
)
function
cleanup
{
NEWIMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/l3d/php-
${
PHP_VERSION
}
:
${
VERSION
}
|
head
-1
)
while
true
;
do
IMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/l3d/php-
${
PHP_VERSION
}
|
grep
-v
${
NEWIMAGEID
}
)
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
echo
"Removing outdated image ..."
docker rmi
${
IMAGEID
}
>
/dev/null
else
break
fi
done
IMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/node:8-jessie-slim
)
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 ..."
docker
kill
${
ID
}
>
/dev/null
docker
rm
${
ID
}
>
/dev/null
else
break
fi
done
fi
}
if
[[
-n
${
PHP_VERSION
}
]]
;
then
if
[[
$L3D_FORCE_UPDATE
-eq
1
]]
;
then
echo
"Force update"
cleanup
else
IMAGEID
=
$(
docker image
ls
-q
registry.lakedrops.com/docker/l3d/php-
${
PHP_VERSION
}
|
head
-1
)
if
[[
-z
${
IMAGEID
}
]]
;
then
exit
fi
echo
"Updating the image ..."
STATUS
=
$(
docker pull registry.lakedrops.com/docker/l3d/php-
${
PHP_VERSION
}
:
${
VERSION
}
)
if
[[
"
$STATUS
"
==
*
"Status: Image is up to date"
*
]]
;
then
echo
"Already up to date"
else
echo
"Image updated"
cleanup
fi
fi
fi
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