-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade to latest version of connector-sdk * Add build, push and travis files (Copied from kafka-connector)
- Loading branch information
1 parent
ea5afc9
commit 5fa718d
Showing
53 changed files
with
6,200 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
redirect: https://raw.githubusercontent.com/openfaas/faas/master/.DEREK.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
nats-connector | ||
.ash_history | ||
connector | ||
nats-connector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
sudo: required | ||
|
||
language: go | ||
|
||
go: | ||
- "1.10.x" | ||
|
||
services: | ||
- docker | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- docker-ce | ||
|
||
script: | ||
- make build | ||
|
||
after_success: | ||
- if [ -z $DOCKER_NS ] ; then | ||
export DOCKER_NS=openfaas; | ||
fi | ||
|
||
- if [ ! -z "$TRAVIS_TAG" ] ; then | ||
docker tag $DOCKER_NS/nats-connector:latest-dev $DOCKER_NS/nats-connector:$TRAVIS_TAG; | ||
echo $DOCKER_PASSWORD | docker login -u=$DOCKER_USERNAME --password-stdin; | ||
docker push $DOCKER_NS/nats-connector:$TRAVIS_TAG; | ||
|
||
docker tag $DOCKER_NS/nats-connector:latest-dev quay.io/$DOCKER_NS/nats-connector:$TRAVIS_TAG; | ||
echo $QUAY_PASSWORD | docker login -u=$QUAY_USERNAME --password-stdin quay.io; | ||
docker push quay.io/$DOCKER_NS/nats-connector:$TRAVIS_TAG; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM golang:1.10 | ||
RUN mkdir -p /go/src/github.com/openfaas-incubator/nats-connector | ||
WORKDIR /go/src/github.com/openfaas-incubator/nats-connector | ||
|
||
COPY vendor vendor | ||
COPY main.go . | ||
|
||
# Run a gofmt and exclude all vendored code. | ||
RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*"))" | ||
|
||
RUN go test -v ./... | ||
|
||
# Stripping via -ldflags "-s -w" | ||
RUN GOARM=7 CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-s -w" -installsuffix cgo -o ./connector | ||
|
||
CMD ["./connector"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
TAG?=latest-dev | ||
NAMESPACE?=openfaas | ||
.PHONY: build | ||
|
||
build: | ||
./build.sh $(TAG) | ||
|
||
ci-armhf-build: | ||
./build.sh $(TAG) | ||
|
||
ci-armhf-push: | ||
./build.sh $(TAG) | ||
|
||
push: | ||
./push.sh $(TAG) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
export dockerfile="Dockerfile" | ||
export arch=$(uname -m) | ||
export TAG="latest" | ||
|
||
if [ "$arch" = "armv7l" ]; then | ||
dockerfile="Dockerfile.armhf" | ||
TAG="latest-armhf-dev" | ||
fi | ||
|
||
if [ "$1" ]; then | ||
TAG=$1 | ||
if [ "$arch" = "armv7l" ]; then | ||
TAG="$1-armhf" | ||
fi | ||
fi | ||
|
||
if [ -z "$NAMESPACE" ]; then | ||
NAMESPACE="openfaas" | ||
fi | ||
|
||
docker build -t $NAMESPACE/nats-connector:$TAG . -f $dockerfile --no-cache | ||
#(cd yaml && docker service rm nats_connector ; docker stack deploy nats -c connector-swarm.yml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
module github.com/openfaas-incubator/nats-connector | ||
|
||
require ( | ||
github.com/nats-io/go-nats v1.6.0 | ||
github.com/golang/protobuf v1.3.1 // indirect | ||
github.com/nats-io/gnatsd v1.4.1 // indirect | ||
github.com/nats-io/go-nats v1.7.2 | ||
github.com/nats-io/nkeys v0.0.2 // indirect | ||
github.com/nats-io/nuid v1.0.0 // indirect | ||
github.com/openfaas-incubator/connector-sdk v0.0.0-20181118154933-2db120a2ec4b | ||
github.com/openfaas-incubator/connector-sdk v0.0.0-20190611163053-d4baf95d4c62 | ||
github.com/openfaas/faas v0.0.0-20181122165013-495cf9e7aff0 // indirect | ||
github.com/openfaas/faas-provider v0.0.0-20181104131730-8b3147b013c6 // indirect | ||
github.com/pkg/errors v0.8.1 // indirect | ||
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
github.com/nats-io/go-nats v1.6.0 h1:FznPwMfrVwGnSCh7JTXyJDRW0TIkD4Tr+M1LPJt9T70= | ||
github.com/nats-io/go-nats v1.6.0/go.mod h1:+t7RHT5ApZebkrQdnn6AhQJmhJJiKAvJUio1PiiCtj0= | ||
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= | ||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= | ||
github.com/nats-io/gnatsd v1.4.1 h1:RconcfDeWpKCD6QIIwiVFcvForlXpWeJP7i5/lDLy44= | ||
github.com/nats-io/gnatsd v1.4.1/go.mod h1:nqco77VO78hLCJpIcVfygDP2rPGfsEHkGTUk94uh5DQ= | ||
github.com/nats-io/go-nats v1.7.2 h1:cJujlwCYR8iMz5ofZSD/p2WLW8FabhkQ2lIEVbSvNSA= | ||
github.com/nats-io/go-nats v1.7.2/go.mod h1:+t7RHT5ApZebkrQdnn6AhQJmhJJiKAvJUio1PiiCtj0= | ||
github.com/nats-io/nkeys v0.0.2 h1:+qM7QpgXnvDDixitZtQUBDY9w/s9mu1ghS+JIbsrx6M= | ||
github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= | ||
github.com/nats-io/nuid v1.0.0 h1:44QGdhbiANq8ZCbUkdn6W5bqtg+mHuDE4wOUuxxndFs= | ||
github.com/nats-io/nuid v1.0.0/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= | ||
github.com/openfaas-incubator/connector-sdk v0.0.0-20181118154933-2db120a2ec4b h1:XRljIkAJNgYWzx5py2w/fRHPVuRS0/5kSXSlPTT/Evw= | ||
github.com/openfaas-incubator/connector-sdk v0.0.0-20181118154933-2db120a2ec4b/go.mod h1:jHCtd1HCZwhuwdPy4OB8CQU7ZqzxBdWNhIhH/khCJqQ= | ||
github.com/openfaas-incubator/connector-sdk v0.0.0-20190611163053-d4baf95d4c62 h1:NoF7kLOXQIeKRTbqa6ZOG8u+e5Ptng7aSA+R33BFKl0= | ||
github.com/openfaas-incubator/connector-sdk v0.0.0-20190611163053-d4baf95d4c62/go.mod h1:jHCtd1HCZwhuwdPy4OB8CQU7ZqzxBdWNhIhH/khCJqQ= | ||
github.com/openfaas/faas v0.0.0-20181122165013-495cf9e7aff0 h1:4+fM0yvoGK5uhdI3kKLzJ8bZTmcyss2FAU6hfpEXh84= | ||
github.com/openfaas/faas v0.0.0-20181122165013-495cf9e7aff0/go.mod h1:E0m2rLup0Vvxg53BKxGgaYAGcZa3Xl+vvL7vSi5yQ14= | ||
github.com/openfaas/faas-provider v0.0.0-20181104131730-8b3147b013c6 h1:PGmPk5iR8IY2Gl4SlMd2+o4sUmeEFBGFy0SmJoxSIlU= | ||
github.com/openfaas/faas-provider v0.0.0-20181104131730-8b3147b013c6/go.mod h1:W4OIp33RUOpR7wW+omJB/7GhIydRmYXvKf/VqUKI4yM= | ||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= | ||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= | ||
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= | ||
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= | ||
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb h1:fgwFCsaw9buMuxNd6+DQfAuSFqbNiQZpcgJQAgJsK6k= | ||
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
if [ -z "$NAMESPACE" ]; then | ||
NAMESPACE="openfaas" | ||
fi | ||
|
||
docker push $NAMESPACE/nats-connector:$TAG |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.