Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit b9b9275

Browse files
author
Simon Hofmann
committed
Added separate prebuild task
1 parent 84a0335 commit b9b9275

File tree

5 files changed

+34
-5
lines changed

5 files changed

+34
-5
lines changed

.travis.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ matrix:
9292
- BUILD_TASK=prebuild
9393

9494
before_install:
95-
- if [[ $BUILD_TASK != "prebuild" ]]; then
96-
chmod +x ./ci/$BUILD_TASK/$BUILD_TASK.sh;
97-
fi
95+
- chmod +x ./ci/$BUILD_TASK/$BUILD_TASK.sh;
9896

9997
install:
10098
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then travis_wait 30 docker pull justadudewhohacks/opencv4nodejs-ci:$TAG; fi
@@ -109,8 +107,9 @@ script:
109107

110108
after_success:
111109
- if [[ $TRAVIS_TAG != "" && $BUILD_TASK == "prebuild" ]]; then
112-
npm install;
113-
npm run prebuild -- --tag-prefix "" -u $GITHUB_TOKEN;
110+
cd ./ci/$BUILD_TASK;
111+
npm run $BUILD_TASK $TAG;
112+
cd -;
114113
fi
115114
- if [ $BUILD_TASK = 'cover' ]; then
116115
npm install;

ci/prebuild/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ARG TAG
2+
3+
FROM justadudewhohacks/opencv4nodejs-ci:${TAG}
4+
5+
COPY ./ ./
6+
CMD ["bin/bash", "./ci/test/script/run-prebuild.sh"]

ci/prebuild/package.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"scripts": {
3+
"test": "bash ./prebuild.sh"
4+
}
5+
}

ci/prebuild/prebuild.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
if [[ "$TRAVIS_OS_NAME" == "linux" ]];
3+
then
4+
image=opencv4nodejs-ci_$1
5+
docker build -t $image -f ./Dockerfile --build-arg TAG=$1 ../../
6+
docker run -e GITHUB_TOKEN=$GITHUB_TOKEN $image
7+
elif [[ "$TRAVIS_OS_NAME" == "osx" ]];
8+
then
9+
cd ../../ &&\
10+
npm install --unsafe-perm &&\
11+
npm run prebuild -- --tag-prefix "" -u $GITHUB_TOKEN;
12+
fi

ci/prebuild/script/run-prebuild.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
export OPENCV4NODEJS_DISABLE_AUTOBUILD=1
3+
echo "Installing dependencies" &&\
4+
npm install --unsafe-perm &&\
5+
echo "Running prebuild" &&\
6+
npm install --unsafe-perm &&\
7+
npm run prebuild -- --tag-prefix "" -u $GITHUB_TOKEN;

0 commit comments

Comments
 (0)