mirror of
https://github.com/YunoHost/yunohost-ci.git
synced 2024-09-03 20:05:53 +02:00
update image before running tests
This commit is contained in:
parent
24dde58b94
commit
e785931656
1 changed files with 22 additions and 2 deletions
20
prepare.sh
20
prepare.sh
|
@ -87,6 +87,24 @@ rebuild_base_container()
|
||||||
lxc delete "yunohost-$DEBIAN_VERSION-tmp"
|
lxc delete "yunohost-$DEBIAN_VERSION-tmp"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update_image() {
|
||||||
|
image_to_update=$1
|
||||||
|
|
||||||
|
# Start and run upgrade
|
||||||
|
lxc launch "$image_to_update" "$image_to_update-tmp"
|
||||||
|
lxc exec "$image_to_update-tmp" -- /bin/bash -c "apt-get update"
|
||||||
|
lxc exec "$image_to_update-tmp" -- /bin/bash -c "apt-get upgrade -y"
|
||||||
|
lxc stop "$image_to_update-tmp"
|
||||||
|
|
||||||
|
# Remove old image
|
||||||
|
lxc image delete "$image_to_update"
|
||||||
|
|
||||||
|
# Add new image updated
|
||||||
|
lxc publish "$image_to_update-tmp" --alias "$image_to_update"
|
||||||
|
|
||||||
|
lxc delete "$image_to_update-tmp"
|
||||||
|
}
|
||||||
|
|
||||||
start_container () {
|
start_container () {
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
@ -100,6 +118,8 @@ start_container () {
|
||||||
rebuild_base_container
|
rebuild_base_container
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
update_image "yunohost-$DEBIAN_VERSION-$SNAPSHOT_NAME"
|
||||||
|
|
||||||
lxc launch "yunohost-$DEBIAN_VERSION-$SNAPSHOT_NAME" "$CONTAINER_ID" 2>/dev/null
|
lxc launch "yunohost-$DEBIAN_VERSION-$SNAPSHOT_NAME" "$CONTAINER_ID" 2>/dev/null
|
||||||
|
|
||||||
mkdir -p ${currentDir}/cache
|
mkdir -p ${currentDir}/cache
|
||||||
|
|
Loading…
Reference in a new issue