add tests for pre/post deploy tasks
This commit is contained in:
1 parent
a72a82e29b
commit
8950571acb
16 files changed
+111
-1
No files matched your search
@@ -91,6 +91,14 @@ else
|
|||||||
@$(QUIET) ./tests/ci/unit_test_runner.sh $$UNIT_TEST_BATCH
|
@$(QUIET) ./tests/ci/unit_test_runner.sh $$UNIT_TEST_BATCH
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
deploy-test-go-fail-predeploy:
|
||||||
|
@echo deploying go-fail-predeploy app...
|
||||||
|
cd tests && ./test_deploy ./apps/go-fail-predeploy dokku.me '' true
|
||||||
|
|
||||||
|
deploy-test-go-fail-postdeploy:
|
||||||
|
@echo deploying go-fail-postdeploy app...
|
||||||
|
cd tests && ./test_deploy ./apps/go-fail-postdeploy dokku.me '' true
|
||||||
|
|
||||||
deploy-test-checks-root:
|
deploy-test-checks-root:
|
||||||
@echo deploying checks-root app...
|
@echo deploying checks-root app...
|
||||||
cd tests && ./test_deploy ./apps/checks-root dokku.me '' true
|
cd tests && ./test_deploy ./apps/checks-root dokku.me '' true
|
||||||
@@ -166,6 +174,8 @@ deploy-test-static:
|
|||||||
deploy-tests:
|
deploy-tests:
|
||||||
@echo running deploy tests...
|
@echo running deploy tests...
|
||||||
@$(QUIET) $(MAKE) deploy-test-checks-root
|
@$(QUIET) $(MAKE) deploy-test-checks-root
|
||||||
|
@$(QUIET) $(MAKE) deploy-test-go-fail-predeploy
|
||||||
|
@$(QUIET) $(MAKE) deploy-test-go-fail-postdeploy
|
||||||
@$(QUIET) $(MAKE) deploy-test-config
|
@$(QUIET) $(MAKE) deploy-test-config
|
||||||
@$(QUIET) $(MAKE) deploy-test-clojure
|
@$(QUIET) $(MAKE) deploy-test-clojure
|
||||||
@$(QUIET) $(MAKE) deploy-test-dockerfile
|
@$(QUIET) $(MAKE) deploy-test-dockerfile
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
web
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/ go
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
FROM golang:1.7.5
|
||||||
|
|
||||||
|
EXPOSE 3000/tcp
|
||||||
|
|
||||||
|
ADD . /go/src/github.com/dokku/apps/web
|
||||||
|
WORKDIR /go/src/github.com/dokku/apps/web
|
||||||
|
|
||||||
|
RUN go install -v ./...
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
web: /go/bin/web
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "Sample go app",
|
||||||
|
"description": "Used in dokku's test suite",
|
||||||
|
"website": "http://dokku.viewdocs.io/dokku/",
|
||||||
|
"repository": "https://github.com/dokku/dokku",
|
||||||
|
"logo": "https://raw.githubusercontent.com/dokku/dokku/master/docs/assets/dokku.png",
|
||||||
|
"scripts": {
|
||||||
|
"dokku": {
|
||||||
|
"postdeploy": "touch /app/postdeploy.test && ls -la /app"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"buildpacks": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/heroku/heroku-buildpack-go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Executable
+2
@@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e; test "$(curl -s -S "$1")" == "go"
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
http.HandleFunc("/", hello)
|
||||||
|
fmt.Println("listening...")
|
||||||
|
err := http.ListenAndServe(":"+os.Getenv("PORT"), nil)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func hello(res http.ResponseWriter, req *http.Request) {
|
||||||
|
fmt.Fprintln(res, "go")
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
web
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
/ go
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
FROM golang:1.7.5
|
||||||
|
|
||||||
|
EXPOSE 3000/tcp
|
||||||
|
|
||||||
|
ADD . /go/src/github.com/dokku/apps/web
|
||||||
|
WORKDIR /go/src/github.com/dokku/apps/web
|
||||||
|
|
||||||
|
RUN go install -v ./...
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
web: /go/bin/web
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "Sample go app",
|
||||||
|
"description": "Used in dokku's test suite",
|
||||||
|
"website": "http://dokku.viewdocs.io/dokku/",
|
||||||
|
"repository": "https://github.com/dokku/dokku",
|
||||||
|
"logo": "https://raw.githubusercontent.com/dokku/dokku/master/docs/assets/dokku.png",
|
||||||
|
"scripts": {
|
||||||
|
"dokku": {
|
||||||
|
"predeploy": "touch /app/predeploy.test && ls -la /app"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"buildpacks": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/heroku/heroku-buildpack-go"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Executable
+2
@@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e; test "$(curl -s -S "$1")" == "go"
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
http.HandleFunc("/", hello)
|
||||||
|
fmt.Println("listening...")
|
||||||
|
err := http.ListenAndServe(":"+os.Getenv("PORT"), nil)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func hello(res http.ResponseWriter, req *http.Request) {
|
||||||
|
fmt.Fprintln(res, "go")
|
||||||
|
}
|
||||||
@@ -79,7 +79,7 @@ case "$CIRCLE_NODE_INDEX" in
|
|||||||
exit $RC
|
exit $RC
|
||||||
fi
|
fi
|
||||||
echo "=====> make deploy tests"
|
echo "=====> make deploy tests"
|
||||||
sudo -E make -e deploy-test-checks-root deploy-test-config deploy-test-multi
|
sudo -E make -e deploy-test-checks-root deploy-test-config deploy-test-multi deploy-test-go-fail-predeploy deploy-test-go-fail-postdeploy
|
||||||
RC=$?
|
RC=$?
|
||||||
if [[ $RC -ne 0 ]]; then
|
if [[ $RC -ne 0 ]]; then
|
||||||
echo "exit status: $RC"
|
echo "exit status: $RC"
|
||||||
|
|||||||
Reference in new issue
Block a user