From d3c4ca2c7249b2bc04835ac58dec2f610c4be2b2 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Thu, 18 Apr 2019 17:10:03 +0200 Subject: [PATCH] fix: readme --- .travis.yml | 5 +++++ Makefile | 42 ++++++++++++++++++++++++------------------ README.md | 16 +++++++++++++++- 3 files changed, 44 insertions(+), 19 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..021711c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +services: + - docker + +script: + - make docker-build diff --git a/Makefile b/Makefile index 99a5f69..f3f3e51 100644 --- a/Makefile +++ b/Makefile @@ -6,28 +6,34 @@ UID?=$(shell id -u) GID?=$(shell id -g) # VERSION +# UID/GID +# UID or GID is the UNIX user ID or group ID of the user who executes +# make. If the UID or GID is not passed as a make variable, an attempt +# is made to determine it. +UID?=$(shell id -u) +GID?=$(shell id -g) + # If no version is specified as a parameter of make, the last git hash # value is taken. -VERSION ?= "$(shell git rev-parse --short HEAD)-git" +VERSION:=$(or ${TRAVIS_TAG}, ${TRAVIS_TAG}, $(shell git rev-parse --short HEAD)-git) -# PHONY -# A phony target is one that is not really the name of a file; rather it -# is just a name for a recipe to be executed when you make an explicit -# request. -.PHONY: flucky flucky-amd64 flucky-arm +GOARCH?=amd64 +GOOS?=linux # default build -flucky: flucky-amd64 +build: + GOOS=${GOOS} \ + GOARCH=${GOARCH} \ + go build -ldflags "-X main.version=${VERSION}" -# build flucky for amd64 architecture -flucky-amd64: - GOOS=linux \ - GOARCH=amd64 \ - go build -o flucky-amd64 -ldflags "-X main.version=${VERSION}" +docker-build: + docker run \ + --volume ${PWD}:/workspace \ + volkerraschek/build-image:1.0.0 \ + make build VERSION=${VERSION} GOOS=${GOOS} GOARCH=${GOARCH} -# build flucky for arm architecture -flucky-arm: - GOOS=linux \ - GOARCH=arm \ - GOARM=7 \ - go build -o fctl-arm -ldflags "-X main.version=${VERSION}" +docker-sanitized: + docker run \ + --volume ${PWD}:/workspace \ + volkerraschek/build-image:1.0.0 \ + chown ${UID}:${GID} -R /workspace \ No newline at end of file diff --git a/README.md b/README.md index 57fa305..53e3f82 100644 --- a/README.md +++ b/README.md @@ -1 +1,15 @@ -# go-flucky +# flucky [![Build Status](https://travis-ci.com/volker-raschek/flucky.svg?branch=master)](https://travis-ci.com/volker-raschek/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. + +```bash +$ go get -u github.com/volker-raschek/flucky +``` + +Alternatively you can checkout this repository and compile it with make for your architecture. For examample for a raspberry pi with arm architecture. + +```bash +$ make build +``` \ No newline at end of file