Merge pull request #304 from peterbraden/docker-environments

Docker environments
This commit is contained in:
Peter Braden 2015-09-22 20:29:25 +02:00
commit 709df98d83
7 changed files with 44 additions and 11 deletions

View File

@ -12,7 +12,7 @@ charset = utf-8
# Tab indentation (no size specified)
[Makefile]
indent_style = space
indent_style = tab
indent_size = 2
# Indentation override for all JS under lib directory

View File

@ -2,7 +2,7 @@ language: node_js
os:
- linux
- osx
# - osx
matrix:
allow_failures:
@ -10,7 +10,7 @@ matrix:
node_js:
- '0.12'
- "iojs-v1.0.4"
# - "iojs-v1.0.4"
sudo: required
services:
@ -54,7 +54,8 @@ install:
# test our module
- npm test
- node lib/opencv.js
- docker build -t peterbraden/node-opencv .
- docker build -t peterbraden/node-opencv-ubuntu-12-04 -f test/Dockerfile-ubuntu-12-04 .
- docker build -t peterbraden/node-opencv-ubuntu-14-04 -f test/Dockerfile-ubuntu-14-04 .
before_script:
- echo "Publishing native platform Binary Package? ->" $PUBLISH_BINARY

View File

@ -4,10 +4,11 @@
# 2) Build: wget https://raw.github.com/dotcloud/docker/v0.1.6/contrib/docker-build/docker-build && python docker-build $USER/node-opencv < Dockerfile
# 3) Test: docker run $USER/node-opencv node -e "console.log(require('opencv').version)"
#
# VERSION 0.1
# DOCKER-VERSION 0.1.6
# VERSION 0.2
# DOCKER-VERSION 8.1.2
from ubuntu:12.04
# update to 14.04
from ubuntu:14.04
run apt-get update -qq
run apt-get install -y software-properties-common python-software-properties
run add-apt-repository -y ppa:kubuntu-ppa/backports
@ -15,7 +16,4 @@ run apt-get update
run apt-get install -y libcv-dev libcvaux-dev libhighgui-dev libopencv-dev
run curl -sL https://deb.nodesource.com/setup | bash -
run apt-get install -y nodejs
WORKDIR /root/node-opencv
add . /root/node-opencv
run npm install --unsafe-perm --build-from-source || cat npm-debug.log
run make test
run npm install opencv || cat npm-debug.log

View File

@ -33,3 +33,9 @@ release:
@echo "Publishing to NPM"
@npm publish
.PHONY: release
travis-build:
docker build -t peterbraden/node-opencv-ubuntu-12-04 -f test/Dockerfile-ubuntu-12-04 .
docker build -t peterbraden/node-opencv-ubuntu-14-04 -f test/Dockerfile-ubuntu-14-04 .
.PHONY: travis-build

View File

@ -1,3 +1,4 @@
/*
var cv = require('../lib/opencv');
cv.readImage("./files/mona.png", function(err, im) {
@ -18,3 +19,4 @@ function salt(img, n) {
img.set(y, x, 255);
}
}
*/

View File

@ -0,0 +1,13 @@
# This is a dockerfile to test the build on ubuntu 12.04
from ubuntu:12.04
run apt-get update -qq
run apt-get install -y software-properties-common python-software-properties
run add-apt-repository -y ppa:kubuntu-ppa/backports
run apt-get update
run apt-get install -y libcv-dev libcvaux-dev libhighgui-dev libopencv-dev
run curl -sL https://deb.nodesource.com/setup | bash -
run apt-get install -y nodejs
WORKDIR /root/node-opencv
add . /root/node-opencv
run npm install --unsafe-perm --build-from-source || cat npm-debug.log
run make test

View File

@ -0,0 +1,13 @@
# This is a dockerfile to test the build on ubuntu 14.04
from ubuntu:14.04
run apt-get update -qq
run apt-get install -y software-properties-common python-software-properties
run add-apt-repository -y ppa:kubuntu-ppa/backports
run apt-get update
run apt-get install -y libcv-dev libcvaux-dev libhighgui-dev libopencv-dev
run curl -sL https://deb.nodesource.com/setup | bash -
run apt-get install -y nodejs
WORKDIR /root/node-opencv
add . /root/node-opencv
run npm install --unsafe-perm --build-from-source || cat npm-debug.log
run make test