Skip to content

Commit

Permalink
Merge pull request #28 from buildkite/add-quiet-to-lambda
Browse files Browse the repository at this point in the history
Add BUILDKITE_QUIET support to lambda
  • Loading branch information
lox authored Mar 6, 2017
2 parents 4b44e5d + 95dc172 commit d3ccd53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ It's entrypoint is `handler.handle`, it requires a `python2.7` environment and m
- BUILDKITE_TOKEN
- BUILDKITE_BACKEND
- BUILDKITE_QUEUE
- BUILDKITE_QUIET

Checkout https://github.com/buildkite/elastic-ci-stack-for-aws/blob/master/templates/metrics.yml for examples of usage.

Expand Down
6 changes: 6 additions & 0 deletions lambda.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"encoding/json"
"io/ioutil"
"log"
"os"
"strings"
Expand All @@ -18,6 +19,11 @@ func handle(evt json.RawMessage, ctx *runtime.Context) (interface{}, error) {
token := os.Getenv("BUILDKITE_TOKEN")
backendOpt := os.Getenv("BUILDKITE_BACKEND")
queue := os.Getenv("BUILDKITE_QUEUE")
quiet := os.Getenv("BUILDKITE_QUIET")

if quiet == "1" || quiet == "false" {
log.SetOutput(ioutil.Discard)
}

config, err := buildkite.NewTokenConfig(token, false)
if err != nil {
Expand Down

0 comments on commit d3ccd53

Please sign in to comment.