Renamed a bunch of images to use fnproject org. (#239)

* Renamed a bunch of images to use fnproject org.

* Multi-stage build for Docker.

* Added tmp vendor dirs to gitignore.

* Run docker-build at beginning of test.
This commit is contained in:
Travis Reeder
2017-08-23 12:43:53 -07:00
committed by Denis Makogon
parent f90879b751
commit f559acd7ed
56 changed files with 126 additions and 203 deletions

View File

@@ -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/funcy/hello -w /go/src/github.com/funcy/hello funcy/go:dev go build -o function
docker run --rm -v "$PWD":/go/src/github.com/fnproject/hello -w /go/src/github.com/fnproject/hello funcy/go:dev go build -o function
docker build -t $USERNAME/func-blog .
```

View File

@@ -1,3 +0,0 @@
bundle/
.bundle/
func.yaml

View File

@@ -1,3 +0,0 @@
source 'https://rubygems.org'
gem 'json', '> 1.8.2'

View File

@@ -1,3 +0,0 @@
# Error Function Image
Raises an error.

View File

@@ -1 +0,0 @@
0.0.1

View File

@@ -1,4 +0,0 @@
#!/bin/bash
set -ex
docker build -t funcy/error .

View File

@@ -1,13 +0,0 @@
require 'json'
payload = STDIN.read
if payload != ""
payload = JSON.parse(payload)
# payload contains checks
if payload["input"]
puts payload["input"]
end
end
raise "Something went terribly wrong!"

View File

@@ -1,5 +0,0 @@
name: funcy/error
version: 0.0.2
runtime: ruby
entrypoint: ruby func.rb
path: /error

View File

@@ -1,9 +0,0 @@
#!/bin/bash
set -x
./build.sh
PAYLOAD='{"input": "yoooo"}'
# test it
echo $PAYLOAD | docker run --rm -i -e TEST=1 username/func-error

View File

@@ -1,2 +0,0 @@
bundle/
.bundle/

View File

@@ -1,9 +0,0 @@
FROM funcy/ruby:dev
WORKDIR /function
ADD Gemfile* /function/
RUN bundle install
ADD . /function/
ENTRYPOINT ["ruby", "function.rb"]

View File

@@ -1,3 +0,0 @@
source 'https://rubygems.org'
gem 'json', '> 1.8.2'

View File

@@ -1,10 +0,0 @@
# Sleeper Function Image
This function sleeps for some number of seconds that you pass in.
Test it with:
```sh
fn build
echo '{"sleep": 5}' | fn run
```

View File

@@ -1,2 +0,0 @@
name: username/sleeper
version: 0.0.3

View File

@@ -1,16 +0,0 @@
require 'json'
payload = STDIN.read
if payload != ""
payload = JSON.parse(payload)
# payload contains checks
if payload["sleep"]
i = payload['sleep'].to_i
STDERR.puts "Sleeping for #{i} seconds..."
sleep i
puts "I'm awake!" # sending this to stdout for sync response
end
else
puts "ERROR: please pass in a sleep value: {\"sleep\": 5}"
end