Set up ARM build
This commit is contained in:
parent
2a568ed2f0
commit
d425aec2e4
3 changed files with 51 additions and 3 deletions
14
.travis.yml
14
.travis.yml
|
@ -5,13 +5,16 @@ services:
|
||||||
- docker
|
- docker
|
||||||
before_script:
|
before_script:
|
||||||
- npm run build
|
- npm run build
|
||||||
- docker build -t cbase/infoscreens:latest .
|
# Prepare cross-compiling environment if targeting ARM
|
||||||
- docker tag cbase/infoscreens:latest "cbase/infoscreens:${TRAVIS_BUILD_NUMBER}"
|
- if [ "$TARGET" == "raspberrypi3" ]; then docker run --rm --privileged multiarch/qemu-user-static:register --reset; fi
|
||||||
|
# Build the Docker image
|
||||||
|
- docker build -t "${DOCKER_IMAGE}:latest" -f $DOCKER_FILE .
|
||||||
|
- docker tag "${DOCKER_IMAGE}:latest" "${DOCKER_IMAGE}:${TRAVIS_BUILD_NUMBER}"
|
||||||
- docker-compose up -d
|
- docker-compose up -d
|
||||||
- docker-compose ps
|
- docker-compose ps
|
||||||
deploy:
|
deploy:
|
||||||
- provider: script
|
- provider: script
|
||||||
script: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && docker push "cbase/infoscreens:latest" && docker push "cbase/infoscreens:${TRAVIS_BUILD_NUMBER}"
|
script: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" && docker push "${DOCKER_IMAGE}:latest" && docker push "${DOCKER_IMAGE}:${TRAVIS_BUILD_NUMBER}"
|
||||||
on:
|
on:
|
||||||
branch: master
|
branch: master
|
||||||
repo: c-base/infoscreens
|
repo: c-base/infoscreens
|
||||||
|
@ -19,3 +22,8 @@ env:
|
||||||
global:
|
global:
|
||||||
- secure: R0ZZ7VmLdTbVtFqB36KtxSn5S1noZH0D577atVfW+CSL35QLcyofoFo9xg223T51yZJyZMFOvxLuD7LZDL4FSBdoC6jfHQ7sluu/ZOCGEfKhxunjzhOjdIlL/zX7iBk03u5QI6qah+iIOohoqb0294qyNRQWa57Ut5lkeqJnsD9fsXrn0eqcC+Mbef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hw3G0zdyAcb0Jw0Hx/U8e90hIFG5UjgYvYDib3ifYoCe8GacT+JUMrRRSG9oM413X5E03f/W1R9tyJ0fh2xbiBhd0U26rwGKuta6OFP+QgQP1JTvlVk1iz+qwhlAsc7p98qyM1BNWNSlnfOBsHAGwY2wYwBPwKy4I+gKZ9HmBdVDrk6CGB6Qvgp0S6sGxJ6LIV4jmK0K9WswbckZLQXFpaxI0lPn/xfKwldS7OLIqxkPMGYbfo08axiJkecX/Vlw/0FmOkqk2SIchqRRi7CnhjOwOBLUuYeF1OzPw61dLUpB05gLKEx3jHqIawtSjPQVY8XZiWnPtmO5yIP4RNQniP43Oaf/0mW7up1+ZjN+/jx0reuhR33+EkCCEmzhB+p1P9LxEXnRpr1RF8p1y47b/JXfEqw=
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- env: TARGET=x86 DOCKER_IMAGE=cbase/infoscreens COMPOSE_FILE=docker-compose.yml DOCKER_FILE=Dockerfile
|
||||||
|
- env: TARGET=raspberrypi3 DOCKER_IMAGE=cbase/raspberrypi3-infoscreens COMPOSE_FILE=docker-compose-raspberrypi3.yml DOCKER_FILE=Dockerfile-raspberrypi3
|
||||||
|
sudo: true
|
||||||
|
|
23
Dockerfile-raspberrypi3
Normal file
23
Dockerfile-raspberrypi3
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
FROM resin/raspberrypi3-node:8
|
||||||
|
|
||||||
|
# Reduce npm install verbosity, overflows Travis CI log view
|
||||||
|
ENV NPM_CONFIG_LOGLEVEL warn
|
||||||
|
ENV NODE_ENV production
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
RUN mkdir -p /var/infoscreens
|
||||||
|
WORKDIR /var/infoscreens
|
||||||
|
COPY package.json /var/infoscreens
|
||||||
|
COPY server /var/infoscreens/server
|
||||||
|
COPY dist /var/infoscreens/dist
|
||||||
|
|
||||||
|
# Install NoFlo and dependencies
|
||||||
|
RUN npm install --only=production
|
||||||
|
|
||||||
|
# Map the volumes
|
||||||
|
VOLUME /var/infoscreens/dist
|
||||||
|
VOLUME /var/infoscreens/videos
|
||||||
|
VOLUME /var/infoscreens/pictures
|
||||||
|
|
||||||
|
CMD npm start
|
17
docker-compose-raspberrypi3.yml
Normal file
17
docker-compose-raspberrypi3.yml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
mqtt-infoscreens:
|
||||||
|
image: ansi/raspberrypi3-mosquitto
|
||||||
|
ports:
|
||||||
|
- '1882:9001'
|
||||||
|
- '1883:1883'
|
||||||
|
infoscreens:
|
||||||
|
image: cbase/raspberrypi3-infoscreens
|
||||||
|
ports:
|
||||||
|
- '8080:8080'
|
||||||
|
links:
|
||||||
|
- mqtt-infoscreens
|
||||||
|
volumes:
|
||||||
|
- ./dist:/var/infoscreens/dist
|
||||||
|
- ./videos:/var/infoscreens/videos
|
||||||
|
- ./pictures:/var/infoscreens/pictures
|
Loading…
Reference in a new issue