This repository has been archived by the owner on Aug 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into logging-handler
- Loading branch information
Showing
7 changed files
with
114 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,3 +62,6 @@ target/ | |
# Local configuration | ||
.env | ||
.env.integration | ||
|
||
# Vagrant | ||
.vagrant/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# This script provisions a vagrant development environment with local | ||
# postgres and redis servers for development and testing. | ||
PROVISION = <<SCRIPT | ||
set -e | ||
# cd to /vagrant on login | ||
cd /vagrant | ||
grep -Fq 'cd /vagrant' ~/.bashrc || echo 'cd /vagrant' >> ~/.bashrc | ||
# Install system packages | ||
sudo apt-get update --quiet | ||
sudo apt-get install -y $(cat debian_packages.lst) postgresql | ||
# Set up a virtualenv | ||
sudo pip3 install virtualenv | ||
mkdir -p ~/.virtualenvs | ||
virtualenv -p python3 ~/.virtualenvs/opencraft | ||
source ~/.virtualenvs/opencraft/bin/activate | ||
# Activate virtualenv on login | ||
grep -Fq 'source ~/.virtualenvs/opencraft/bin/activate' ~/.bashrc || | ||
echo 'source ~/.virtualenvs/opencraft/bin/activate' >> ~/.bashrc | ||
# Install python dependencies | ||
pip install -r requirements.txt | ||
# Create postgres user | ||
sudo -u postgres createuser -d vagrant | ||
# Allow access to postgres from localhost without password | ||
cat << EOF | sudo tee /etc/postgresql/9.3/main/pg_hba.conf | ||
local all postgres peer | ||
local all all trust | ||
host all all 127.0.0.1/32 trust | ||
host all all ::1/128 trust | ||
EOF | ||
sudo service postgresql restart | ||
# Create postgres database | ||
createdb --encoding utf-8 --template template0 opencraft | ||
# Use test configuration for local development, excluding the line that | ||
# disables logging to the console. | ||
[ -e .env ] || grep -v '^BASE_HANDLERS' .env.test > .env | ||
# Run unit tests | ||
make test_unit | ||
SCRIPT | ||
|
||
Vagrant.configure(2) do |config| | ||
config.vm.box = 'ubuntu/trusty64' | ||
config.vm.network 'forwarded_port', guest: 2001, host: 2001 | ||
config.vm.network 'forwarded_port', guest: 5000, host: 5000 | ||
config.vm.provision 'shell', | ||
inline: PROVISION, | ||
privileged: false, | ||
keep_color: true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters