From 1ed700edbb88e2686fbbe02c50f8608bb2a338a8 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Sun, 25 Aug 2019 16:31:52 +0200 Subject: [PATCH] fix(README): adapt the README file to the current flucky source code --- Makefile | 30 ++++++++++++++++--- README.md | 87 ++++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 102 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index db4323c..3b53bca 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,13 @@ GID?=$(shell id --group) # value is taken. VERSION:=$(or ${TRAVIS_TAG}, $(shell git rev-parse --short HEAD)-git) +# CONTAINER_RUNTIME CONTAINER_RUNTIME?=$(shell which docker) +# BUILD_IMAGE +BUILD_IMAGE:=volkerraschek/build-image:latest + +# GO ENVIRONMENT GOARCH?=amd64 GOOS?=linux @@ -20,11 +25,20 @@ go-build: bindata GOOS=${GOOS} \ GOARCH=${GOARCH} \ go build -ldflags "-X main.version=${VERSION}" - chown -R ${UID}:${GID} * + chown ${UID}:${GID} ./* go-test: go-build go test -v ./pkg/... +rpm-build: go-build + rpm-builder \ + --arch x86_64 \ + --compression gzip \ + --exec-file "flucky:/usr/bin/flucky" \ + --file "systemd/flucky.service:/usr/lib/systemd/system/flucky.service" \ + --version ${VERSION} \ + flucky-${VERSION} + bindata: go-bindata -pkg db -o ./pkg/db/bindataSQL.go ./pkg/db/sql/*** go-bindata -pkg goldenfiles -o ./test/goldenfiles/bindata.go ./test/goldenfiles/json/*** @@ -35,12 +49,20 @@ container-go-build: container-go-test: $(MAKE) container-run COMMAND=go-test +container-rpm-build: + $(MAKE) container-run COMMAND=rpm-build + container-run: ${CONTAINER_RUNTIME} run \ - --volume ${PWD}:/workspace \ --rm \ - volkerraschek/build-image:latest\ - make ${COMMAND} UID=${UID} GID=${GID} VERSION=${VERSION} GOOS=${GOOS} GOARCH=${GOARCH} + --volume ${PWD}:/workspace \ + ${BUILD_IMAGE} \ + make ${COMMAND} \ + UID=${UID} \ + GID=${GID} \ + VERSION=${VERSION} \ + GOOS=${GOOS} \ + GOARCH=${GOARCH} remote: $(MAKE) go-build GOARCH=arm diff --git a/README.md b/README.md index 2fea979..5015025 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,88 @@ # flucky [![Build Status](https://travis-ci.com/go-flucky/flucky.svg?branch=master)](https://travis-ci.com/go-flucky/flucky) -Flucky is a lightweight program written in go for reading data from sensors with a raspberry pi. -## Compiling -Flucky can be compiled directly with go. +Flucky is a lightweight program written in go for reading data from sensors, for +example with a banana or raspberry pi. In addition, flucky provides a REST-API +to receive from other flucky installations measured values. The measured values +can be saved in a logfile or into a database. Currently is only postgres +supported. + +## Installation + +Flucky can be installed over multiple ways, for example with your local package +manager from your linux distribution. At the moment it's only the rpm package +format supported. Alternatively the source code can be compiled to get the +flucky binary. + +### RPM-Package + +To install flucky over a RPM package you can download a specific version from +github.com or configure the RPM-Mirror. + +#### RPM-Mirror ```bash -$ go get -u github.com/go-flucky/flucky +$ cat > /etc/yum.repos.d/flucky.rpm <= v1.12. Execute `make go-build` to compile +flucky without a container-image. There should be a similar output as when +compiling flucky via the container image. + +## Enhancements + ++ Provide flucky additionally as AUR and deb package