mirror of
https://github.com/YunoHost/yunohost-ci.git
synced 2024-09-03 20:05:53 +02:00
fix prepare script
This commit is contained in:
parent
9c23d090fb
commit
e96a3cb528
4 changed files with 9 additions and 3 deletions
|
@ -30,7 +30,8 @@ start_container () {
|
|||
chmod 777 $current_dir/cache
|
||||
lxc config device add "$CONTAINER_IMAGE" cache-folder disk path=/cache source="$current_dir/cache"
|
||||
|
||||
lxc restart $CONTAINER_IMAGE
|
||||
lxc stop $CONTAINER_IMAGE || true
|
||||
lxc start $CONTAINER_IMAGE
|
||||
|
||||
wait_container $CONTAINER_IMAGE
|
||||
}
|
||||
|
|
2
run.sh
2
run.sh
|
@ -36,7 +36,7 @@ case ${2} in
|
|||
esac
|
||||
|
||||
|
||||
lxc exec "$CONTAINER_ID" /bin/bash < "${1}"
|
||||
lxc exec "$CONTAINER_IMAGE" /bin/bash < "${1}"
|
||||
if [ $? -ne 0 ]; then
|
||||
# Exit using the variable, to make the build as failure in GitLab
|
||||
# CI.
|
||||
|
|
5
utils.sh
5
utils.sh
|
@ -46,6 +46,11 @@ wait_container()
|
|||
if [ "$j" == "10" ]; then
|
||||
error 'Failed to access the internet'
|
||||
failstart=1
|
||||
lxc exec "$1" -- /bin/bash -c "echo 'resolv-file=/etc/resolv.dnsmasq.conf' > /etc/dnsmasq.d/resolvconf"
|
||||
lxc exec "$1" -- /bin/bash -c "echo 'nameserver 8.8.8.8' > /etc/resolv.dnsmasq.conf"
|
||||
lxc exec "$1" -- /bin/bash -c "sed -i 's/#IGNORE/IGNORE/g' /etc/default/dnsmasq"
|
||||
lxc exec "$1" -- /bin/bash -c "systemctl restart dnsmasq"
|
||||
lxc exec "$1" -- /bin/bash -c "journalctl -u dnsmasq -n 100 --no-pager"
|
||||
|
||||
restart_container "$1"
|
||||
fi
|
||||
|
|
|
@ -30,4 +30,4 @@ PROJECT_NAME="$CUSTOM_ENV_CI_PROJECT_NAME"
|
|||
# For example yunohost-buster-unstable
|
||||
BASE_IMAGE="yunohost-$DEBIAN_VERSION-$CURRENT_VERSION"
|
||||
|
||||
CONTAINER_IMAGE="$BASE_IMAGE-runner-$CUSTOM_ENV_CI_RUNNER_ID-project-$CUSTOM_ENV_CI_PROJECT_ID-concurrent-$CUSTOM_ENV_CI_CONCURRENT_PROJECT_ID"
|
||||
CONTAINER_IMAGE="$BASE_IMAGE-r-$CUSTOM_ENV_CI_RUNNER_ID-p-$CUSTOM_ENV_CI_PROJECT_ID-c-$CUSTOM_ENV_CI_CONCURRENT_PROJECT_ID"
|
Loading…
Reference in a new issue