Skip to content

Commit

Permalink
cleaned up repository, now building also the last container for butto…
Browse files Browse the repository at this point in the history
…n contols via GPIOs
  • Loading branch information
protenhan committed Dec 15, 2018
1 parent d6c7dc9 commit 44fc45f
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 9 deletions.
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ services:
- docker
language: bash
env:
- RFID_MUSICPLAYER=0.3.1
- RFID_MUSICPLAYER=0.4.0
script:
# prepare for cross compiling
- ./prepare_local_build_env.sh
## build rfid reader image
- docker build --build-arg RFID_MUSICPLAYER=$RFID_MUSICPLAYER -f Dockerfile.rfid_reader -t protenhan/rpi-rfid-musicplayer_reader .
## build the main player
- docker build --build-arg RFID_MUSICPLAYER=$RFID_MUSICPLAYER -f Dockerfile.player -t protenhan/rpi-rfid-musicplayer_player .
## build the button controler
- docker build --build-arg RFID_MUSICPLAYER=$RFID_MUSICPLAYER -f Dockerfile.button_control -t protenhan/rpi-rfid-musicplayer_control .
## push the player image
- >
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"
Expand All @@ -24,4 +26,11 @@ script:
docker tag $DOCKER_USER/rpi-rfid-musicplayer_reader $DOCKER_USER/rpi-rfid-musicplayer_reader:$RFID_MUSICPLAYER-alpine
docker push $DOCKER_USER/rpi-rfid-musicplayer_reader:$RFID_MUSICPLAYER-alpine
docker push $DOCKER_USER/rpi-rfid-musicplayer_reader
fi
## push control image
- >
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then docker login -u="$DOCKER_USER" -p="$DOCKER_PASS"
docker tag $DOCKER_USER/rpi-rfid-musicplayer_control $DOCKER_USER/rpi-rfid-musicplayer_control:$RFID_MUSICPLAYER-alpine
docker push $DOCKER_USER/rpi-rfid-musicplayer_control:$RFID_MUSICPLAYER-alpine
docker push $DOCKER_USER/rpi-rfid-musicplayer_control
fi
17 changes: 17 additions & 0 deletions Dockerfile.button_control
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM arm32v6/alpine:3.8
LABEL maintainer="@protenhan"

COPY qemu-arm-static /usr/bin/
RUN apk update &&\
apk -U add \
python3 \
linux-headers \
python3-dev \
gcc \
musl-dev

# Setup for the project
COPY src/button_control/python /button_control/
RUN pip3 install -r /button_control/requirements.txt

CMD ["python3","-u","/button_control/button_control.py"]
2 changes: 1 addition & 1 deletion Dockerfile.rfid_reader
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN apk update &&\
musl-dev

# Setup for the project
COPY src/python/rfid_reader /rfid-musicplayer/
COPY src/rfid_reader/python /rfid-musicplayer/
RUN pip3 install -r /rfid-musicplayer/requirements.txt

CMD ["python3","-u","/rfid-musicplayer/rfid_reader.py"]
9 changes: 9 additions & 0 deletions docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,13 @@ services:
- "/dev/input/by-id/usb-Sycreader_USB_Reader_08FF20150112-event-kbd:/dev/input/by-id/usb-Sycreader_USB_Reader_08FF20150112-event-kbd"
environment:
- RFID_DEVICE_PATH=/dev/input/by-id/usb-Sycreader_USB_Reader_08FF20150112-event-kbd
- PLAYER_HOST=player:8000

button_control:
build:
context: ./
dockerfile: Dockerfile.button_control
devices:
- "/dev/gpiomem:/dev/gpiomem"
environment:
- PLAYER_HOST=player:8000
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@ services:
- "/dev/input/by-id/usb-Sycreader_USB_Reader_08FF20150112-event-kbd:/dev/input/by-id/usb-Sycreader_USB_Reader_08FF20150112-event-kbd"
environment:
- RFID_DEVICE_PATH=/dev/input/by-id/usb-Sycreader_USB_Reader_08FF20150112-event-kbd
- PLAYER_HOST=player:8000

button_control:
image: protenhan/rpi-rfid-musicplayer_control:latest
devices:
- "/dev/gpiomem:/dev/gpiomem"
environment:
- PLAYER_HOST=player:8000
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions src/python/button_control/__init__.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
evdev>=0.7.0
requests>=2.20.1


File renamed without changes.

0 comments on commit 44fc45f

Please sign in to comment.