From 7ec037b46a735b87c30b93ae05d76a0209c7cd03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Seif=20Lotfy=20=D8=B3=D9=8A=D9=81=20=D9=84=D8=B7=D9=81?= =?UTF-8?q?=D9=8A?= Date: Mon, 17 Oct 2016 22:12:10 +0200 Subject: [PATCH] =?UTF-8?q?Move=20hello-async.sh=20and=20hello-sync.sh=20t?= =?UTF-8?q?o=20the=20ruby=20and=20go=20directories=20=E2=80=A6=20(#176)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Move hello-async.sh and hello-sync.sh to the ruby and go directories and get rid of examples in tools * update hello-ruby code to use iron/hello:ruby images --- .../hello-go}/hello-async.sh | 0 .../hello-go}/hello-sync.sh | 0 examples/hello-ruby/hello-async.sh | 23 +++++++++++++++++++ examples/hello-ruby/hello-sync.sh | 23 +++++++++++++++++++ tool/examples/hello/.gitignore | 1 - tool/examples/hello/Dockerfile | 7 ------ tool/examples/hello/VERSION | 1 - tool/examples/hello/hello.go | 12 ---------- 8 files changed, 46 insertions(+), 21 deletions(-) rename {tool/examples => examples/hello-go}/hello-async.sh (100%) rename {tool/examples => examples/hello-go}/hello-sync.sh (100%) create mode 100755 examples/hello-ruby/hello-async.sh create mode 100755 examples/hello-ruby/hello-sync.sh delete mode 100644 tool/examples/hello/.gitignore delete mode 100644 tool/examples/hello/Dockerfile delete mode 100644 tool/examples/hello/VERSION delete mode 100644 tool/examples/hello/hello.go diff --git a/tool/examples/hello-async.sh b/examples/hello-go/hello-async.sh similarity index 100% rename from tool/examples/hello-async.sh rename to examples/hello-go/hello-async.sh diff --git a/tool/examples/hello-sync.sh b/examples/hello-go/hello-sync.sh similarity index 100% rename from tool/examples/hello-sync.sh rename to examples/hello-go/hello-sync.sh diff --git a/examples/hello-ruby/hello-async.sh b/examples/hello-ruby/hello-async.sh new file mode 100755 index 000000000..d18bfa7b2 --- /dev/null +++ b/examples/hello-ruby/hello-async.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +HOST="${1:-localhost:8080}" +REQ="${2:-1}" + +curl -H "Content-Type: application/json" -X POST -d '{ + "app": { "name":"myapp" } +}' http://$HOST/v1/apps + +curl -H "Content-Type: application/json" -X POST -d '{ + "route": { + "type": "async", + "path":"/hello-async", + "image":"iron/hello:ruby" + } +}' http://$HOST/v1/apps/myapp/routes + +for i in `seq 1 $REQ`; +do + curl -H "Content-Type: application/json" -X POST -d '{ + "name":"Johnny" + }' http://$HOST/r/myapp/hello-async +done; \ No newline at end of file diff --git a/examples/hello-ruby/hello-sync.sh b/examples/hello-ruby/hello-sync.sh new file mode 100755 index 000000000..ff3d595f9 --- /dev/null +++ b/examples/hello-ruby/hello-sync.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +HOST="${1:-localhost:8080}" +REQ="${2:-1}" + +curl -H "Content-Type: application/json" -X POST -d '{ + "app": { "name":"myapp" } +}' http://$HOST/v1/apps + +curl -H "Content-Type: application/json" -X POST -d '{ + "route": { + "type": "sync", + "path":"/hello-sync", + "image":"iron/hello:ruby + } +}' http://$HOST/v1/apps/myapp/routes + +for i in `seq 1 $REQ`; +do + curl -H "Content-Type: application/json" -X POST -d '{ + "name":"Johnny" + }' http://$HOST/r/myapp/hello-sync +done; \ No newline at end of file diff --git a/tool/examples/hello/.gitignore b/tool/examples/hello/.gitignore deleted file mode 100644 index e92569d01..000000000 --- a/tool/examples/hello/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/hello diff --git a/tool/examples/hello/Dockerfile b/tool/examples/hello/Dockerfile deleted file mode 100644 index ee192de5a..000000000 --- a/tool/examples/hello/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM iron/go:dev - -ADD . /go/src/github.com/treeder/hello -WORKDIR /go/src/github.com/treeder/hello -RUN go build github.com/treeder/hello - -ENTRYPOINT ["/go/src/github.com/treeder/hello/hello"] diff --git a/tool/examples/hello/VERSION b/tool/examples/hello/VERSION deleted file mode 100644 index 8acdd82b7..000000000 --- a/tool/examples/hello/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.0.1 diff --git a/tool/examples/hello/hello.go b/tool/examples/hello/hello.go deleted file mode 100644 index 7cd96e4be..000000000 --- a/tool/examples/hello/hello.go +++ /dev/null @@ -1,12 +0,0 @@ -package main - -import ( - "os" - "fmt" - "io/ioutil" -) - -func main() { - bytes, _ := ioutil.ReadAll(os.Stdin) - fmt.Printf("Hello %v!\n", string(bytes)) -}