Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use circle for nodejs client library
- Loading branch information
Jack Lindamood
committed
Feb 9, 2016
1 parent
28590d7
commit 7d79303
Showing
4 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters