Permalink
Browse files

Merge branch 'master' into heroku

  • Loading branch information...
2 parents 399a661 + 6fb3c9b commit 2278ed56f75ef4808ba1f58930189a878a1a0c36 @lrytz committed Mar 26, 2012
Showing with 42 additions and 1 deletion.
  1. +20 −0 app/controllers/Application.scala
  2. +1 −1 app/controllers/Config.scala
  3. +4 −0 conf/routes
  4. +17 −0 notes.txt
@@ -309,6 +309,26 @@ object Application extends Controller {
/**
* Random stuff
*/
+
+ def sql() = Action {
+ import dispatch._
+ import play.api.db._
+ import play.api.Play.current
+
+ val req = url("http://lamp.epfl.ch/~rytz/script.sql")
+
+ Http(req >~ { source =>
+ for (line <- source.getLines())
+ DB.withConnection { implicit c =>
+ if (line.nonEmpty) {
+ Logger.info(line)
+ SQL(line).executeUpdate()
+ }
+ }
+ })
+
+ Redirect(routes.Application.index())
+ }
def initRepo() = AuthAction { _ =>
val shas = newCommitsSince(Config.oldestImportedCommit).filter(r => (Commit.commit(r).isEmpty))
@@ -6,7 +6,7 @@ import models.Setting
object Config {
val commitsPerPage = 50
- val enablePollings = true
+ val enablePollings = Setting.setting("enablePollings") == "true"
val updatePollFrequency = 1 minute
val refreshRunningBuildsFrequency = 5 minutes
View
@@ -2,6 +2,10 @@
# This file defines all application routes (Higher priority routes first)
# ~~~~
+# Sql Script
+
+GET /sql controllers.Application.sql()
+
# Login
GET /login controllers.Application.login(message: String ?= "")
View
@@ -5,6 +5,7 @@ required settings
INSERT INTO setting VALUES ('jenkinsUsername', 'jenkinsbuilder');
INSERT INTO setting VALUES ('jenkinsPassword', 'xxxxxxxxxxxxxx');
+INSERT INTO setting VALUES ('enablePollings', 'true');
@@ -55,6 +56,22 @@ CREATE DUMP
heroku
******
+
+- create app:
+ heroku create --stack cedar
+ (adds a git remote)
+
+- publish
+ git push heroku heroku:master
+
+- view logs
+ heroku logs
+
+- sql console
+ https://github.com/ddollar/heroku-sql-console
+
+
+
http://devcenter.heroku.com/articles/import-data-heroku-postgres
http://www.postgresql.org/docs/8.3/static/datatype-numeric.html

0 comments on commit 2278ed5

Please sign in to comment.