Skip to content

Commit

Permalink
Use circle for nodejs client library
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Lindamood committed Feb 9, 2016
1 parent 28590d7 commit 7d79303
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 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
Expand Down
53 changes: 53 additions & 0 deletions 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

19 changes: 19 additions & 0 deletions 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
2 changes: 1 addition & 1 deletion 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",
Expand Down

0 comments on commit 7d79303

Please sign in to comment.