-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not run collection if unregistered (#104)
* Do not run collection if unregistered Cleanup Code cleanup Fix Fix reistration * Update deps * Add ps_spec
- Loading branch information
kkuzmin
authored
Apr 8, 2020
1 parent
6b95b62
commit 9a7ca86
Showing
3 changed files
with
101 additions
and
23 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
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,48 @@ | ||
version: 1.0 | ||
service_name: paws-collector | ||
|
||
stages: | ||
- | ||
name: PR Test | ||
when: | ||
- pull_request | ||
- pull_request: | ||
trigger_phrase: test it | ||
image: node:12 | ||
compute_size: small | ||
commands: | ||
- make test | ||
|
||
- | ||
name: Master Push - Publish | ||
when: | ||
- push: ['master'] | ||
image: node:12 | ||
compute_size: small | ||
commands: | ||
- | | ||
set -ex | ||
#git config --global --add url."[email protected]:".insteadOf "https://github.com/" | ||
echo //registry.npmjs.org/:_authToken=$NPM_TOKEN > .npmrc | ||
npm whoami | ||
|
||
PKGNAME=$(node -e 'console.log(require("./package.json").name)') | ||
PKGVERSION=$(node -e 'console.log(require("./package.json").version)') | ||
V_VERSION=v$PKGVERSION | ||
WORDCOUNT=$(npm view "${PKGNAME}@${PKGVERSION}" | wc -c) | ||
|
||
git tag -a $V_VERSION -m "$PKGNAME release $V_VERSION" HEAD | ||
|
||
npm install | ||
|
||
if [ "$WORDCOUNT" -eq 0 ]; then | ||
echo "PUBLISHING $PKGNAME $PKGVERSION" | ||
npm run lint | ||
git push origin $V_VERSION | ||
npm publish --access public | ||
else | ||
echo "NOT PUBLISHING $PKGNAME $PKGVERSION" | ||
fi | ||
- echo done | ||
|