Commit 512a98ef authored by Antonio Terceiro's avatar Antonio Terceiro

Testbed updates now done asynchronously

parent fc611617
/data
/log/*
/public/doc/
/public/jquery*.js
/public/font-awesome/
......
create-testbed
\ No newline at end of file
......@@ -4,6 +4,7 @@ set -eu
base=$(readlink -f $(dirname $(readlink -f $0))/../..)
. $base/lib/environment.sh
. $base/lib/functions.sh
if [ $(whoami) != root ]; then
echo "E: This script must be run as root"
......@@ -119,4 +120,7 @@ if ! which schroot >/dev/null; then
exit 1
fi
log "Starting testbed setup"
setup_suite
log "Finished testbed setup"
echo '--------------------------------------------'
......@@ -45,14 +45,6 @@ touch -d '1 month ago' "${one_month_ago}"
run() {
if which update-testbed >/dev/null 2>/dev/null; then
log "I: Updating backend testbed"
update-testbed
else
log "W: Backend $debci_backend does not provide a way to update testbed!"
fi
log "I: Finished update of backend testbed"
log "I: building/updating chdist for $debci_suite"
debci-setup-chdist
......
......@@ -14,6 +14,18 @@ export debci_base_dir=$(readlink -f $(dirname $(readlink -f $0))/..)
prepare_args
mkdir -p "$debci_log_dir"
log="$debci_log_dir/debci-setup.log"
if [ ! -f "$log" ]; then
touch "$log"
user_group=$(stat -c %U:%G "${debci_log_dir}")
chown $user_group "$log"
fi
if which create-testbed >/dev/null 2>/dev/null; then
create-testbed
if [ -t 1 ]; then
create-testbed 2>&1 | tee --append "$log"
else
create-testbed >>$log 2>&1
fi
fi
21 */6 * * * debci [ -x /usr/share/debci/bin/debci-setup ] && sudo /usr/share/debci/bin/debci-setup
# vim: ft=crontab
......@@ -3,3 +3,4 @@ var/lib/debci/chroots usr/share/debci/chroots
var/lib/debci/gnupg usr/share/debci/gnupg
etc/debci usr/share/debci/config
usr/share/debci/bin/debci usr/bin/debci
var/log/debci usr/share/debci/log
......@@ -31,6 +31,11 @@ setup_system() {
mkdir /var/lib/debci/gnupg
chown debci:debci /var/lib/debci/gnupg
fi
if [ ! -d /var/log/debci ]; then
mkdir /var/log/debci
chown debci:debci /var/log/debci
fi
}
migrate_data() {
......
......@@ -123,6 +123,8 @@ debci_chroot_path="${debci_chroots_dir}/${debci_chroot_name}"
debci_bin_dir="${debci_base_dir}/bin"
debci_log_dir="${debci_base_dir}/log"
debci_user=$(stat -c %U "${debci_data_basedir}")
debci_uid=$(stat -c %u "${debci_data_basedir}")
......
......@@ -72,7 +72,7 @@ status_dir_for_package() {
log() {
if [ "$debci_quiet" = 'false' ]; then
echo "$@"
echo "$(date) $@"
fi
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment