Skip to content

Commit

Permalink
add health check for bldr-web
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan L Smith committed Mar 10, 2016
1 parent ce1251d commit 3b29ad2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
4 changes: 1 addition & 3 deletions demo/demoscript.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,8 @@ dockerize chef/rust

Talk about how easy it is for a developer to write a health check that gets invoked by the sidecar:

FIXME: We ought not talk about hana, per SAP's request. Use another example.

```
cat plans/hana/hooks/health_check
cat plans/bldr-web/hooks/health_check
```

# To-Do on Gossip
Expand Down
19 changes: 19 additions & 0 deletions plans/bldr-web/hooks/health_check
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

set -x

# default return code is 0
rc=0

curl --head --fail --max-time 1 http://localhost

case $? in
# Zero exit status means curl got back a 200 end everything is ok.
0)
rc=0 ;;
# Anything else is critical
*)
rc=2 ;;
esac

exit $rc
2 changes: 1 addition & 1 deletion plans/bldr-web/plan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pkg_maintainer="The Bldr Maintainers <[email protected]>"
pkg_license=('Apache2')
pkg_filename=${pkg_name}-${pkg_version}.tar.bz2
pkg_gpg_key=3853DA6B
pkg_deps=(chef/glibc chef/bldr chef/pcre chef/nginx)
pkg_deps=(chef/glibc chef/bldr chef/curl chef/pcre chef/nginx)
pkg_build_deps=(chef/node chef/coreutils chef/phantomjs chef/python2
chef/make chef/gcc chef/gcc-libs)
pkg_lib_dirs=(lib)
Expand Down

1 comment on commit 3b29ad2

@chef-delivery
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delivery Status:

Verify Build Acceptance
Unit Unit Provision
Lint Lint Deploy
Syntax Syntax Smoke
Quality Functional
Security
Publish

Please sign in to comment.