Skip to content

Commit

Permalink
Add a Vagrantfile to run the test suite.
Browse files Browse the repository at this point in the history
vagrant up
vagrant ssh
python runtests.py
  • Loading branch information
Starou committed Feb 12, 2024
1 parent 12adf4c commit 6ef676b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure(2) do |config|
config.vm.synced_folder ".", "/vagrant"
config.vm.define "tokenapi", primary: true do |tokenapi|
tokenapi.vm.box = "bento/debian-11.7"
tokenapi.vm.hostname = "tokenapi"

tokenapi.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end

tokenapi.vm.provision "shell", inline: <<-SHELL
apt-get update
DEBIAN_FRONTEND="noninteractive" apt-get install -y build-essential python3-venv
SHELL

tokenapi.vm.provision "create-virtualenv-py3", type: :shell, privileged: false, inline: <<-SHELL
cd ~
python3 -m venv venv_py3
SHELL

tokenapi.vm.provision "pip3-install", type: :shell, privileged: false, inline: <<-SHELL
source ~/venv_py3/bin/activate
pip3 install django==4.0.10 six
SHELL

tokenapi.vm.provision "bashrc", type: :shell, privileged: false, inline: <<-SHELL
echo "cd /vagrant" >> ~/.bashrc
echo "source ~/venv_py3/bin/activate" >> ~/.bashrc
SHELL
end
end

0 comments on commit 6ef676b

Please sign in to comment.