summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-08-01 18:27:04 +0300
committerMike Morris <mikemorris@users.noreply.github.com>2016-08-01 14:48:39 -0400
commitad5a7f8b5496dc39a063b058ee94a41a816fc32c (patch)
treeb1bc8fea0fe2172967c502f7c6d5accc5978bb81
parent472ab7442f566e6d2e8f1b67282d8394d0394de6 (diff)
downloadqtlocation-mapboxgl-ad5a7f8b5496dc39a063b058ee94a41a816fc32c.tar.gz
[node] build and publish Node.js binaries with BUILDTYPE=Release
Skip tests when publishing binaries and skip publishing render test results when those tests don't run.
-rw-r--r--.travis.yml8
-rwxr-xr-xplatform/node/scripts/after_script.sh26
2 files changed, 20 insertions, 14 deletions
diff --git a/.travis.yml b/.travis.yml
index 4c7ae8fa51..211a6f9f81 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -56,13 +56,17 @@ matrix:
dist: trusty
language: node
compiler: "node4-clang35-debug"
- env: BUILDTYPE=Debug _CXX=clang++-3.5 _CC=clang-3.5
+ env: _CXX=clang++-3.5 _CC=clang-3.5
addons: *clang35
+ before_script:
+ - export PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
+ - export PUBLISH=$([[ ${TAG} == "node-v${PACKAGE_JSON_VERSION}" ]] && echo 1 || echo 0)
+ - export BUILDTYPE=$([[ ${PUBLISH} ]] && echo "Release" || echo "Debug")
script:
- nvm install 4
- nvm use 4
- make node
- - make test-node
+ - if [[ ! ${PUBLISH} ]]; then make test-node; fi
after_script:
- ccache --show-stats
- ./platform/node/scripts/after_script.sh ${TRAVIS_JOB_NUMBER} ${TRAVIS_TAG:-}
diff --git a/platform/node/scripts/after_script.sh b/platform/node/scripts/after_script.sh
index 905055ad11..311511726a 100755
--- a/platform/node/scripts/after_script.sh
+++ b/platform/node/scripts/after_script.sh
@@ -6,17 +6,19 @@ set -o pipefail
JOB=$1
TAG=$2
-if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then
- gzip --stdout node_modules/mapbox-gl-test-suite/render-tests/index.html | \
- aws s3 cp --acl public-read --content-encoding gzip --content-type text/html \
- - s3://mapbox/mapbox-gl-native/render-tests/$JOB/index.html
+if [[ ${PUBLISH} ]]; then
+ if [[ "$BUILDTYPE" == "Debug" ]]; then
+ echo "Please run this script in release mode (BUILDTYPE=Release)."
+ exit 1
+ else
+ ./node_modules/.bin/node-pre-gyp package publish info
+ fi
+else
+ if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then
+ gzip --stdout node_modules/mapbox-gl-test-suite/render-tests/index.html | \
+ aws s3 cp --acl public-read --content-encoding gzip --content-type text/html \
+ - s3://mapbox/mapbox-gl-native/render-tests/$JOB/index.html
- echo http://mapbox.s3.amazonaws.com/mapbox-gl-native/render-tests/$JOB/index.html
-fi
-
-PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
-
-if [[ $TAG == node-v${PACKAGE_JSON_VERSION} ]]; then
- ./node_modules/.bin/node-pre-gyp package
- ./node_modules/.bin/node-pre-gyp publish info
+ echo http://mapbox.s3.amazonaws.com/mapbox-gl-native/render-tests/$JOB/index.html
+ fi
fi