mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Remove iron...
This commit is contained in:
committed by
Reed Allman
parent
521df8c1ff
commit
9cc12b4b12
@@ -1,4 +1,4 @@
|
||||
FROM iron/go:dev
|
||||
FROM funcy/go:dev
|
||||
|
||||
RUN mkdir -p /go/src/github.com/Masterminds
|
||||
ENV GOPATH=/go
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
FROM iron/go
|
||||
FROM alpine
|
||||
|
||||
ADD func .
|
||||
|
||||
ENTRYPOINT ["./func"]
|
||||
ENTRYPOINT ["./func"]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 .
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
name: iron/func-blog
|
||||
name: username/func-blog
|
||||
build:
|
||||
- ./build.sh
|
||||
- ./build.sh
|
||||
|
||||
@@ -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
|
||||
@@ -1,19 +1,19 @@
|
||||
# IronFunctions Load Balance example using Caddy
|
||||
# Oracle Functions Load Balance example using Caddy
|
||||
|
||||
Simple example of IronFunctions load balancer using Caddy Server
|
||||
Simple example of Oracle Functions load balancer using Caddy Server
|
||||
|
||||
|
||||
## Run IronFunctions
|
||||
## Run Oracle Functions
|
||||
|
||||
Start the IronFunctions instances
|
||||
Start the Oracle Functions instances
|
||||
|
||||
Ref: https://github.com/treeder/functions/blob/master/README.md#start-the-ironfunctions-api
|
||||
Ref: https://github.com/treeder/functions/blob/master/README.md#start-the-functions-api
|
||||
|
||||
|
||||
## Configure environment variable
|
||||
|
||||
Pass the host and port of IronFunctions instances in environment variables,
|
||||
this example uses three IronFunctions instances.
|
||||
Pass the host and port of Oracle Functions instances in environment variables,
|
||||
this example uses three Oracle Functions instances.
|
||||
|
||||
```sh
|
||||
export LB_HOST01="172.17.0.1:8080"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
ironfunctions01:
|
||||
functions01:
|
||||
restart: always
|
||||
image: iron/functions
|
||||
ironfunctions02:
|
||||
image: treeder/functions
|
||||
functions02:
|
||||
restart: always
|
||||
image: iron/functions
|
||||
ironfunctions03:
|
||||
image: treeder/functions
|
||||
functions03:
|
||||
restart: always
|
||||
image: iron/functions
|
||||
image: treeder/functions
|
||||
caddy:
|
||||
image: abiosoft/caddy
|
||||
volumes:
|
||||
@@ -14,10 +14,10 @@ caddy:
|
||||
ports:
|
||||
- "9000:9000"
|
||||
environment:
|
||||
- LB_HOST01=ironfunctions01:8080
|
||||
- LB_HOST02=ironfunctions02:8080
|
||||
- LB_HOST03=ironfunctions03:8080
|
||||
- LB_HOST01=functions01:8080
|
||||
- LB_HOST02=functions02:8080
|
||||
- LB_HOST03=functions03:8080
|
||||
links:
|
||||
- ironfunctions01
|
||||
- ironfunctions02
|
||||
- ironfunctions03
|
||||
- functions01
|
||||
- functions02
|
||||
- functions03
|
||||
@@ -1,3 +1,3 @@
|
||||
name: iron/func-caddy-lb
|
||||
name: username/func-caddy-lb
|
||||
build:
|
||||
- ./build.sh
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM iron/ruby:dev
|
||||
FROM funcy/ruby:dev
|
||||
|
||||
WORKDIR /function
|
||||
ADD Gemfile /function/
|
||||
|
||||
@@ -4,7 +4,7 @@ This images compares the payload info with the header.
|
||||
|
||||
## Requirements
|
||||
|
||||
- IronFunctions API
|
||||
- Oracle Functions API
|
||||
|
||||
## Development
|
||||
|
||||
@@ -35,7 +35,7 @@ docker push $USERNAME/func-checker
|
||||
./test.sh
|
||||
```
|
||||
|
||||
## Running it on IronFunctions
|
||||
## Running it on Oracle Functions
|
||||
|
||||
### Let's define some environment variables
|
||||
|
||||
@@ -45,7 +45,7 @@ docker push $USERNAME/func-checker
|
||||
FUNCAPI=YOUR_FUNCTIONS_ADDRESS
|
||||
```
|
||||
|
||||
### Running with IronFunctions
|
||||
### Running with Oracle Functions
|
||||
|
||||
With this command we are going to create an application with name `checker`.
|
||||
|
||||
@@ -71,7 +71,7 @@ curl -X POST --data '{
|
||||
|
||||
#### Testing function
|
||||
|
||||
Now that we created our IronFunction route, let's test our new route
|
||||
Now that we created our Oracle Functions route, let's test our new route
|
||||
|
||||
```
|
||||
curl -X POST --data '{ "env_vars": { "test": "1" } }' http://$FUNCAPI/r/checker/check
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
set -ex
|
||||
|
||||
# build image
|
||||
docker build -t iron/func-checker .
|
||||
docker build -t username/func-checker .
|
||||
@@ -1,3 +1,3 @@
|
||||
name: iron/func-checker
|
||||
name: username/func-checker
|
||||
build:
|
||||
- ./build.sh
|
||||
@@ -6,4 +6,4 @@ set -x
|
||||
PAYLOAD='{"env_vars": {"FOO": "bar"}}'
|
||||
|
||||
# test it
|
||||
echo $PAYLOAD | docker run --rm -i -e TEST=1 -e FOO=bar iron/func-checker
|
||||
echo $PAYLOAD | docker run --rm -i -e TEST=1 -e FOO=bar username/func-checker
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM iron/ruby:dev
|
||||
FROM funcy/ruby:dev
|
||||
|
||||
WORKDIR /function
|
||||
ADD Gemfile /function/
|
||||
|
||||
@@ -4,7 +4,7 @@ This images compares the payload info with the header.
|
||||
|
||||
## Requirements
|
||||
|
||||
- IronFunctions API
|
||||
- Oracle Functions API
|
||||
|
||||
## Development
|
||||
|
||||
@@ -35,7 +35,7 @@ docker push $USERNAME/func-echo
|
||||
./test.sh
|
||||
```
|
||||
|
||||
## Running it on IronFunctions
|
||||
## Running it on Oracle Functions
|
||||
|
||||
### Let's define some environment variables
|
||||
|
||||
@@ -45,7 +45,7 @@ docker push $USERNAME/func-echo
|
||||
FUNCAPI=YOUR_FUNCTIONS_ADDRESS
|
||||
```
|
||||
|
||||
### Running with IronFunctions
|
||||
### Running with Oracle Functions
|
||||
|
||||
With this command we are going to create an application with name `echo`.
|
||||
|
||||
@@ -70,7 +70,7 @@ curl -X POST --data '{
|
||||
|
||||
#### Testing function
|
||||
|
||||
Now that we created our IronFunction route, let's test our new route
|
||||
Now that we created our Oracle Functions route, let's test our new route
|
||||
|
||||
```
|
||||
curl -X POST --data '{"input": "yoooo"}' http://$FUNCAPI/r/echo/echo
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
set -ex
|
||||
|
||||
# build image
|
||||
docker build -t iron/func-echo .
|
||||
docker build -t username/func-echo .
|
||||
@@ -1,3 +1,3 @@
|
||||
name: iron/func-echo
|
||||
name: username/func-echo
|
||||
build:
|
||||
- ./build.sh
|
||||
@@ -6,4 +6,4 @@ set -x
|
||||
PAYLOAD='{"input": "yoooo"}'
|
||||
|
||||
# test it
|
||||
echo $PAYLOAD | docker run --rm -i -e TEST=1 iron/func-echo
|
||||
echo $PAYLOAD | docker run --rm -i -e TEST=1 username/func-echo
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM iron/ruby:dev
|
||||
FROM funcy/ruby:dev
|
||||
|
||||
WORKDIR /worker
|
||||
ADD Gemfile* /worker/
|
||||
|
||||
@@ -4,7 +4,7 @@ This images compares the payload info with the header.
|
||||
|
||||
## Requirements
|
||||
|
||||
- IronFunctions API
|
||||
- Oracle Functions API
|
||||
|
||||
## Development
|
||||
|
||||
@@ -35,7 +35,7 @@ docker push $USERNAME/func-error
|
||||
./test.sh
|
||||
```
|
||||
|
||||
## Running it on IronFunctions
|
||||
## Running it on Oracle Functions
|
||||
|
||||
### Let's define some environment variables
|
||||
|
||||
@@ -45,7 +45,7 @@ docker push $USERNAME/func-error
|
||||
FUNCAPI=YOUR_FUNCTIONS_ADDRESS
|
||||
```
|
||||
|
||||
### Running with IronFunctions
|
||||
### Running with Oracle Functions
|
||||
|
||||
With this command we are going to create an application with name `error`.
|
||||
|
||||
@@ -70,7 +70,7 @@ curl -X POST --data '{
|
||||
|
||||
#### Testing function
|
||||
|
||||
Now that we created our IronFunction route, let's test our new route
|
||||
Now that we created our Oracle Functions route, let's test our new route
|
||||
|
||||
```
|
||||
curl -X POST --data '{"input": "yoooo"}' http://$FUNCAPI/r/error/error
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
docker build -t iron/func-error .
|
||||
docker build -t username/func-error .
|
||||
@@ -1,3 +1,3 @@
|
||||
name: iron/func-error
|
||||
name: username/func-error
|
||||
build:
|
||||
- ./build.sh
|
||||
@@ -6,4 +6,4 @@ set -x
|
||||
PAYLOAD='{"input": "yoooo"}'
|
||||
|
||||
# test it
|
||||
echo $PAYLOAD | docker run --rm -i -e TEST=1 iron/func-error
|
||||
echo $PAYLOAD | docker run --rm -i -e TEST=1 username/func-error
|
||||
@@ -6,10 +6,10 @@ Make sure you downloaded and installed [dotnet](https://www.microsoft.com/net/co
|
||||
dotnet new
|
||||
```
|
||||
|
||||
By default dotnet creates a ```Program.cs``` file with a main method. To make it work with IronFunction's `fn` tool please rename it to ```func.cs```.
|
||||
Now change the code as you desire to do whatever magic you need it to do. Once done you can now create an iron function out of it.
|
||||
By default dotnet creates a ```Program.cs``` file with a main method. To make it work with Oracle Functions's `fn` tool please rename it to ```func.cs```.
|
||||
Now change the code as you desire to do whatever magic you need it to do. Once done you can now create a function out of it.
|
||||
|
||||
## Creating an IronFunction
|
||||
## Creating an Oracle Functions
|
||||
Simply run
|
||||
|
||||
```bash
|
||||
@@ -31,7 +31,7 @@ fn push
|
||||
|
||||
This will create a docker image and push the image to docker.
|
||||
|
||||
## Publishing to IronFunctions
|
||||
## Publishing to Oracle Functions
|
||||
|
||||
```bash
|
||||
fn routes create <app_name> </path>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Quick Example for a Go Function (3 minutes)
|
||||
|
||||
This example will show you how to test and deploy Go (Golang) code to IronFunctions.
|
||||
This example will show you how to test and deploy Go (Golang) code to Oracle Functions.
|
||||
|
||||
```sh
|
||||
# create your func.yaml file
|
||||
@@ -11,11 +11,11 @@ fn build
|
||||
cat hello.payload.json | fn run
|
||||
# push it to Docker Hub
|
||||
fn push
|
||||
# Create a route to this function on IronFunctions
|
||||
# Create a route to this function on Oracle Functions
|
||||
fn routes create myapp /hello
|
||||
```
|
||||
|
||||
Now you can call your function on IronFunctions:
|
||||
Now you can call your function on Oracle Functions:
|
||||
|
||||
```sh
|
||||
curl -H "Content-Type: application/json" -X POST -d @hello.payload.json http://localhost:8080/r/myapp/hello
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Quick Example for a NodeJS Function (4 minutes)
|
||||
|
||||
This example will show you how to test and deploy a Node function to IronFunctions.
|
||||
This example will show you how to test and deploy a Node function to Oracle Functions.
|
||||
|
||||
```sh
|
||||
# create your func.yaml file
|
||||
@@ -11,7 +11,7 @@ fn build
|
||||
cat hello.payload.json | fn run
|
||||
# push it to Docker Hub
|
||||
fn push
|
||||
# Create a route to this function on IronFunctions
|
||||
# Create a route to this function on Oracle Functions
|
||||
fn routes create myapp /hello
|
||||
```
|
||||
|
||||
@@ -24,7 +24,7 @@ Create a [package.json](https://docs.npmjs.com/getting-started/using-a-package.j
|
||||
Run:
|
||||
|
||||
```sh
|
||||
docker run --rm -v "$PWD":/function -w /function iron/node:dev npm install
|
||||
docker run --rm -v "$PWD":/function -w /function funcy/node:dev npm install
|
||||
```
|
||||
|
||||
Then everything should work.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM iron/php
|
||||
FROM funcy/php
|
||||
|
||||
WORKDIR /app
|
||||
ADD . /app
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Quick Example for a PHP Function (4 minutes)
|
||||
|
||||
This example will show you how to test and deploy Go (Golang) code to IronFunctions.
|
||||
This example will show you how to test and deploy Go (Golang) code to Oracle Functions.
|
||||
|
||||
### 1. Prepare the `func.yaml` file:
|
||||
|
||||
@@ -11,7 +11,7 @@ name: USERNAME/hello
|
||||
version: 0.0.1
|
||||
path: /hello
|
||||
build:
|
||||
- docker run --rm -v "$PWD":/worker -w /worker iron/php:dev composer install
|
||||
- docker run --rm -v "$PWD":/worker -w /worker funcy/php:dev composer install
|
||||
```
|
||||
|
||||
The important step here is to ensure you replace `USERNAME` with your Docker Hub account name. Some points of note:
|
||||
@@ -27,7 +27,7 @@ fn build
|
||||
cat hello.payload.json | fn run
|
||||
# push it to Docker Hub
|
||||
fn push
|
||||
# Create a route to this function on IronFunctions
|
||||
# Create a route to this function on Oracle Functions
|
||||
fn routes create phpapp /hello
|
||||
```
|
||||
|
||||
|
||||
@@ -2,4 +2,4 @@ name: USERNAME/hello
|
||||
version: 0.0.1
|
||||
path: /hello
|
||||
build:
|
||||
- docker run --rm -v "$PWD":/worker -w /worker iron/php:dev composer install
|
||||
- docker run --rm -v "$PWD":/worker -w /worker funcy/php:dev composer install
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM iron/python:2
|
||||
FROM funcy/python:2
|
||||
|
||||
WORKDIR /app
|
||||
ADD . /app
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Quick Example for a Python Function (4 minutes)
|
||||
|
||||
This example will show you how to test and deploy Go (Golang) code to IronFunctions.
|
||||
This example will show you how to test and deploy Go (Golang) code to Oracle Functions.
|
||||
|
||||
### 1. Prepare the `func.yaml` file:
|
||||
|
||||
@@ -11,7 +11,7 @@ name: USERNAME/hello
|
||||
version: 0.0.1
|
||||
path: /hello
|
||||
build:
|
||||
- docker run --rm -v "$PWD":/worker -w /worker iron/python:2-dev pip install -t packages -r requirements.txt
|
||||
- docker run --rm -v "$PWD":/worker -w /worker funcy/python:2-dev pip install -t packages -r requirements.txt
|
||||
```
|
||||
|
||||
The important step here is to ensure you replace `USERNAME` with your Docker Hub account name. Some points of note:
|
||||
@@ -27,7 +27,7 @@ fn build
|
||||
cat hello.payload.json | fn run
|
||||
# push it to Docker Hub
|
||||
fn push
|
||||
# Create a route to this function on IronFunctions
|
||||
# Create a route to this function on Oracle Functions
|
||||
fn routes create pythonapp /hello
|
||||
```
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
## Quick Example for a Ruby Function (4 minutes)
|
||||
|
||||
This example will show you how to test and deploy a Ruby function to IronFunctions.
|
||||
This example will show you how to test and deploy a Ruby function to Oracle Functions.
|
||||
|
||||
```sh
|
||||
# create your func.yaml file
|
||||
fn init <YOUR_DOCKERHUB_USERNAME>/hello
|
||||
# install dependencies, we need the json gem to run this
|
||||
docker run --rm -it -v ${pwd}:/worker -w /worker iron/ruby:dev bundle install --standalone --clean
|
||||
docker run --rm -it -v ${pwd}:/worker -w /worker funcy/ruby:dev bundle install --standalone --clean
|
||||
# build the function
|
||||
fn build
|
||||
# test it
|
||||
cat hello.payload.json | fn run
|
||||
# push it to Docker Hub
|
||||
fn push
|
||||
# Create a route to this function on IronFunctions
|
||||
# Create a route to this function on Oracle Functions
|
||||
fn routes create myapp /hello
|
||||
```
|
||||
|
||||
@@ -24,7 +24,7 @@ Now surf to: http://localhost:8080/r/myapp/hello
|
||||
Create a [Gemfile](http://bundler.io/gemfile.html) file in your function directory, then run:
|
||||
|
||||
```sh
|
||||
docker run --rm -it -v ${pwd}:/worker -w /worker iron/ruby:dev bundle install --standalone --clean
|
||||
docker run --rm -it -v ${pwd}:/worker -w /worker funcy/ruby:dev bundle install --standalone --clean
|
||||
```
|
||||
|
||||
Ruby doesn't pick up the gems automatically, so you'll have to add this to the top of your `func.rb` file:
|
||||
@@ -38,7 +38,7 @@ Open `func.rb` to see it in action.
|
||||
To update dependencies:
|
||||
|
||||
```sh
|
||||
docker run --rm -it -v ${pwd}:/worker -w /worker iron/ruby:dev bundle update
|
||||
docker run --rm -it -v ${pwd}:/worker -w /worker funcy/ruby:dev bundle update
|
||||
# then install again to vendor them
|
||||
docker run --rm -it -v ${pwd}:/worker -w /worker iron/ruby:dev bundle update
|
||||
docker run --rm -it -v ${pwd}:/worker -w /worker funcy/ruby:dev bundle update
|
||||
```
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
# Using rust with functions
|
||||
|
||||
The easiest way to create a iron function in rust is via ***cargo*** and ***fn***.
|
||||
The easiest way to create a function in rust is via ***cargo*** and ***fn***.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
First create an epty rust project as follows:
|
||||
|
||||
```bash
|
||||
cargo init --name func --bin
|
||||
```
|
||||
|
||||
Make sure the project name is ***func*** and is of type ***bin***. Now just edit your code, once done you can create an iron function.
|
||||
Make sure the project name is ***func*** and is of type ***bin***. Now just edit your code, once done you can create a function.
|
||||
|
||||
## Creating a function
|
||||
|
||||
## Creating an IronFunction
|
||||
Simply run
|
||||
|
||||
```bash
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Middleware Example
|
||||
|
||||
This example adds a simple authentication middleware to IronFunctions. See [main.go](main.go) for example code.
|
||||
This example adds a simple authentication middleware to Oracle Functions. See [main.go](main.go) for example code.
|
||||
|
||||
## Building and Running
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ fn build
|
||||
./test.sh
|
||||
# Push it to Docker Hub
|
||||
fn push
|
||||
# Create routes to this function on IronFunctions
|
||||
# Create routes to this function on Oracle Functions
|
||||
fn apps create <YOUR_APP> --config SERVER=<POSTGRES>
|
||||
fn routes create --config TABLE=<TABLE_NAME> --config COMMAND=INSERT <YOUR_APP> /<TABLE_NAME>/insert
|
||||
fn routes create --config TABLE=<TABLE_NAME> --config COMMAND=SELECT <YOUR_APP> /<TABLE_NAME>/select
|
||||
```
|
||||
|
||||
Now you can call your function on IronFunctions:
|
||||
Now you can call your function on Oracle Functions:
|
||||
|
||||
```
|
||||
echo <JSON_RECORD> | fn call /<YOUR_APP>/<TABLE_NAME>/insert
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM iron/go
|
||||
FROM funcy/go
|
||||
|
||||
ADD func .
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ This function basically executes a GET/SET in a given redis server.
|
||||
## Requirements
|
||||
|
||||
- Redis Server
|
||||
- IronFunctions API
|
||||
- Functions API
|
||||
|
||||
## Development
|
||||
|
||||
@@ -36,7 +36,7 @@ docker push $USERNAME/func-redis
|
||||
./test.sh
|
||||
```
|
||||
|
||||
## Running it on IronFunctions
|
||||
## Running it on Oracle Functions
|
||||
|
||||
### Let's define some environment variables
|
||||
|
||||
@@ -53,7 +53,7 @@ REDIS=YOUR_REDIS_ADDRESS
|
||||
REDIS_AUTH=REDIS_AUTH_KEY
|
||||
```
|
||||
|
||||
### Running with IronFunctions
|
||||
### Running with Oracle Functions
|
||||
|
||||
With this command we are going to create an application with name `redis`.
|
||||
|
||||
@@ -101,7 +101,7 @@ curl -X POST --data '{
|
||||
|
||||
#### Testing function
|
||||
|
||||
Now that we created our IronFunction route, let's test our new route
|
||||
Now that we created our Oracle Functions route, let's test our new route
|
||||
|
||||
```
|
||||
curl -X POST --data '{"key": "name", "value": "Johnny"}' http://$FUNCAPI/r/redis/set
|
||||
|
||||
@@ -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-redis .
|
||||
docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG funcy/go:dev go build -o func
|
||||
docker build -t username/func-redis .
|
||||
@@ -1,3 +1,3 @@
|
||||
name: iron/func-redis
|
||||
name: username/func-redis
|
||||
build:
|
||||
- ./build.sh
|
||||
@@ -14,8 +14,8 @@ docker rm test-redis-func
|
||||
|
||||
docker run -p 6379:6379 --name test-redis-func -d redis
|
||||
|
||||
echo $PAYLOAD | docker run --rm -i -e SERVER=redis:6379 -e COMMAND=SET --link test-redis-func:redis iron/func-redis
|
||||
echo $PAYLOAD | docker run --rm -i -e SERVER=redis:6379 -e COMMAND=GET --link test-redis-func:redis iron/func-redis
|
||||
echo $PAYLOAD | docker run --rm -i -e SERVER=redis:6379 -e COMMAND=SET --link test-redis-func:redis username/func-redis
|
||||
echo $PAYLOAD | docker run --rm -i -e SERVER=redis:6379 -e COMMAND=GET --link test-redis-func:redis username/func-redis
|
||||
|
||||
docker stop test-redis-func
|
||||
docker rm test-redis-func
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM iron/lambda-nodejs
|
||||
FROM username/lambda-nodejs
|
||||
|
||||
ADD example.js ./example.js
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
IMAGE=iron/lambda-node-aws-example
|
||||
IMAGE=username/lambda-node-aws-example
|
||||
|
||||
create: Dockerfile
|
||||
docker build -t $(IMAGE) .
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Quick Example for a SlackBot command in Ruby
|
||||
|
||||
This example will show you how to test and deploy a SlackBot command to IronFunctions.
|
||||
This example will show you how to test and deploy a SlackBot command to Oracle Functions.
|
||||
|
||||
```sh
|
||||
# create your func.yaml file
|
||||
@@ -11,7 +11,7 @@ fn build
|
||||
cat slack.payload | fn run
|
||||
# push it to Docker Hub
|
||||
fn push
|
||||
# Create a route to this function on IronFunctions
|
||||
# Create a route to this function on Oracle Functions
|
||||
fn routes create slackbot /guppy
|
||||
# Change the route response header content-type to application/json
|
||||
fn routes headers set slackbot /guppy Content-Type application/json
|
||||
@@ -21,7 +21,7 @@ cat slack.payload | fn call slackbot /guppy
|
||||
|
||||
## Create a Slash Command integration in Slack
|
||||
|
||||
In Slack, go to Integrations, find Slash Commands, click Add, type in / as the command then click Add again. On the next page, take the IronFunctions route URL and paste it into the URL field then click Save Integration.
|
||||
In Slack, go to Integrations, find Slash Commands, click Add, type in / as the command then click Add again. On the next page, take the Oracle Functions route URL and paste it into the URL field then click Save Integration.
|
||||
|
||||
If running in localhost, use [ngrok](https://github.com/inconshreveable/ngrok).
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM iron/ruby:dev
|
||||
FROM funcy/ruby:dev
|
||||
|
||||
WORKDIR /function
|
||||
ADD Gemfile* /function/
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
name: iron/sleeper
|
||||
name: username/sleeper
|
||||
version: 0.0.3
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Example of IronFunctions test framework - running functions locally
|
||||
# Example of Oracle Functions test framework - running functions locally
|
||||
|
||||
This example will show you how to run a test suite on a function.
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Example of IronFunctions test framework - running functions remotely
|
||||
# Example of Oracle Functions test framework - running functions remotely
|
||||
|
||||
This example will show you how to run a test suite on a function.
|
||||
|
||||
```sh
|
||||
# build the test image (iron/functions-testframework:0.0.1)
|
||||
# build the test image (username/functions-testframework:0.0.1)
|
||||
fn build
|
||||
# push it
|
||||
fn push
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: iron/functions-testframework
|
||||
name: treeder/functions-testframework
|
||||
version: 0.0.1
|
||||
runtime: go
|
||||
entrypoint: ./func
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM iron/go
|
||||
FROM funcy/go
|
||||
|
||||
ADD func .
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ This function exemplifies an authentication in Twitter API and get latest tweets
|
||||
|
||||
## Requirements
|
||||
|
||||
- IronFunctions API
|
||||
- Oracle Functions API
|
||||
- Configure a [Twitter App](https://apps.twitter.com/) and [configure Customer Access and Access Token](https://dev.twitter.com/oauth/overview/application-owner-access-tokens).
|
||||
|
||||
## Development
|
||||
@@ -36,7 +36,7 @@ docker push $USERNAME/func-twitter
|
||||
./test.sh
|
||||
```
|
||||
|
||||
## Running it on IronFunctions
|
||||
## Running it on Oracle Functions
|
||||
|
||||
### Let's define some environment variables
|
||||
|
||||
@@ -51,7 +51,7 @@ ACCESS_TOKEN="XXXXXX"
|
||||
ACCESS_SECRET="XXXXXX"
|
||||
```
|
||||
|
||||
### Running with IronFunctions
|
||||
### Running with Oracle Functions
|
||||
|
||||
With this command we are going to create an application with name `twitter`.
|
||||
|
||||
@@ -82,7 +82,7 @@ curl -X POST --data '{
|
||||
|
||||
#### Testing function
|
||||
|
||||
Now that we created our IronFunction route, let's test our new route
|
||||
Now that we created our Oracle Functions route, let's test our new route
|
||||
|
||||
```
|
||||
curl -X POST --data '{"username": "getiron"}' http://$FUNCAPI/r/twitter/tweets
|
||||
|
||||
@@ -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-twitter .
|
||||
docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG funcy/go:dev go build -o func
|
||||
docker build -t username/func-twitter .
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
name: iron/func-twitter
|
||||
name: username/func-twitter
|
||||
build:
|
||||
- ./build.sh
|
||||
@@ -3,7 +3,7 @@ set -x
|
||||
|
||||
./build.sh
|
||||
|
||||
PAYLOAD='{"username": "getiron"}'
|
||||
PAYLOAD='{"username": "joe"}'
|
||||
|
||||
# test it
|
||||
echo $PAYLOAD | docker run --rm -i iron/func-twitter
|
||||
echo $PAYLOAD | docker run --rm -i username/func-twitter
|
||||
Reference in New Issue
Block a user