From 184164656ef2b57b6c8285ad3ac15b2ce2b13e20 Mon Sep 17 00:00:00 2001 From: Liam Stanley Date: Sat, 29 Dec 2018 23:50:12 -0500 Subject: [PATCH] readme, travisci, goreleaser --- .goreleaser.yml | 26 +++++++++++ .travis.yml | 25 +++++++++++ Makefile | 2 +- README_TPL.md | 116 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 .goreleaser.yml create mode 100644 .travis.yml create mode 100644 README_TPL.md diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..90eae51 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,26 @@ +# goreleaser.yml +project_name: arlo-dl +build: + binary: arlo-dl + goos: + - linux + - windows + goarch: + - amd64 + ldflags: -s -w -X main.version=v{{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} +nfpm: + homepage: https://github.com/lrstanley/arlo-dl + maintainer: Liam Stanley + description: arlo-dl -- cli tool for downloading arlo recordings and saving them to a file + license: MIT + formats: + - rpm + - deb + bindir: /usr/bin +archive: + format: tar.gz + format_overrides: + - goos: windows + format: zip +snapshot: + name_template: snapshot-{{.Commit}} diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7a75bb1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +language: go +go: +- 1.11.x +- tip +before_install: +- go get -v golang.org/x/lint/golint +script: +- make +- GORACE="exitcode=1 halt_on_error=1" go test -v -coverprofile=coverage.txt -race -timeout 3m -count 3 -cpu 1,4 +- $HOME/gopath/bin/golint -min_confidence 0.9 -set_exit_status +after_success: + - bash <(curl -s https://codecov.io/bash) +branches: + only: + - master +notifications: + irc: + channels: + - irc.byteirc.org#/dev/null + template: + - "%{repository} #%{build_number} %{branch}/%{commit}: %{author} -- %{message} + %{build_url}" + on_success: change + on_failure: change + skip_join: false diff --git a/Makefile b/Makefile index 99373be..f6820af 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ clean: ## Cleans up generated files/folders from the build. /bin/rm -rfv "dist/" "${BINARY}" build: fetch clean ## Compile and generate a binary. - go build -ldflags '-d -s -w' -tags netgo -installsuffix netgo -v -x -o "${BINARY}" + go build -ldflags '-s -w' -tags netgo -installsuffix netgo -v -o "${BINARY}" debug: fetch clean go run *.go diff --git a/README_TPL.md b/README_TPL.md new file mode 100644 index 0000000..3e383f4 --- /dev/null +++ b/README_TPL.md @@ -0,0 +1,116 @@ +

arlo-dl -- cli tool for downloading arlo recordings and saving them to a file

+

+ Build Status + IRC Chat +

+ +## Table of Contents +- [Installation](#installation) + - [Ubuntu/Debian](#ubuntudebian) + - [CentOS/Redhat](#centosredhat) + - [Manual Install](#manual-install) + - [Build from source](#build-from-source) +- [Usage](#usage) +- [Contributing](#contributing) +- [TODO](#todo) +- [License](#license) + +## Installation + +Check out the [releases](https://github.com/lrstanley/arlo-dl/releases) +page for prebuilt versions. arlo-dl should work on ubuntu/debian, +centos/redhat/fedora, etc. Below are example commands of how you would install +the utility. + +### Ubuntu/Debian + +```bash +$ wget https://liam.sh/ghr/arlo-dl_[[tag]]_[[os]]_[[arch]].deb +$ dpkg -i arlo-dl_[[tag]]_[[os]]_[[arch]].deb +$ arlo-dl --help +``` + +### CentOS/Redhat + +```bash +$ yum localinstall https://liam.sh/ghr/arlo-dl_[[tag]]_[[os]]_[[arch]].rpm +$ arlo-dl --help +``` + +Some older CentOS versions may require (if you get `Cannot open: . Skipping.`): + +```console +$ wget https://liam.sh/ghr/arlo-dl_[[tag]]_[[os]]_[[arch]].rpm +$ yum localinstall arlo-dl_[[tag]]_[[os]]_[[arch]].rpm +``` + +### Manual Install + +```bash +$ wget https://liam.sh/ghr/arlo-dl_[[tag]]_[[os]]_[[arch]].tar.gz +$ tar -C /usr/bin/ -xzvf arlo-dl_[[tag]]_[[os]]_[[arch]].tar.gz arlo-dl +$ chmod +x /usr/bin/arlo-dl +$ arlo-dl --help +``` + +### Source + +Note that you must have [Go](https://golang.org/doc/install) installed (`v1.11.1` required). + + $ git clone https://github.com/lrstanley/arlo-dl.git && cd arlo-dl + $ make + $ ./arlo-dl --help + +## Usage + +The default configuration path is `/etc/arlo-dl.yaml` when using `deb`/`rpm`. +If you are not using these package formats, copy the example config file, +`example.arlo-dl.yaml`, to `arlo-dl.yaml`. + +``` +$ ./arlo-dl --help +Usage: + arlo-dl [OPTIONS] + +Application Options: + -l, --log-path=PATH Optional path to log output to + -c, --config=PATH Path to configuration file (default: ./arlo-dl.yaml) + +Help Options: + -h, --help Show this help message +``` + +## Contributing + +Please review the [CONTRIBUTING](CONTRIBUTING.md) doc for submitting issues/a guide +on submitting pull requests and helping out. + +## TODO + + - [ ] add documentation flags for filename templating. + +## License + +``` +MIT License + +Copyright (c) 2018 Liam Stanley + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +```