Updated hello to use stdin.

This commit is contained in:
Travis Reeder
2016-10-06 10:44:27 -07:00
parent c6f81ff921
commit 8390c5dc8e
4 changed files with 13 additions and 5 deletions

View File

@@ -24,7 +24,7 @@ USERNAME=YOUR_DOCKER_HUB_USERNAME
# build it # build it
docker build -t $USERNAME/hello . docker build -t $USERNAME/hello .
# test it # test it
docker run -e 'PAYLOAD={"name": "Johnny"}' $USERNAME/hello echo '{"name":"Johnny"}' | docker run --rm -i $USERNAME/hello
# tag it # tag it
docker run --rm -v "$PWD":/app treeder/bump patch docker run --rm -v "$PWD":/app treeder/bump patch
docker tag $USERNAME/hello:latest $USERNAME/hello:`cat VERSION` docker tag $USERNAME/hello:latest $USERNAME/hello:`cat VERSION`

View File

@@ -1 +1 @@
0.0.27 0.0.29

View File

@@ -2,9 +2,7 @@ require 'json'
name = "World" name = "World"
# payload = STDIN.read payload = STDIN.read
# or using env vars: ENV['PAYLOAD']
payload = ENV['PAYLOAD']
STDERR.puts 'payload: ' + payload.inspect STDERR.puts 'payload: ' + payload.inspect
if payload != "" if payload != ""

10
examples/hello/release.sh Executable file
View File

@@ -0,0 +1,10 @@
USERNAME=iron
# build it
docker build -t $USERNAME/hello .
# test it
echo '{"name":"Johnny"}' | docker run --rm -i $USERNAME/hello
# tag it
docker run --rm -v "$PWD":/app treeder/bump patch
docker tag $USERNAME/hello:latest $USERNAME/hello:`cat VERSION`
# push it
docker push $USERNAME/hello