Skip to content

Commit

Permalink
Vagrantfile for build and regression testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwsteele committed Jun 20, 2017
1 parent 9185dec commit 29a9dd0
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Vagrant.configure(2) do |config|
config.vm.box = "bento/centos-7.3"

config.vm.provider :virtualbox do |vb|
vb.name = "pgaudit-centos7-test"
end

# Provision the VM
config.vm.provision "shell", inline: <<-SHELL
# Install PostgreSQL
rpm -ivh http://yum.postgresql.org/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
yum install -y postgresql96-server
# Compile & install pgaudit
yum install -y postgresql96-devel gcc openssl-devel
bash -c 'export PATH="$PATH:/usr/pgsql-9.6/bin" && make -C /pgaudit install USE_PGXS=1'
# Create PostgreSQL cluster
sudo -u postgres /usr/pgsql-9.6/bin/initdb -A trust -k /var/lib/pgsql/9.6/data
echo "shared_preload_libraries = 'pgaudit'" >> /var/lib/pgsql/9.6/data/postgresql.conf
systemctl start postgresql-9.6
sudo -u postgres psql -X -c 'create user vagrant superuser'
# Test pgaudit
sudo -u vagrant bash -c 'export PATH="$PATH:/usr/pgsql-9.6/bin" && make -C /pgaudit installcheck USE_PGXS=1'
SHELL

# Don't share the default vagrant folder
config.vm.synced_folder ".", "/vagrant", disabled: true

# Mount project path for testing
config.vm.synced_folder "..", "/pgaudit"
end

0 comments on commit 29a9dd0

Please sign in to comment.