mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
fn: sleeper image is now deprecated (#736)
Please use fn-test-utils instead for testing.
This commit is contained in:
committed by
Reed Allman
parent
f76648a18a
commit
6b5486c699
2
images/sleeper/.gitignore
vendored
2
images/sleeper/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
bundle/
|
||||
.bundle/
|
||||
@@ -1,9 +0,0 @@
|
||||
FROM fnproject/ruby:dev
|
||||
|
||||
WORKDIR /function
|
||||
ADD Gemfile* /function/
|
||||
RUN bundle install
|
||||
|
||||
ADD . /function/
|
||||
|
||||
ENTRYPOINT ["ruby", "func.rb"]
|
||||
@@ -1,3 +0,0 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'json', '> 1.8.2'
|
||||
@@ -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
|
||||
```
|
||||
@@ -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
|
||||
@@ -1,2 +0,0 @@
|
||||
name: fnproject/sleeper
|
||||
version: 0.0.4
|
||||
@@ -1,5 +0,0 @@
|
||||
set -e
|
||||
|
||||
docker build -t fnproject/sleeper:latest .
|
||||
|
||||
docker push fnproject/sleeper:latest
|
||||
Reference in New Issue
Block a user