From faf0d7e1d7616c4af829c193d36c4427489a8062 Mon Sep 17 00:00:00 2001 From: ljf Date: Wed, 14 Apr 2021 19:33:29 +0200 Subject: [PATCH] [fix] Failed status borg__2 --- Vagrantfile | 37 +++++++++++++++++++++++++++++++++++++ ynh-dev | 24 ++++++++++++++++++------ 2 files changed, 55 insertions(+), 6 deletions(-) create mode 100755 Vagrantfile diff --git a/Vagrantfile b/Vagrantfile new file mode 100755 index 0000000..8b736a5 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,37 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +NETWORK = "10.0.3." + +HOSTS = { + "ynh-dev" => ["83", "ynh-dev"], + "compta" => ["85", "ynh-dev"], + "animafac" => ["86", "ynh-dev"], + "ynh-dev-buster" => ["84", "ynh-dev-buster"], +} + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + + # Force guest type, because YunoHost /etc/issue can't be tuned + config.vm.guest = :debian + + HOSTS.each do | (name, cfg) | + ipaddr, version = cfg + + config.vm.define name do |machine| + machine.vm.box = "yunohost/" + version + # Force guest type, because YunoHost /etc/issue can't be tuned + machine.vm.guest = :debian + + machine.vm.provider "lxc" do |lxc| + config.vm.box_url = "https://build.yunohost.org/" + version + "-lxc.box" + config.vm.synced_folder ".", "/ynh-dev", id: "vagrant-root" + config.vm.network :private_network, ip: NETWORK + ipaddr, lxc__bridge_name: 'lxcbr0' + end + end + end # HOSTS-each + +end diff --git a/ynh-dev b/ynh-dev index 50908e6..e7ac21b 100755 --- a/ynh-dev +++ b/ynh-dev @@ -124,8 +124,8 @@ function check_lxd_setup() || critical "You might want to add lxc and lxd inside /usr/local/bin so that there's no tricky PATH issue with sudo. If you installed lxd/lxc with snapd, this should do the trick: sudo ln -s /snap/bin/lxc /usr/local/bin/lxc && sudo ln -s /snap/bin/lxd /usr/local/bin/lxd" fi - ip a | grep -q lxdbr0 \ - || critical "There is no 'lxdbr0' interface... Did you ran 'lxd init' ?" + ip a | grep -q lx[cd]br0 \ + || critical "There is no 'lxcbr0' or 'lxdbr0' interface... Did you ran 'lxd init' ?" } function start_ynhdev() @@ -212,10 +212,16 @@ function show_vm_ip() function use_git() { assert_inside_vm - local PACKAGES="$@" - for PACKAGE in "$PACKAGES"; + local PACKAGES=("$@") + + if [ "$PACKAGES" = "" ] + then + PACKAGES=('moulinette' 'ssowat' 'yunohost' 'yunohost-admin') + fi + + for i in ${!PACKAGES[@]}; do - case $PACKAGE in + case ${PACKAGES[i]} in ssowat) create_sym_link "/ynh-dev/ssowat" "/usr/share/ssowat" success "Now using Git repository for SSOwat" @@ -230,6 +236,9 @@ function use_git() # bin create_sym_link "/ynh-dev/yunohost/bin/yunohost" "/usr/bin/yunohost" create_sym_link "/ynh-dev/yunohost/bin/yunohost-api" "/usr/bin/yunohost-api" + create_sym_link "/ynh-dev/yunohost/bin/yunoprompt" "/usr/bin/yunoprompt" + create_sym_link "/ynh-dev/yunohost/bin/yunopaste" "/usr/bin/yunopaste" + create_sym_link "/ynh-dev/yunohost/sbin/yunohost-reset-ldap-password" "/usr/sbin/yunohost-reset-ldap-password" # data create_sym_link "/ynh-dev/yunohost/data/bash-completion.d/yunohost" "/etc/bash_completion.d/yunohost" @@ -307,6 +316,9 @@ function use_git() warn "-------------------------------------------------------- " su ynhdev -c "./node_modules/gulp/bin/gulp.js watch --dev" + ;; + *) + error "Invalid package '${PACKAGES[i]}': correct arguments are 'yunohost', 'ssowat', 'moulinette', 'yunohost-admin' or nothing for all" ;; esac done @@ -367,4 +379,4 @@ function run_tests() done } -main "$@" +main $@