Greg Dziemidowicz's Blog

software development related topics

Setting Up PostGIS on Semaphore CI

Example how configure semaphoreapp.com CI so that it can run tests requiring postgis:

ci_semaphore.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
set -e

sudo apt-add-repository -y ppa:ubuntugis/ppa
sudo apt-get update
sudo apt-get install -y postgresql-9.3-postgis
createdb $DATABASE_NAME_TEST -U $DATABASE_POSTGRESQL_USERNAME

psql -c 'CREATE EXTENSION postgis;' -U $DATABASE_POSTGRESQL_USERNAME -d $DATABASE_NAME_TEST
psql -c 'CREATE EXTENSION postgis_topology;' -U $DATABASE_POSTGRESQL_USERNAME -d $DATABASE_NAME_TEST
bundle install --deployment --path vendor/bundle

bundle exec rake db:setup
bundle exec rake db:test:prepare

I coundn’t google it myself, so I hope this helps!

Comments