Commit 2a03f306 authored by Candy Tsai's avatar Candy Tsai

edit Vagrantfile to setup development environment

parent 6dcd6c70
Pipeline #47320 failed with stage
in 10 minutes and 20 seconds
......@@ -18,3 +18,4 @@
/man
/tmp
/.env
/.vagrant
\ No newline at end of file
......@@ -2,9 +2,21 @@
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = '2'.freeze
VAGRANTFILE_API_VERSION = "2".freeze
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = ENV['BOX'] || 'debian/stretch64'
config.vm.network 'forwarded_port', guest: 8080, host: 8080
config.vm.box = ENV['BOX'] || "debian/stretch64"
config.vm.network "forwarded_port", guest: 8080, host: 8080
# default synced_folder settings will copy the actual contents of the symlink
# but we only want to copy the symlinks as they are
config.vm.synced_folder ".", "/vagrant", type: "rsync",
rsync__args: ["--verbose", "--archive", "--delete", "-z", "--links"]
# if for some reason you want to run `vagrant provision`
# please uncomment the following line and comment the original line
# config.vm.provision "shell", inline: 'echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list', run: "never"
config.vm.provision "shell", inline: 'echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list'
config.vm.provision "shell", path: "vagrant/script.sh"
end
......@@ -2,6 +2,44 @@
## Setting up a development environment
There are two ways to setup the development environment:
* Manual Setup
* Vagrant
## Vagrant
### Prerequisites
* Vagrant: 2.2.4 https://www.vagrantup.com/
* VirtualBox: 6.0 https://www.virtualbox.org/
### Install the virtual machine
Run this at the same path where `VagrantFile` is
```
$ vagrant up
```
### Start debci
SSH into vagrant environment
```
$ vagrant ssh
```
Once inside vagrant, you can start run debci with the following commands
```
vagrant@stretch $ cd /vagrant
vagrant@stretch $ sudo foreman start
```
Note: The other commands are the same as the ones mentioned in manual setup, but you have to use `sudo`.
## Manual Setup
### Grab the dependencies and required software
Install the dependencies and build dependencies:
......
......@@ -21,4 +21,8 @@ esac
echo "I: Web UI at http://localhost:$port/"
echo "I: Hit Control+C to stop"
echo ""
exec rerun --no-notify --background --dir lib -p '**/*.rb' -- rackup --include lib --port="$port"
# --host defaults to localhost
# which is different from what `man rackup` says
# also see: https://github.com/rack/rack/commit/076711a837cda3f07889cab05cb89964ce2314f0
# change to 0.0.0.0 for vagrant or docker environments to have access
exec rerun --no-notify --background --dir lib -p '**/*.rb' -- rackup --include lib --port="$port" --host=0.0.0.0
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
apt-get -y update
apt-get -qqyt stretch-backports install autopkgtest
apt-get -qqy install make ruby git debootstrap
cd /vagrant
apt-get -qqy build-dep .
./tools/init-dev.sh
make
./bin/debci migrate
./bin/debci setup-chdist
echo "Development virtual machine is installed!"
\ No newline at end of file
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