fn: sleeper image is now deprecated (#736)

Please use fn-test-utils instead for testing.
This commit is contained in:
Tolga Ceylan
2018-02-05 10:01:11 -08:00
committed by Reed Allman
parent f76648a18a
commit 6b5486c699
9 changed files with 10 additions and 59 deletions

View File

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

View File

@@ -1,9 +0,0 @@
FROM fnproject/ruby:dev
WORKDIR /function
ADD Gemfile* /function/
RUN bundle install
ADD . /function/
ENTRYPOINT ["ruby", "func.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,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

View File

@@ -1,2 +0,0 @@
name: fnproject/sleeper
version: 0.0.4

View File

@@ -1,5 +0,0 @@
set -e
docker build -t fnproject/sleeper:latest .
docker push fnproject/sleeper:latest