Docs update with new fnctl commands (#273)

* Added high level roadmap.

* Changed to funtion.yaml.

* Added logo

* updating quickstart code example, WIP, waiting on another merge.

* Minor updates.

* Changed function.yaml to func.yaml and updated fnctl README.
This commit is contained in:
Travis Reeder
2016-11-14 16:40:05 -08:00
committed by C Cirello
parent 2d3601c588
commit 0d71e1e38e
27 changed files with 284 additions and 182 deletions

9
examples/README.md Normal file
View File

@@ -0,0 +1,9 @@
# Example Functions
This directory has a collection of example functions you can look at to learn more about how to write them
or just copy one and build on it to get started faster.
## Hello World Examples
The [Hello World examples](hello/) are the most basic functions you can write and we'll try to have an example in most major languages.
This is a good place to start and good examples to copy and build upon.

View File

@@ -4,4 +4,4 @@ vendor/
/app
/__uberscript__
function.yaml
func.yaml

View File

@@ -3,22 +3,20 @@
This example will show you how to test and deploy Go (Golang) code to IronFunctions.
```sh
# create your func.yaml file
fnctl init <YOUR_DOCKERHUB_USERNAME>/hello
# build the function
fnctl build
# test it
cat hello.payload.json | fnctl run
# push it to Docker Hub
fnctl push
# Create a route to this function on IronFunctions
fnctl routes create myapp /hello YOUR_DOCKERHUB_USERNAME/hello:0.0.X
# todo: Image name could be optional if we read the function file for creating the route. Then command could be:
fnctl routes create myapp /hello
```
Now you use your function on IronFunctions:
Now you can call your function on IronFunctions:
```sh
curl -H "Content-Type: application/json" -X POST -d @hello.payload.json http://localhost:8080/r/myapp/hello
```
Or surf to it: http://localhost:8080/r/myapp/hello

View File

@@ -0,0 +1,4 @@
name: treeder/hello4
version: 0.0.1
runtime: go
entrypoint: ./func

View File

@@ -13,5 +13,5 @@ type Person struct {
func main() {
p := &Person{Name: "World"}
json.NewDecoder(os.Stdin).Decode(p)
fmt.Println("Hello", p.Name, "!!!")
fmt.Printf("Hello %v!", p.Name)
}

View File

@@ -1,3 +1,3 @@
node_modules/
function.yaml
func.yaml
Dockerfile

View File

@@ -3,15 +3,15 @@
This example will show you how to test and deploy a Node function to IronFunctions.
```sh
# create your func.yaml file
fnctl init <YOUR_DOCKERHUB_USERNAME>/hello
# build the function
fnctl build
# test it
cat hello.payload.json | fnctl run
# push it to Docker Hub for use with IronFunctions
fnctl push
# Create a route to this function on IronFunctions
fnctl routes create myapp /hello YOUR_DOCKERHUB_USERNAME/hello:0.0.X
# todo: Image name could be optional if we read the function file for creating the route. Then command could be:
fnctl routes create myapp /hello
```

View File

@@ -0,0 +1,4 @@
name: treeder/node4
version: 0.0.2
runtime: node
entrypoint: node hello.js

View File

@@ -2,13 +2,14 @@
This example will show you how to test and deploy Go (Golang) code to IronFunctions.
### 1. Prepare the `functions.yaml` file:
### 1. Prepare the `func.yaml` file:
At functions.yaml you will find:
At func.yaml you will find:
```yml
app: phpapp
route: /hello
image: USERNAME/hello:0.0.1
image: USERNAME/hello
version: 0.0.1
build:
- docker run --rm -v "$PWD":/worker -w /worker iron/php:dev composer install
```

View File

@@ -2,13 +2,15 @@
This example will show you how to test and deploy Go (Golang) code to IronFunctions.
### 1. Prepare the `functions.yaml` file:
### 1. Prepare the `func.yaml` file:
At func.yaml you will find:
At functions.yaml you will find:
```yml
app: pythonapp
route: /hello
image: USERNAME/hello:0.0.1
image: USERNAME/hello
version: 0.0.1
build:
- docker run --rm -v "$PWD":/worker -w /worker iron/python:2-dev pip install -t packages -r requirements.txt
```