From 9b2dde7dd4b4b4be2cc3cf6c73f295304b828d2c Mon Sep 17 00:00:00 2001 From: ljf Date: Fri, 10 Aug 2018 00:45:37 +0200 Subject: [PATCH 01/13] [enh] Add vagrant-lxc support --- ynh-dev | 59 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/ynh-dev b/ynh-dev index fe028f0..5a02e91 100755 --- a/ynh-dev +++ b/ynh-dev @@ -1,5 +1,8 @@ #!/bin/bash +DEFAULT_VERSION="stretch-unstable" +DEFAULT_PROVIDER="lxc" + usage() { cat < /dev/null || { - IP="${IP_BASE}$i" + IP="$i" break } done # Update Vagrantfile - grep "### END AUTOMATIC YNH-DEV ###" ./Vagrantfile &> /dev/null || { + grep "### END AUTOMATIC YNH-DEV" ./Vagrantfile &> /dev/null || { pushd ./vagrant &> /dev/null git pull popd &> /dev/null @@ -167,22 +171,19 @@ elif [ "$1" = "run" ]; then } # Adapt vagrantfile - perl -i -pe "s| (### END AUTOMATIC YNH-DEV ###)|\ - config.vm.define \"${VMNAME}\" do \|${VMNAME}\| \ -\n ${VMNAME}.vm.box = \"${BOX_NAME}\" \ -\n ${VMNAME}.vm.network :private_network, ip: \"${IP}\" \ -\n end \ -\n \1|" ./Vagrantfile + perl -i -pe "s| (### END AUTOMATIC YNH-DEV ZONE ###)|\ + \"${VMNAME}\" => [\"$IP\", \"${VERSION}\"], \ +\n \1|" ./Vagrantfile } # Run VM - vagrant up $VMNAME --provider virtualbox + vagrant up $VMNAME --provider $PROVIDER # Warn user about hosts file - IP_LINE="[[:space:]]*${VMNAME}.vm.network[[:space:]]*:private_network,[[:space:]]*ip:[[:space:]]*\"" - IP=$(grep "$IP_LINE" Vagrantfile | sed "s/${IP_LINE}//" | tr -d '"') - echo "/!\ Please add '$IP $DOMAIN' to your /etc/hosts file /!\\" - echo "sudo bash -c 'echo \"$IP $DOMAIN\" >> /etc/hosts'" + IP_LINE="[[:space:]]*\"${VMNAME}\"[[:space:]]*=>[[:space:]]*\[\"\K.*?(?=\", \"${VERSION}\"\],)" + IP=$(grep -Po "$IP_LINE" ./Vagrantfile ) + echo "/!\ Please add '$IP_BASE$IP $DOMAIN' to your /etc/hosts file /!\\" + echo "sudo bash -c 'echo \"$IP_BASE$IP $DOMAIN\" >> /etc/hosts'" echo "" # Log into the VM From 7bff693e8583fde5de18bbb584b8a1da3a5089c5 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 3 Sep 2018 23:01:08 +0200 Subject: [PATCH 02/13] Zblerg --- ynh-dev | 477 +++++++++++++++++++++++--------------------------------- 1 file changed, 193 insertions(+), 284 deletions(-) diff --git a/ynh-dev b/ynh-dev index 5a02e91..19dbf98 100755 --- a/ynh-dev +++ b/ynh-dev @@ -1,383 +1,292 @@ #!/bin/bash -DEFAULT_VERSION="stretch-unstable" -DEFAULT_PROVIDER="lxc" +readonly THISSCRIPT=`basename $0` -usage() { +function show_usage() { cat <&1 +} + +function error() +{ + local msg=${1} + echo "[${BOLD}${RED}FAIL${NORMAL}] ${msg}" 2>&1 +} + +function critical() +{ + local msg=${1} + echo "[${BOLD}${RED}CRIT${NORMAL}] ${msg}" 2>&1 + exit 1 +} + +function assert_inside_vm() { + [ -d /etc/yunohost ] || critical "There's no YunoHost in there. Are you sure that you are inside the LXC ?" +} + +function create_sym_link() { + local DEST=$1 + local LINK=$2 # Remove current sources if not a symlink - if [ ! -L '$2' ]; then - sudo rm -rf $2 - fi + [ -L "$LINK" ] || sudo rm -rf $LINK # Symlink from Git repository - sudo ln -sfn $1 $2 + sudo ln -sfn $DEST $LINK } -packages=${@:2} -if [ "$#" = "1" ]; then - packages=('moulinette' 'ssowat' 'yunohost' 'yunohost-admin') -fi +################################################################## +# Actions # +################################################################## -BASE_DIR=./ -IP_BASE="192.168.33." - -################## -## Help message ## -################## -if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ "$1" = "help" ]; then - usage - - -###################################### -## Create a development environment ## -###################################### -elif [ "$1" = "create-env" ]; then - set -x - - pwd=`pwd` - - if [ ! "$2" ] - then - echo "I need a destination folder to create the dev environement" - exit 1 - fi - - [ -e "$2" ] || mkdir -p $2 - cd $2 - - # Create apps & backup folder - mkdir -p apps - mkdir -p backup - - # Get YunoHost packages - git clone -b unstable https://github.com/YunoHost/SSOwat ssowat - git clone -b unstable https://github.com/YunoHost/yunohost-admin yunohost-admin - git clone -b unstable https://github.com/YunoHost/yunohost yunohost - git clone -b unstable https://github.com/YunoHost/moulinette moulinette - - # Get YunoHost Vagrantfile - git clone -b master https://github.com/YunoHost/Vagrantfile vagrant - ln -s vagrant/Vagrantfile Vagrantfile - - # Get YunoHost dev tools - git clone -b master https://github.com/YunoHost/ynh-dev ynh-dev-tools - cp ynh-dev-tools/ynh-dev ynh-dev - - -########################################## -## Run a vm/container and give a prompt ## -########################################## -elif [ "$1" = "run" ]; then - if [[ $2 == *"-"* ]]; then - echo "ERROR: Vagrant virtual machine ($2) cannot contain any dash" - exit 2 - fi - - DOMAIN=$2 - VERSION=$DEFAULT_VERSION - if [ "$#" = "3" ]; then - VERSION=$3 - if [ "$VERSION" = "unstable" ]; then - VERSION="jessie-unstable" - fi - - if [ "$VERSION" = "unstable" ]; then - echo "ERROR: Incorrect version '$VERSION'. See '$(basename $0) --help' for usage." - exit 102 - fi - fi - PROVIDER=$DEFAULT_PROVIDER - - - echo "Creating $DOMAIN virtual machine with YunoHost $VERSION version" - echo "" - - BOX_NAME="yunohost/$VERSION" - BOX_URL="https://build.yunohost.org/yunohost-$BOX_NAME-$PROVIDER.box" +function start_ynhdev() +{ + BOX_NAME="yunohost/strech-unstable" + BOX_URL="https://build.yunohost.org/yunohost-$BOX_NAME-lxc.box" # Download box if not available if ! vagrant box list | grep -qc $BOX_NAME ; then - echo "Vagrant box '$BOX_NAME' is missing. Trying to download it" + info "Vagrant box '$BOX_NAME' is missing. Trying to download it" vagrant box add $BOX_NAME $BOX_URL --provider $PROVIDER - echo "" fi - # Deduce the vm name - VMNAME=${DOMAIN//./_} - - - # Add the vm vagrant config in Vagrantfile - vagrant status $VMNAME &> /dev/null || { - - # Find an available ip - for i in `seq 2 254`; - do - grep "${IP_BASE//./\.}$i" Vagrantfile &> /dev/null || { - IP="$i" - break - } - done - - # Update Vagrantfile - grep "### END AUTOMATIC YNH-DEV" ./Vagrantfile &> /dev/null || { - pushd ./vagrant &> /dev/null - git pull - popd &> /dev/null - rm ./Vagrantfile - ln -s vagrant/Vagrantfile Vagrantfile - - } - - # Adapt vagrantfile - perl -i -pe "s| (### END AUTOMATIC YNH-DEV ZONE ###)|\ - \"${VMNAME}\" => [\"$IP\", \"${VERSION}\"], \ -\n \1|" ./Vagrantfile - } - # Run VM - vagrant up $VMNAME --provider $PROVIDER - - # Warn user about hosts file - IP_LINE="[[:space:]]*\"${VMNAME}\"[[:space:]]*=>[[:space:]]*\[\"\K.*?(?=\", \"${VERSION}\"\],)" - IP=$(grep -Po "$IP_LINE" ./Vagrantfile ) - echo "/!\ Please add '$IP_BASE$IP $DOMAIN' to your /etc/hosts file /!\\" - echo "sudo bash -c 'echo \"$IP_BASE$IP $DOMAIN\" >> /etc/hosts'" - echo "" + vagrant up ynh-dev --provider lxc # Log into the VM - vagrant ssh $VMNAME -c "sudo -i" + vagrant ssh ynh-dev -c "sudo -i" +} +function ssh_ynhdev() +{ + vagrant ssh ynh-dev -c "sudo -i" +} -##################### -## Kill running VM ## -##################### -elif [ "$1" = "kill" ]; then - vagrant destroy +function destroy_ynhdev() +{ + vagrant destroy ynh-dev +} - -####################### -## Update current VM ## -####################### -elif [ "$1" = "upgrade" ]; then - check_yunohost_vm - sudo apt-get update - sudo apt-get -y upgrade - sudo apt-get -y dist-upgrade - - -####################### -## Get current VM IP ## -####################### -elif [ "$1" = "ip" ]; then - check_yunohost_vm +function show_vm_ip() +{ + assert_inside_vm # Print IP ip=$(/bin/ip a | grep 'inet 192.168' | awk -F " " '{print $2}' | awk -F "/" '{print $1}') echo "IP: $ip" +} - -########################################### -## Use Git version for YunoHost packages ## -########################################### -elif [ "$1" = "use-git" ]; then - check_yunohost_vm - VERSION=$2 - - for i in ${!packages[@]}; do - case ${packages[i]} in +function use_git() +{ + assert_inside_vm + local PACKAGES="$@" + for PACKAGE in "$PACKAGES"; + do + case $PACKAGE in ssowat) - echo "Using Git repository for SSOwat" - create_sym_link "/vagrant/ssowat" "/usr/share/ssowat" - echo "↳ Don't forget to do 'sudo yunohost app ssowatconf' when hacking SSOwat" - echo "" + create_sym_link "/ynh-dev/ssowat" "/usr/share/ssowat" + success "Now using Git repository for SSOwat" ;; moulinette) - create_sym_link "/vagrant/moulinette/locales" "/usr/share/moulinette/locale" - create_sym_link "/vagrant/moulinette/moulinette" "/usr/lib/python2.7/dist-packages/moulinette" - echo "" + create_sym_link "/ynh-dev/moulinette/locales" "/usr/share/moulinette/locale" + create_sym_link "/ynh-dev/moulinette/moulinette" "/usr/lib/python2.7/dist-packages/moulinette" + success "Now using Git repository for Moulinette" ;; yunohost) - echo "Using Git repository for yunohost" # bin - create_sym_link "/vagrant/yunohost/bin/yunohost" "/usr/bin/yunohost" - create_sym_link "/vagrant/yunohost/bin/yunohost-api" "/usr/bin/yunohost-api" + create_sym_link "/ynh-dev/yunohost/bin/yunohost" "/usr/bin/yunohost" + create_sym_link "/ynh-dev/yunohost/bin/yunohost-api" "/usr/bin/yunohost-api" # data - create_sym_link "/vagrant/yunohost/data/bash-completion.d/yunohost" "/etc/bash_completion.d/yunohost" - create_sym_link "/vagrant/yunohost/data/actionsmap/yunohost.yml" "/usr/share/moulinette/actionsmap/yunohost.yml" - create_sym_link "/vagrant/yunohost/data/hooks" "/usr/share/yunohost/hooks" - create_sym_link "/vagrant/yunohost/data/templates" "/usr/share/yunohost/templates" - create_sym_link "/vagrant/yunohost/data/helpers" "/usr/share/yunohost/helpers" - create_sym_link "/vagrant/yunohost/data/helpers.d" "/usr/share/yunohost/helpers.d" - create_sym_link "/vagrant/yunohost/data/other" "/usr/share/yunohost/yunohost-config/moulinette" + create_sym_link "/ynh-dev/yunohost/data/bash-completion.d/yunohost" "/etc/bash_completion.d/yunohost" + create_sym_link "/ynh-dev/yunohost/data/actionsmap/yunohost.yml" "/usr/share/moulinette/actionsmap/yunohost.yml" + create_sym_link "/ynh-dev/yunohost/data/hooks" "/usr/share/yunohost/hooks" + create_sym_link "/ynh-dev/yunohost/data/templates" "/usr/share/yunohost/templates" + create_sym_link "/ynh-dev/yunohost/data/helpers" "/usr/share/yunohost/helpers" + create_sym_link "/ynh-dev/yunohost/data/helpers.d" "/usr/share/yunohost/helpers.d" + create_sym_link "/ynh-dev/yunohost/data/other" "/usr/share/yunohost/yunohost-config/moulinette" # debian - create_sym_link "/vagrant/yunohost/debian/conf/pam/mkhomedir" "/usr/share/pam-configs/mkhomedir" + create_sym_link "/ynh-dev/yunohost/debian/conf/pam/mkhomedir" "/usr/share/pam-configs/mkhomedir" # lib - create_sym_link "/vagrant/yunohost/lib/metronome/modules/ldap.lib.lua" "/usr/lib/metronome/modules/ldap.lib.lua" - create_sym_link "/vagrant/yunohost/lib/metronome/modules/mod_auth_ldap2.lua" "/usr/lib/metronome/modules/mod_auth_ldap2.lua" - create_sym_link "/vagrant/yunohost/lib/metronome/modules/mod_legacyauth.lua" "/usr/lib/metronome/modules/mod_legacyauth.lua" - create_sym_link "/vagrant/yunohost/lib/metronome/modules/mod_storage_ldap.lua" "/usr/lib/metronome/modules/mod_storage_ldap.lua" - create_sym_link "/vagrant/yunohost/lib/metronome/modules/vcard.lib.lua" "/usr/lib/metronome/modules/vcard.lib.lua" + create_sym_link "/ynh-dev/yunohost/lib/metronome/modules/ldap.lib.lua" "/usr/lib/metronome/modules/ldap.lib.lua" + create_sym_link "/ynh-dev/yunohost/lib/metronome/modules/mod_auth_ldap2.lua" "/usr/lib/metronome/modules/mod_auth_ldap2.lua" + create_sym_link "/ynh-dev/yunohost/lib/metronome/modules/mod_legacyauth.lua" "/usr/lib/metronome/modules/mod_legacyauth.lua" + create_sym_link "/ynh-dev/yunohost/lib/metronome/modules/mod_storage_ldap.lua" "/usr/lib/metronome/modules/mod_storage_ldap.lua" + create_sym_link "/ynh-dev/yunohost/lib/metronome/modules/vcard.lib.lua" "/usr/lib/metronome/modules/vcard.lib.lua" # src - create_sym_link "/vagrant/yunohost/src/yunohost" "/usr/lib/moulinette/yunohost" + create_sym_link "/ynh-dev/yunohost/src/yunohost" "/usr/lib/moulinette/yunohost" # locales - create_sym_link "/vagrant/yunohost/locales" "/usr/lib/moulinette/yunohost/locales" + create_sym_link "/ynh-dev/yunohost/locales" "/usr/lib/moulinette/yunohost/locales" + + success "Now using Git repository for YunoHost" - echo "" ;; yunohost-admin) - # Trick to check vagrant user exists (for install on VPS..) - getent passwd vagrant > /dev/null + getent passwd ynhdev > /dev/null if [ $? -eq 2 ]; then - useradd vagrant - chown -R vagrant: /vagrant/yunohost-admin + useradd ynhdev + chown -R ynhdev: /ynh-dev/yunohost-admin fi # Install npm dependencies if needed which gulp > /dev/null if [ $? -eq 1 ] then - release=$(lsb_release -c | cut -d ":" -f 2 | sed 's/\s*//') + info "Installing dependencies to develop in yunohost-admin ..." - if [ $release == "stretch" ] - then - # for watever reason npm is not in stretch anymore - # because why the fuck debian - curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - - sudo apt install nodejs - else - sudo apt-get update --fix-missing - sudo apt-get -y install nodejs-legacy npm - fi + curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - + sudo apt install nodejs - cd /vagrant/yunohost-admin/src + cd /ynh-dev/yunohost-admin/src sudo npm install sudo npm install -g bower sudo npm install -g gulp fi - cd /vagrant/yunohost-admin/src - sudo su -c "bower install" vagrant - sudo su -c "gulp build --dev" vagrant + cd /ynh-dev/yunohost-admin/src + sudo su -c "bower install" ynhdev + sudo su -c "gulp build --dev" ynhdev - echo "Using Git repository for yunohost-admin" - create_sym_link "/vagrant/yunohost-admin/src" "/usr/share/yunohost/admin" + create_sym_link "/ynh-dev/yunohost-admin/src" "/usr/share/yunohost/admin" - echo "--------------------------------------------------------" - echo "Launching gulp ... " - echo "NB : This command will keep running and watch for changes" - echo " in the folder /vagrant/yunohost-admin/src, such that you" - echo "don't need to re-run npm yourself everytime you change" - echo "something !" - echo "--------------------------------------------------------" - sudo su -c "gulp watch --dev" vagrant + success "Now using Git repository for yunohost-admin" + + warn "-------------------------------------------------------- " + warn "Launching gulp ... " + warn "NB : This command will keep running and watch for changes" + warn " in the folder /ynh-dev/yunohost-admin/src, such that you" + warn "don't need to re-run npm yourself everytime you change " + warn "something ! " + warn "-------------------------------------------------------- " + sudo su -c "gulp watch --dev" ynhdev ;; esac done +} - -elif [ "$1" = "test" ]; then - check_yunohost_vm - VERSION=$2 - - for i in ${!packages[@]}; do - case ${packages[i]} in +function run_tests() +{ + assert_inside_vm + local PACKAGES="$@" + for PACKAGE in "$PACKAGES"; + do + case $PACKAGE in yunohost) # Pytest and tests dependencies if ! type "pytest" > /dev/null; then - echo "=======================" - echo "> Installing pytest ..." - echo "=======================" - apt-get install python-pip + info "> Installing pytest ..." + apt-get install python-pip -y pip2 install pytest fi - PIP_DEPENDENCIES="pytest-mock requests-mock mock" - for DEP in $PIP_DEPENDENCIES + for DEP in "pytest-mock requests-mock mock" do if [ -z "$(pip show $DEP)" ]; then - echo "=======================" - echo "Installing $DEP with pip" - echo "=======================" + info "Installing $DEP with pip" pip2 install $DEP fi done # Apps for test - cd /vagrant/yunohost/src/yunohost/tests - if [ ! -d "apps" ]; then - git clone https://github.com/YunoHost/test_apps ./apps - else - cd apps - git pull > /dev/null 2>&1 - fi + cd /ynh-dev/yunohost/src/yunohost/tests + [ -d "apps" ] || git clone https://github.com/YunoHost/test_apps ./apps + cd apps + git pull > /dev/null 2>&1 # Run tests echo "Running tests for YunoHost" - cd /vagrant/yunohost/ + cd /ynh-dev/yunohost/ py.test tests - cd /vagrant/yunohost/src/yunohost + cd /ynh-dev/yunohost/src/yunohost py.test tests ;; esac done +} - -elif [ "$1" = "self-update" ]; then - check_yunohost_vm - cd /vagrant/vagrant && git pull origin master - cd /vagrant/ynh-dev-tools && git pull origin master && cp ynh-dev ../ynh-dev - -# Fallback to print usage -else - usage - exit 101 -fi - -exit 0; +main "$@" From c9386744318329d8a591f25932a4b7e6d49768cd Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 3 Sep 2018 23:10:38 +0200 Subject: [PATCH 03/13] =?UTF-8?q?Zblerg=C2=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 8 --- Vagrantfile | 35 +++++++++++ deploy.sh | 26 +++++++++ .../stretch-unstable/virtualbox/vagrant_cwd | 1 + prebuild/README.md | 38 ++++++++++++ prebuild/Vagrantfile | 58 +++++++++++++++++++ prebuild/prebuild.sh | 23 ++++++++ 7 files changed, 181 insertions(+), 8 deletions(-) create mode 100755 Vagrantfile create mode 100755 deploy.sh create mode 100644 prebuild/.vagrant/machines/stretch-unstable/virtualbox/vagrant_cwd create mode 100644 prebuild/README.md create mode 100644 prebuild/Vagrantfile create mode 100755 prebuild/prebuild.sh diff --git a/.gitignore b/.gitignore index dc8719b..74b2c58 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,3 @@ -# Apps -*_ynh - -# Tools -vagrant -ynh-dev-tools -Vagrantfile - # Sources repositories moulinette yunohost diff --git a/Vagrantfile b/Vagrantfile new file mode 100755 index 0000000..e3af2f8 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,35 @@ +# -*- 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 = "192.168.33." + +HOSTS = { + "ynh-dev" => ["83", "stretch-unstable"], + "ynh-dev-buster" => ["84", "buster-unstable"], +} + +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/yunohost-" + 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/deploy.sh b/deploy.sh new file mode 100755 index 0000000..0bd536f --- /dev/null +++ b/deploy.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +read -p "This script will create a new 'ynh-dev' folder with a dev environment inside. Is this okay ? [Y/N]" -n 1 -r +echo $REPLY +[[ $REPLY =~ ^[Yy]$ ]] || { echo "Aborting."; exit 1; } + +set -x + +sudo apt-get install vagrant lxc git -y + +git clone https://github.com/YunoHost/ynh-dev +cd ./ynh-dev +git clone https://github.com/YunoHost/moulinette +git clone https://github.com/YunoHost/yunohost +git clone https://github.com/YunoHost/yunohost-admin +git clone https://github.com/YunoHost/SSOwat ssowat + +mkdir -p apps + +set +x + +echo " " +echo "---------------------------------------------------------------" +echo "Done ! You should cd into 'ynh-dev' then run './ynh-dev --help'" +echo "---------------------------------------------------------------" +echo " " diff --git a/prebuild/.vagrant/machines/stretch-unstable/virtualbox/vagrant_cwd b/prebuild/.vagrant/machines/stretch-unstable/virtualbox/vagrant_cwd new file mode 100644 index 0000000..8ea7d2b --- /dev/null +++ b/prebuild/.vagrant/machines/stretch-unstable/virtualbox/vagrant_cwd @@ -0,0 +1 @@ +/home/alex/dev/ynh-dev/VagrantFile/prebuild \ No newline at end of file diff --git a/prebuild/README.md b/prebuild/README.md new file mode 100644 index 0000000..39eca9d --- /dev/null +++ b/prebuild/README.md @@ -0,0 +1,38 @@ +# Build your own YunoHost Vagrant box + +## Get Debian base boxes + +```bash +vagrant box add debian/stretch64 +``` + +## Build YunoHost boxes + +Download the vagrant file to build from debian boxes + +```bash +wget https://raw.githubusercontent.com/YunoHost/Vagrantfile/master/prebuild/Vagrantfile +``` + +## Run your homemade boxes + +Run the box you need by calling `vagrant up DEBIAN_CODENAME-YUNOHOST_VERSION` + +```bash +vagrant up stretch-unstable --provider lxc +``` + +- `DEBIAN_CODENAME`: `jessie` or `stretch` +- `DISTRIB`: `unstable`. + +You can now log into your box with `vagrant ssh stretch-unstable` + +## Package your own boxes + +You can package it to use it more quickly later: + +```bash +vagrant up stretch-unstable --provider lxc +vagrant package stretch-unstable --output ./my-yunohost-stretch-unstable-lxc.box --provider lxc +vagrant box add my-yunohost/stretch-unstable ./my-yunohost-stretch-unstable-lxc.box --provider lxc +``` diff --git a/prebuild/Vagrantfile b/prebuild/Vagrantfile new file mode 100644 index 0000000..86e45ec --- /dev/null +++ b/prebuild/Vagrantfile @@ -0,0 +1,58 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +$script = <