Skip to content

Commit 709df98

Browse files
committed
Merge pull request #304 from peterbraden/docker-environments
Docker environments
2 parents 246de81 + 00bb8d9 commit 709df98

File tree

7 files changed

+44
-11
lines changed

7 files changed

+44
-11
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ charset = utf-8
1212

1313
# Tab indentation (no size specified)
1414
[Makefile]
15-
indent_style = space
15+
indent_style = tab
1616
indent_size = 2
1717

1818
# Indentation override for all JS under lib directory

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ language: node_js
22

33
os:
44
- linux
5-
- osx
5+
# - osx
66

77
matrix:
88
allow_failures:
99
- os: osx
1010

1111
node_js:
1212
- '0.12'
13-
- "iojs-v1.0.4"
13+
# - "iojs-v1.0.4"
1414

1515
sudo: required
1616
services:
@@ -54,7 +54,8 @@ install:
5454
# test our module
5555
- npm test
5656
- node lib/opencv.js
57-
- docker build -t peterbraden/node-opencv .
57+
- docker build -t peterbraden/node-opencv-ubuntu-12-04 -f test/Dockerfile-ubuntu-12-04 .
58+
- docker build -t peterbraden/node-opencv-ubuntu-14-04 -f test/Dockerfile-ubuntu-14-04 .
5859

5960
before_script:
6061
- echo "Publishing native platform Binary Package? ->" $PUBLISH_BINARY

Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@
44
# 2) Build: wget https://raw.github.com/dotcloud/docker/v0.1.6/contrib/docker-build/docker-build && python docker-build $USER/node-opencv < Dockerfile
55
# 3) Test: docker run $USER/node-opencv node -e "console.log(require('opencv').version)"
66
#
7-
# VERSION 0.1
8-
# DOCKER-VERSION 0.1.6
7+
# VERSION 0.2
8+
# DOCKER-VERSION 8.1.2
99

10-
from ubuntu:12.04
10+
# update to 14.04
11+
from ubuntu:14.04
1112
run apt-get update -qq
1213
run apt-get install -y software-properties-common python-software-properties
1314
run add-apt-repository -y ppa:kubuntu-ppa/backports
1415
run apt-get update
1516
run apt-get install -y libcv-dev libcvaux-dev libhighgui-dev libopencv-dev
1617
run curl -sL https://deb.nodesource.com/setup | bash -
1718
run apt-get install -y nodejs
18-
WORKDIR /root/node-opencv
19-
add . /root/node-opencv
20-
run npm install --unsafe-perm --build-from-source || cat npm-debug.log
21-
run make test
19+
run npm install opencv || cat npm-debug.log

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@ release:
3333
@echo "Publishing to NPM"
3434
@npm publish
3535
.PHONY: release
36+
37+
38+
travis-build:
39+
docker build -t peterbraden/node-opencv-ubuntu-12-04 -f test/Dockerfile-ubuntu-12-04 .
40+
docker build -t peterbraden/node-opencv-ubuntu-14-04 -f test/Dockerfile-ubuntu-14-04 .
41+
.PHONY: travis-build

examples/salt.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*
12
var cv = require('../lib/opencv');
23
34
cv.readImage("./files/mona.png", function(err, im) {
@@ -18,3 +19,4 @@ function salt(img, n) {
1819
img.set(y, x, 255);
1920
}
2021
}
22+
*/

test/Dockerfile-ubuntu-12-04

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This is a dockerfile to test the build on ubuntu 12.04
2+
from ubuntu:12.04
3+
run apt-get update -qq
4+
run apt-get install -y software-properties-common python-software-properties
5+
run add-apt-repository -y ppa:kubuntu-ppa/backports
6+
run apt-get update
7+
run apt-get install -y libcv-dev libcvaux-dev libhighgui-dev libopencv-dev
8+
run curl -sL https://deb.nodesource.com/setup | bash -
9+
run apt-get install -y nodejs
10+
WORKDIR /root/node-opencv
11+
add . /root/node-opencv
12+
run npm install --unsafe-perm --build-from-source || cat npm-debug.log
13+
run make test

test/Dockerfile-ubuntu-14-04

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This is a dockerfile to test the build on ubuntu 14.04
2+
from ubuntu:14.04
3+
run apt-get update -qq
4+
run apt-get install -y software-properties-common python-software-properties
5+
run add-apt-repository -y ppa:kubuntu-ppa/backports
6+
run apt-get update
7+
run apt-get install -y libcv-dev libcvaux-dev libhighgui-dev libopencv-dev
8+
run curl -sL https://deb.nodesource.com/setup | bash -
9+
run apt-get install -y nodejs
10+
WORKDIR /root/node-opencv
11+
add . /root/node-opencv
12+
run npm install --unsafe-perm --build-from-source || cat npm-debug.log
13+
run make test

0 commit comments

Comments
 (0)