diff options
author | Mike Morris <mikemorris@users.noreply.github.com> | 2016-10-20 16:53:20 -0400 |
---|---|---|
committer | Mike Morris <mikemorris@users.noreply.github.com> | 2016-10-20 16:53:20 -0400 |
commit | 1e3bf12e6e31a6a60691105b6d002a03c6b0adfa (patch) | |
tree | d1ba2164d9ee9454b5d747e37f801d8386889e75 | |
parent | 7bbd49c72c0daa7036a575a49f6cf13bf8a7020e (diff) |
[node] publish bitrise tag builds
-rw-r--r-- | .travis.yml | 6 | ||||
-rw-r--r-- | platform/node/bitrise.yml | 55 | ||||
-rwxr-xr-x | platform/node/scripts/after_script.sh | 2 |
3 files changed, 43 insertions, 20 deletions
diff --git a/.travis.yml b/.travis.yml index 6c749acfd..0e7cf77df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,13 +64,13 @@ matrix: addons: *clang35 before_script: - export PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") - - export PUBLISH=$([[ "${TRAVIS_TAG:-}" == "node-v${PACKAGE_JSON_VERSION}" ]] && echo true) - - export BUILDTYPE=$([[ -n ${PUBLISH:-} ]] && echo "Release" || echo "Debug") + - export PUBLISH=$([[ "${TRAVIS_TAG:-}" == "node-v${PACKAGE_JSON_VERSION}" ]] && echo "true" || echo "false") + - export BUILDTYPE=$([[ ${PUBLISH} == "true" ]] && echo "Release" || echo "Debug") script: - nvm install 4 - nvm use 4 - make node - - if [[ -z ${PUBLISH} ]]; then make test-node; fi + - if [[ ${PUBLISH} == "false" ]]; then make test-node; fi after_script: - ccache --show-stats - ./platform/node/scripts/after_script.sh ${TRAVIS_JOB_NUMBER} diff --git a/platform/node/bitrise.yml b/platform/node/bitrise.yml index b96855478..247216dc8 100644 --- a/platform/node/bitrise.yml +++ b/platform/node/bitrise.yml @@ -2,6 +2,8 @@ format_version: 1.1.0 default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git trigger_map: +- tag: node-v*.*.* + workflow: primary - pattern: "*" is_pull_request_allowed: true workflow: primary @@ -10,34 +12,55 @@ workflows: primary: steps: - script: - title: Check for skipping CI + title: Setup + inputs: + - content: |- + #!/bin/bash + set -eu -o pipefail + brew install cmake + brew unlink node + brew install awscli homebrew/versions/node4-lts + brew link homebrew/versions/node4-lts + gem install xcpretty --no-rdoc --no-ri + - script: + title: Check for publishing inputs: - content: |- #!/bin/bash - if [[ -n "$(echo $GIT_CLONE_COMMIT_MESSAGE_SUBJECT | sed -n '/\[skip ci\]/p')" || - -n "$(echo $GIT_CLONE_COMMIT_MESSAGE_SUBJECT | sed -n '/\[ci skip\]/p')" || - -n "$(echo $GIT_CLONE_COMMIT_MESSAGE_BODY | sed -n 's/\[skip ci\]/p')" || - -n "$(echo $GIT_CLONE_COMMIT_MESSAGE_BODY | sed -n 's/\[ci skip\]/p')" ]]; then - envman add --key SKIPCI --value true + PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") + if [[ ${BITRISE_GIT_TAG:-} == "node-v${PACKAGE_JSON_VERSION}" ]]; then + envman add --key PUBLISH --value true + envman add --key BUILDTYPE --value "Release" else - envman add --key SKIPCI --value false + envman add --key PUBLISH --value false + envman add --key BUILDTYPE --value "Debug" fi + echo $PACKAGE_JSON_VERSION; + echo $PUBLISH; + echo $BUILDTYPE; - script: title: Run build script - run_if: '{{enveq "SKIPCI" "false"}}' inputs: - content: |- #!/bin/bash set -eu -o pipefail - brew install cmake - brew unlink node - brew install awscli homebrew/versions/node4-lts - brew link homebrew/versions/node4-lts - gem install xcpretty --no-rdoc --no-ri make node - make test-node || result=$? - ./platform/node/scripts/after_script.sh ${BITRISE_BUILD_NUMBER} ${BITRISE_GIT_TAG:-} - exit ${result:-0} + - script: + title: Run test script + run_if: '{{enveq "PUBLISH" "false"}}' + inputs: + - content: |- + #!/bin/bash + set -eu -o pipefail + make test-node || envman add --key RESULT --value "$?" + - script: + title: Run after_script + inputs: + - content: |- + #!/bin/bash + set -eu -o pipefail + ./platform/node/scripts/after_script.sh ${BITRISE_BUILD_NUMBER} + exit ${RESULT:-0} - slack: title: Post to Slack run_if: '{{enveq "SKIPCI" "false"}}' diff --git a/platform/node/scripts/after_script.sh b/platform/node/scripts/after_script.sh index c805e453a..a316a1b47 100755 --- a/platform/node/scripts/after_script.sh +++ b/platform/node/scripts/after_script.sh @@ -5,7 +5,7 @@ set -o pipefail JOB=$1 -if [[ -n ${PUBLISH:-} ]]; then +if [[ ${PUBLISH} == "true" ]]; then if [[ "${BUILDTYPE}" == "Debug" ]]; then echo "Please run this script in release mode (BUILDTYPE=Release)." exit 1 |