Merge pull request #942 from progrium/mh-clojure-test-app
test clojure app
This commit is contained in:
5
tests.mk
5
tests.mk
@@ -63,6 +63,10 @@ unit-tests:
|
|||||||
@echo running unit tests...
|
@echo running unit tests...
|
||||||
@$(QUIET) bats tests/unit
|
@$(QUIET) bats tests/unit
|
||||||
|
|
||||||
|
deploy-test-clojure:
|
||||||
|
@echo deploying config app...
|
||||||
|
cd tests && ./test_deploy ./apps/clojure dokku.me
|
||||||
|
|
||||||
deploy-test-config:
|
deploy-test-config:
|
||||||
@echo deploying config app...
|
@echo deploying config app...
|
||||||
cd tests && ./test_deploy ./apps/config dokku.me
|
cd tests && ./test_deploy ./apps/config dokku.me
|
||||||
@@ -111,6 +115,7 @@ deploy-tests:
|
|||||||
@echo running deploy tests...
|
@echo running deploy tests...
|
||||||
# @$(QUIET) bats tests/deploy
|
# @$(QUIET) bats tests/deploy
|
||||||
@$(QUIET) $(MAKE) deploy-test-config
|
@$(QUIET) $(MAKE) deploy-test-config
|
||||||
|
@$(QUIET) $(MAKE) deploy-test-clojure
|
||||||
@$(QUIET) $(MAKE) deploy-test-gitsubmodules
|
@$(QUIET) $(MAKE) deploy-test-gitsubmodules
|
||||||
@$(QUIET) $(MAKE) deploy-test-go
|
@$(QUIET) $(MAKE) deploy-test-go
|
||||||
@$(QUIET) $(MAKE) deploy-test-java
|
@$(QUIET) $(MAKE) deploy-test-java
|
||||||
|
|||||||
1
tests/apps/clojure/Procfile
Normal file
1
tests/apps/clojure/Procfile
Normal file
@@ -0,0 +1 @@
|
|||||||
|
web: lein run
|
||||||
4
tests/apps/clojure/README.md
Normal file
4
tests/apps/clojure/README.md
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Hello Clojure/Compojure
|
||||||
|
=======================
|
||||||
|
|
||||||
|
A minimal Hello World web app in [Clojure](http://clojure.org/), using the [Compojure](https://github.com/weavejester/compojure) web framework.
|
||||||
1
tests/apps/clojure/check_deploy
Executable file
1
tests/apps/clojure/check_deploy
Executable file
@@ -0,0 +1 @@
|
|||||||
|
set -e; sleep 5; output="$(curl -s -S $1)"; echo $output; test "$output" == "Hello World!"
|
||||||
7
tests/apps/clojure/project.clj
Normal file
7
tests/apps/clojure/project.clj
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
(defproject clojure-sample "1.0.1"
|
||||||
|
:description "Hello World Clojure Web App"
|
||||||
|
:dependencies [[org.clojure/clojure "1.6.0"]
|
||||||
|
[compojure "1.3.1"]
|
||||||
|
[ring/ring-jetty-adapter "1.3.2"]]
|
||||||
|
:main ^:skip-aot sample.app
|
||||||
|
:min-lein-version "2.0.0")
|
||||||
13
tests/apps/clojure/src/sample/app.clj
Normal file
13
tests/apps/clojure/src/sample/app.clj
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
(ns sample.app
|
||||||
|
(:require [ring.adapter.jetty :as jetty]
|
||||||
|
[compojure.core :refer [defroutes GET]]))
|
||||||
|
|
||||||
|
(defroutes handler
|
||||||
|
(GET "/" []
|
||||||
|
{:headers {"Content-type" "text/plain; charset=UTF-8"}
|
||||||
|
:body "Hello World!"}))
|
||||||
|
|
||||||
|
(defn -main []
|
||||||
|
(jetty/run-jetty handler
|
||||||
|
{:port (Integer. (or (System/getenv "PORT") "5000"))
|
||||||
|
:join? false}))
|
||||||
Reference in New Issue
Block a user