Skip to content

Commit

Permalink
Use NATS Streaming server and more... (#2)
Browse files Browse the repository at this point in the history
- switch to use nats streaming
- Better handling of EOF and Ctrl+c
- Enable multi-platform CI builds
- Enable auto-releases on tag
- Improve readme with NATS instructions
- Remove configure.go
- Get versions and run build in CI
- Modifications to .travis.yml
  • Loading branch information
derekbekoe authored Feb 23, 2019
1 parent c51eb56 commit b82be04
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 213 deletions.
34 changes: 34 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
sudo: false

language: go

go_import_path: github.com/derekbekoe/convey

go:
- 1.11.x

os:
- linux
- osx
- windows

gobuild_args: -v -race -x -ldflags "-X github.com/derekbekoe/convey/cmd.VersionGitCommit=$TRAVIS_COMMIT -X github.com/derekbekoe/convey/cmd.VersionGitTag=$TRAVIS_TAG"

before_install:
- go get github.com/mitchellh/gox

script:
- go test ${gobuild_args} ./...
- mkdir bin
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then gox ${gobuild_args} -os="linux" -arch="amd64" -output="bin/{{.Dir}}_{{.OS}}_{{.Arch}}"; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then gox ${gobuild_args} -os="darwin" -arch="amd64" -output="bin/{{.Dir}}_{{.OS}}_{{.Arch}}"; fi
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then gox ${gobuild_args} -os="windows" -arch="amd64" -output="bin/{{.Dir}}_{{.OS}}_{{.Arch}}"; fi

deploy:
provider: releases
skip_cleanup: true
api_key:
secure: eIvDPtgI3JxtqsIPZ71nLb99CJyolcVRhKQtF+CWdzwJalhFsa2JwvmCZ3rM+f1I8t5vjDnULjCa8Xqdp3eiXPv9uR/VUiiQMj+UtrQTMzi2rAZujV5ZEfG871TaSvpALjmP1oqDzG6l94322sUV2CFgqXIDXgLEezmGaXW0SgOvdJc3+rfTinN4J/lEtCzinuQzXtbNJBO3MzYQLqOCJxK54zLNkGid+9HirseF5Ebe/t0XBUX+TCP3+dsy6tQMpQYQdo6b7EwDrknIgfof4KhAfCQFVlGRF/mrxxAZH4Dc0oQl7p9FxjCi/rDTzwTtKe3Ag6zc4a6Yw/FkFjMWeIHBuJN6McDY5br2KQD+FYnvIE2wuITRPIn8K5VzdkIBLEJ9LGPZ/KVlMLDkhvss9iRZOp8VALniAjPy9QJ1Dzpb4EGIAYmK2ZoYI8fi+jr6GiBbkrb7g/ggocJDURH86NVOwMdayTDzwlLPVizhTC7kxXX2kLnjQlbSGJdffLlpG1xbG/eLkwqU/NbiA5OKQDGA1+a3GKR1+aJxH35HF1JOtdaJgF8nq4sqNz4Zr6IB1E8j/n4dqixUjM1PF/th4Q04CdyBQ2k6Wu6Xwl/XTuCxZLdCqAwFiHQMtacah8bWRnzso8XKZLN3qKoGN6ia/ybpxaxanQGiTsE/V2vkA5Q=
file:
- bin/convey_windows_amd64.exe
- bin/convey_darwin_amd64
- bin/convey_linux_amd64
on:
repo: derekbekoe/convey
tags: true
47 changes: 45 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,40 @@

A command-line tool that makes sharing pipes between machines easy.

## Download

get.convey.sh/linux

get.convey.sh/windows

This will download the latest release for your platform.

## Usage

In Terminal 1:
```bash
echo "Hello world" | convey
21f50fba373e11e9990a72000872a940
```

In Terminal 2:
```bash
convey 21f50fba373e11e9990a72000872a940
Hello world
```

## Configuration

By default, configuration is loaded from `$HOME/.convey.yaml`.

This is an example of `.convey.yaml`:
```yaml
NatsURL: nats://localhost:4223
NatsClusterID: test-cluster
```
Use the --config flag on the command line to change the config file if needed.
## Development
```bash
go get -u github.com/derekbekoe/convey
Expand All @@ -16,8 +44,23 @@ go run main.go
go build -o bin/convey
```

Cross-compile
## Platform Builds
```bash
env GOOS=linux GOARCH=amd64 go build
go get github.com/mitchellh/gox
gox -ldflags "-X github.com/derekbekoe/convey/cmd.VersionGitCommit=$(git rev-list -1 HEAD) -X github.com/derekbekoe/convey/cmd.VersionGitTag=VERSION" -os="linux darwin" -arch="amd64" -output="bin/{{.Dir}}_{{.OS}}_{{.Arch}}"
```
See https://golang.org/doc/install/source#environment

## Starting NATS Streaming Server

```bash
docker run -p 4223:4223 -p 8223:8223 nats-streaming -p 4223 -m 8223
```

## FAQ

**How do I try it out?**

Start the local container, download convey, specify the configuration then run.

If you'd like to share between multiple devices, host the server in a location where your devices can access.
50 changes: 0 additions & 50 deletions cmd/configure.go

This file was deleted.

Loading

0 comments on commit b82be04

Please sign in to comment.