diff --git a/README.md b/README.md index e409862..3aadf40 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![NPM version][npm-image]][npm-url] [![Build Status](https://travis-ci.org/signalfx/signalfx-nodejs.svg?branch=master)](https://travis-ci.org/signalfx/signalfx-nodejs) +[![NPM version][npm-image]][npm-url] [![Circle CI](https://circleci.com/gh/signalfx/signalfx-nodejs.svg?style=svg)](https://circleci.com/gh/signalfx/signalfx-nodejs) # Node.js client library for SignalFx This is a programmatic interface in JavaScript for SignalFx's metadata and diff --git a/circle.sh b/circle.sh new file mode 100755 index 0000000..bd4f058 --- /dev/null +++ b/circle.sh @@ -0,0 +1,53 @@ +#!/bin/bash +set -ex +set -o pipefail + +# Cache phase of circleci +function do_cache() { + npm install +} + +# Test phase of circleci +function do_test() { + npm --version + node --version + npm test +} + +# Deploy phase of circleci +function do_deploy() { + VERSION=${CIRCLE_TAG//v/} + echo "Trying to install version $VERSION" + npm whoami + + # For some reason this command returns 1??? + npm list signalfx || true + npm list signalfx | grep "signalfx@$VERSION " + npm publish +} + +function do_all() { + do_cache + do_test + do_deploy +} + +case "$1" in + cache) + do_cache + ;; + test) + do_test + ;; + deploy) + do_deploy + ;; + all) + do_all + ;; + *) + echo "Usage: $0 {cache|test|deploy|all}" + exit 1 + ;; +esac + diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..b3d0dad --- /dev/null +++ b/circle.yml @@ -0,0 +1,19 @@ +dependencies: + cache_directories: + - /home/ubuntu/dependent_repos + - /home/ubuntu/.npm + override: + - ./circle.sh cache > >(tee $CIRCLE_ARTIFACTS/cache.stdout.txt) 2> >(tee $CIRCLE_ARTIFACTS/cache.stderr.txt >&2): + timeout: 900 + +test: + override: + - ./circle.sh test > >(tee $CIRCLE_ARTIFACTS/test.stdout.txt) 2> >(tee $CIRCLE_ARTIFACTS/test.stderr.txt >&2): + timeout: 3000 + +deployment: + npmdeploy: + tag: /v[0-9]+(\.[0-9]+)*/ + commands: + - echo "_auth=$NPM_AUTH\nemail=info@signalfx.com" > ~/.npmrc + - ./circle.sh deploy diff --git a/package.json b/package.json index a0d4b12..8b73c11 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "signalfx", - "version": "2.0.0", + "version": "2.0.3", "description": "Node.js client library for SignalFx", "homepage": "https://signalfx.com", "repository": "https://github.com/signalfx/signalfx-nodejs",