Remove iron...

This commit is contained in:
Travis Reeder
2017-05-18 18:59:34 +00:00
committed by Reed Allman
parent 521df8c1ff
commit 9cc12b4b12
146 changed files with 406 additions and 1050 deletions

View File

@@ -1,5 +1,5 @@
FROM iron/go
FROM alpine
ADD func .
ENTRYPOINT ["./func"]
ENTRYPOINT ["./func"]

View File

@@ -5,7 +5,7 @@ A simple serverless blog API
## Requirements
- Remote MongoDB instance (for example heroku)
- Running IronFunctions API
- Running Oracle Functions API
## Development
@@ -16,7 +16,7 @@ A simple serverless blog API
USERNAME=YOUR_DOCKER_HUB_USERNAME
# build it
docker run --rm -v "$PWD":/go/src/github.com/treeder/hello -w /go/src/github.com/treeder/hello iron/go:dev go build -o function
docker run --rm -v "$PWD":/go/src/github.com/treeder/hello -w /go/src/github.com/treeder/hello funcy/go:dev go build -o function
docker build -t $USERNAME/func-blog .
```
@@ -31,9 +31,9 @@ docker tag $USERNAME/func-blog:latest $USERNAME/func-blog:`cat VERSION`
docker push $USERNAME/func-blog
```
## Running it on IronFunctions
## Running it on Oracle Functions
First you need a running IronFunctions API
First you need a running Oracle Functions API
### First, let's define this environment variables
@@ -53,7 +53,7 @@ MONGODB=YOUR_MONGODB_ADDRESS
./test.sh
```
### Running with IronFunctions
### Running with Oracle Functions
With this command we are going to create an application with name `blog` and also defining the app configuration `DB`.
@@ -101,7 +101,7 @@ curl -X POST --data '{
#### Testing function
Now that we created our IronFunction route, let's test our routes
Now that we created our Oracle Functions route, let's test our routes
```
curl -X POST http://$FUNCAPI/r/blog/posts

View File

@@ -8,5 +8,5 @@ FUNCPKG=$(pwd | sed "s|$GOPATH/src/||")
docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG glide up
# build image
docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG iron/go:dev go build -o func
docker build -t iron/func-blog .
docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG funcy/go:dev go build -o func
docker build -t username/func-blog .

View File

@@ -1,3 +1,3 @@
name: iron/func-blog
name: username/func-blog
build:
- ./build.sh
- ./build.sh

View File

@@ -9,8 +9,8 @@ docker rm test-mongo-func
docker run -p 27017:27017 --name test-mongo-func -d mongo
echo '{ "title": "My New Post", "body": "Hello world!", "user": "test" }' | docker run --rm -i -e METHOD=POST -e ROUTE=/posts -e DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 iron/func-blog
docker run --rm -i -e METHOD=GET -e ROUTE=/posts -e DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 iron/func-blog
echo '{ "title": "My New Post", "body": "Hello world!", "user": "test" }' | docker run --rm -i -e METHOD=POST -e ROUTE=/posts -e DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 username/func-blog
docker run --rm -i -e METHOD=GET -e ROUTE=/posts -e DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 username/func-blog
docker stop test-mongo-func
docker rm test-mongo-func