Skip to content

Commit

Permalink
adding travis CI integration
Browse files Browse the repository at this point in the history
  • Loading branch information
He who is brandon gulla committed Jul 8, 2018
1 parent 7a51eb2 commit 86ccbe4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

group: edge
services:
- docker
language: bash
script:
# prepare qemu
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
# build image
- docker build -t bgulla/apcupsd-influxdb .
- >
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"
docker push bgulla/apcupsd-influxdb
fi
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM jfloff/alpine-python
FROM python:2.7.15-alpine3.7
#FROM jfloff/alpine-python
MAINTAINER Brandon <[email protected]>

RUN apk add --no-cache apcupsd jq curl supervisor
RUN apk add --no-cache apcupsd jq curl supervisor busybox bash
COPY ./conf/requirements.txt /requirements.txt
COPY ./conf/apcupsd.conf /
COPY ./src/app.py /
RUN pip install -r /requirements.txt
COPY ./conf/supervisord.conf /supervisord.conf

COPY ./src/app.py /

CMD ["supervisord", "-n", "-c","/supervisord.conf"]
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# apcupsd-influxdb-exporter

[![Build Status](https://travis-ci.org/bgulla/apcupsd-influxdb-exporter.svg?branch=master)](https://travis-ci.org/bgulla/apcupsd-influxdb-exporter)

Build an x86_64 or ARM compatible Docker image that will output commonly used UPS device statistics to an influxdb database using an included version of the
[APCUPSd](http://www.apcupsd.org/)
tool. Dockerfiles included for both intel and ARM (RaspberryPi or comparable) chipsets.

## How to build
Building the image is straight forward:
* Git clone this repo
* `docker build -t apcupsd-influxdb-exporter -f Dockerfile.arm .`
* `docker build -t apcupsd-influxdb -f Dockerfile.arm .`

## Running
```bash
Expand All @@ -17,7 +20,7 @@ docker run --rm -d --name="apcupsd" \
-e "INFLUXDB_DATABASE=ups" \
-e "INFLUXDB_PORT=8086" \
-e "INFLUXDB_HOST=10.0.1.11" \
-t bgulla/apcupsd-influxdb-exporter
-t bgulla/apcupsd-influxdb
```
Note: if your UPS does not include the NOMPOWER metric, you will need to include the WATTS environment variable in order to compute the live-power consumption
metric.
Expand Down

0 comments on commit 86ccbe4

Please sign in to comment.