mirror of
https://github.com/YunoHost/yunohost-ci.git
synced 2024-09-03 20:05:53 +02:00
fix update container
This commit is contained in:
parent
777149191b
commit
9c23d090fb
4 changed files with 7 additions and 7 deletions
|
@ -9,7 +9,7 @@ do
|
|||
do
|
||||
for snapshot in "before-install" "after-install"
|
||||
do
|
||||
update_image $debian_version $ynh_version $snapshot
|
||||
update_container $debian_version $ynh_version $snapshot
|
||||
done
|
||||
done
|
||||
done
|
||||
|
@ -20,7 +20,7 @@ do
|
|||
do
|
||||
for snapshot in "before-install" "after-install"
|
||||
do
|
||||
update_image $debian_version $ynh_version $snapshot
|
||||
update_container $debian_version $ynh_version $snapshot
|
||||
done
|
||||
done
|
||||
done
|
||||
|
|
|
@ -12,7 +12,7 @@ trap "exit $SYSTEM_FAILURE_EXIT_CODE" ERR
|
|||
start_container () {
|
||||
if ! lxc info "$CONTAINER_IMAGE" >/dev/null 2>/dev/null ; then
|
||||
warn 'Container not found, copying it from the prebuilt image'
|
||||
if ! lxc image info "$BASE_IMAGE" &>/dev/null
|
||||
if ! lxc info "$BASE_IMAGE" &>/dev/null || ! lxc info "$BASE_IMAGE" | grep -q "$SNAPSHOT_NAME"
|
||||
then
|
||||
error "$BASE_IMAGE not found, please rebuild with rebuild_all.sh"
|
||||
# Inform GitLab Runner that this is a system failure, so it
|
||||
|
|
|
@ -30,7 +30,7 @@ do
|
|||
|
||||
lxc delete -f "yunohost-$debian_version-$ynh_version-$snapshot-tmp"
|
||||
|
||||
update_image $debian_version $ynh_version $snapshot
|
||||
update_container $debian_version $ynh_version $snapshot
|
||||
done
|
||||
done
|
||||
done
|
||||
|
|
6
utils.sh
6
utils.sh
|
@ -190,20 +190,20 @@ rebuild_base_containers()
|
|||
lxc stop "$base_image_to_rebuild"
|
||||
}
|
||||
|
||||
update_image() {
|
||||
update_container() {
|
||||
local debian_version=$1
|
||||
local ynh_version=$2
|
||||
local snapshot=$3
|
||||
local image_to_update="yunohost-$debian_version-$ynh_version-$snapshot"
|
||||
|
||||
if ! lxc image info "$image_to_update" &>/dev/null
|
||||
if ! lxc info "$image_to_update" &>/dev/null
|
||||
then
|
||||
error "Unable to upgrade image $image_to_update"
|
||||
return
|
||||
fi
|
||||
|
||||
# Start and run upgrade
|
||||
lxc launch "$image_to_update" "$image_to_update" -c security.nesting=true
|
||||
lxc restore "$image_to_update" "$snapshot"
|
||||
|
||||
wait_container "$image_to_update"
|
||||
|
||||
|
|
Loading…
Reference in a new issue