From 834da2d981dab2e1edf5272206971363291336f9 Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Fri, 21 Feb 2020 21:06:38 +0000 Subject: [PATCH] Rename internal binary Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- Dockerfile | 6 +++--- README.md | 24 ++++++++++++++---------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3c96173..70057a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,12 +13,12 @@ COPY main.go . # Run a gofmt and exclude all vendored code. RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*"))" \ && go test -v ./... \ - && CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o /usr/bin/producer + && CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o /usr/bin/connector FROM alpine:3.11 as ship RUN apk add --no-cache ca-certificates -COPY --from=build /usr/bin/producer /usr/bin/producer +COPY --from=build /usr/bin/connector /usr/bin/connector WORKDIR /root/ -CMD ["/usr/bin/producer"] +CMD ["/usr/bin/connector"] diff --git a/README.md b/README.md index 89e50c2..d844b09 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,12 @@ # nats-connector -[![Go Report Card](https://goreportcard.com/badge/github.com/openfaas-incubator/nats-connector)](https://goreportcard.com/report/github.com/openfaas-incubator/nats-connector) [![Build -Status](https://travis-ci.com/openfaas-incubator/nats-connector.svg?branch=master)](https://travis-ci.org/openfaas-incubator/nats-connector) [![GoDoc](https://godoc.org/github.com/openfaas-incubator/nats-connector?status.svg)](https://godoc.org/github.com/openfaas-incubator/nats-connector) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![Build Status](https://travis-ci.com/openfaas-incubator/nats-connector.svg?branch=master)](https://travis-ci.com/openfaas-incubator/nats-connector) +[![Go Report Card](https://goreportcard.com/badge/github.com/openfaas-incubator/nats-connector)](https://goreportcard.com/report/github.com/openfaas-incubator/nats-connector) +[![GoDoc](https://godoc.org/github.com/openfaas-incubator/nats-connector?status.svg)](https://godoc.org/github.com/openfaas-incubator/nats-connector) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![OpenFaaS](https://img.shields.io/badge/openfaas-serverless-blue.svg)](https://www.openfaas.com) -The NATS connector connects OpenFaaS functions to NATS topics. - -## Building - -``` -export TAG=0.2.0 -make build push -``` +An OpenFaaS event-connector to trigger functions from NATS. ## Try it out @@ -68,6 +63,15 @@ The following instructions show how to run and test `nats-connector` on Kubernet 2019-12-29T19:06:50Z 2019/12/29 19:06:50 received "test message" ``` +## Building + +Build and release is done via CI, but you can also build your own version locally. + +```bash +export TAG=0.2.1 +make build push +``` + ### Configuration Configuration is by environment variable, which can be set in the Kubernetes YAML file: [yaml/kubernetes/connector-dep.yaml](./yaml/kubernetes/connector-dep.yaml)