mirror of
https://github.com/YunoHost/yunohost-ci.git
synced 2024-09-03 20:05:53 +02:00
Clean containers
This commit is contained in:
parent
2f1c10f977
commit
16c66d76a1
1 changed files with 27 additions and 7 deletions
22
prepare.sh
22
prepare.sh
|
@ -10,9 +10,29 @@ set -eo pipefail
|
||||||
# trap any error, and mark it as a system failure.
|
# trap any error, and mark it as a system failure.
|
||||||
trap "exit $SYSTEM_FAILURE_EXIT_CODE" ERR
|
trap "exit $SYSTEM_FAILURE_EXIT_CODE" ERR
|
||||||
|
|
||||||
|
clean_containers()
|
||||||
|
{
|
||||||
|
for image_to_delete in "yunohost-$DEBIAN_VERSION yunohost-$DEBIAN_VERSION-tmp"
|
||||||
|
do
|
||||||
|
if lxc info $image_to_delete &>/dev/null
|
||||||
|
then
|
||||||
|
lxc delete $image_to_delete --force
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for image_to_delete in "yunohost-$DEBIAN_VERSION-before-install yunohost-$DEBIAN_VERSION-before-postinstall yunohost-$DEBIAN_VERSION-after-postinstall"
|
||||||
|
do
|
||||||
|
if lxc image info $image_to_delete &>/dev/null
|
||||||
|
then
|
||||||
|
lxc image delete $image_to_delete
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
rebuild_base_container()
|
rebuild_base_container()
|
||||||
{
|
{
|
||||||
lxc info "yunohost-$DEBIAN_VERSION" >/dev/null && lxc delete "yunohost-$DEBIAN_VERSION" --force
|
clean_containers
|
||||||
|
|
||||||
lxc launch images:debian/$DEBIAN_VERSION/amd64 "yunohost-$DEBIAN_VERSION-tmp"
|
lxc launch images:debian/$DEBIAN_VERSION/amd64 "yunohost-$DEBIAN_VERSION-tmp"
|
||||||
lxc exec "yunohost-$DEBIAN_VERSION-tmp" -- sh -c "apt-get install curl -y"
|
lxc exec "yunohost-$DEBIAN_VERSION-tmp" -- sh -c "apt-get install curl -y"
|
||||||
# Install Git LFS, git comes pre installed with ubuntu image.
|
# Install Git LFS, git comes pre installed with ubuntu image.
|
||||||
|
|
Loading…
Reference in a new issue