Runner for piper-ci-core using Vagrant.
- Vagrant
- Python >= 3.5
- git >= 2.3.0
- ssh
-
Install project from github
pip install git+https://github.com/francma/piper-ci-vagrant-runner.git
-
Copy example configuration
cp config.example.yml config.yml
-
Edit your config to fit your needs
vim /config.example.yml
-
Go to
vagrant.vagrant_files_home
you defined in config and define images used in buildcd [vagrant.vagrant_files_home] && mkdir ubuntu && cd ubuntu && vagrant init ubuntu/trusty64
-
This will create Vagrantfile in
[vagrant.vagrant_files_home]/ubuntu
that will be available asimage: ubuntu
in.piper.yml
build config file -
In order to have repository inside your vagrant box, you must add it as synced folder to your Vagrantfile (example in
/tests/vagrant-files/ubuntu/Vagrantfile
)config.vm.synced_folder ENV['PIPER_REPOSITORY_PATH'], "/piper"
piper-vagrant [path to your config file]
-
Install Python virtual environment (via pip or your distribution package manager)
pip3 install virtualenv virtualenvwrapper
-
Create new virtual environment named
piper-vagrant
mkvirtualenv piper-vagrant
-
Install dev dependencies
pip install -e ".[dev]"
-
Deactivate virtualenv
deactivate
-
Activate virtualenv
workon piper-vagrant
Run tests in tests/
directory:
pytest
or tox -e py
Check PEP8:
flake8
or tox -e pep8
Check types:
mypy piper_vagrant/run.py
or tox -e mypy
Run for specific python version:
tox -e py35-mypy
or tox -e py36
Run all:
tox