Skip to content

Commit

Permalink
travis postgres data
Browse files Browse the repository at this point in the history
  • Loading branch information
elisehuard committed Nov 26, 2012
1 parent b447496 commit f522af3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .travis.yml
@@ -1,5 +1,7 @@
language: clojure
services: postgreSQL
env:
- DATABASE_HOST="127.0.0.1:5432/wheelcrowd" DATABASE_USER="postgres"
before_script:
- psql -c 'create database wheelcrowd;' -U postgres
- lein ragtime migrate
7 changes: 6 additions & 1 deletion project.clj
Expand Up @@ -12,5 +12,10 @@
:plugins [[lein-ring "0.7.5"]
[ragtime/ragtime.lein "0.3.2"]]
:ragtime {:migrations ragtime.sql.files/migrations
:database (str "jdbc:" (clojure.string/replace (System/getenv "DATABASE_URL") #"postgres:" "postgresql:"))}
:database (str "jdbc:" (or (let [database_host (System/getenv "DATABASE_HOST")
database_user (System/getenv "DATABASE_USER")
database_pass (System/getenv "DATABASE_PASS")]
(str "postgresql://" database_host
(if (clojure.string/blank? database_user) "" (str "?user=" database_user))
(if (clojure.string/blank? database_pass) "" (str "&password=" database_pass))))))}
:ring {:handler wheelcrowd.routes/app})

0 comments on commit f522af3

Please sign in to comment.