forked from alertlogic/paws-collector
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish the lib while merge to master if version get upgrated (alertl…
…ogic#370) * publish the lib while merge to master
- Loading branch information
1 parent
aa7540a
commit f5c7de8
Showing
2 changed files
with
31 additions
and
4 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 |
---|---|---|
|
@@ -18,8 +18,34 @@ stages: | |
image: node:20 | ||
compute_size: small | ||
commands: | ||
- set -ex | ||
- make test-all | ||
- | | ||
set -ex | ||
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)') | ||
WORDCOUNT=$(npm view "${PKGNAME}@${PKGVERSION}" | wc -c) | ||
git config --global credential.helper \'store\' || true | ||
echo "https://$ALPS_GH_USER:[email protected]" > ~/.git-credentials | ||
npm install | ||
if [ $(git tag -l "$PKGVERSION") ]; then | ||
echo "Skip tagging $PKGNAME $PKGVERSION version already exist" | ||
else | ||
git tag -a $PKGVERSION -m "$PKGNAME release $PKGVERSION" HEAD | ||
if [ "$WORDCOUNT" -eq 0 ]; then | ||
make test-all | ||
echo "PUBLISHING $PKGNAME $PKGVERSION" | ||
npm run lint | ||
git push origin $PKGVERSION | ||
npm publish --access public | ||
else | ||
echo "NOT PUBLISHING $PKGNAME $PKGVERSION" | ||
fi | ||
fi | ||
- echo done | ||
outputs: | ||
file: ./.ps_outputs/* | ||
|
@@ -313,7 +339,8 @@ stages: | |
image: 422372788747.dkr.ecr.us-east-1.amazonaws.com/al-paws-collector-pipeline:latest | ||
compute_size: small_arm | ||
when: | ||
- tag: ['\d+.\d+.\d+'] | ||
- pull_request: | ||
trigger_phrase: build-all-collectors | ||
commands: | ||
- source $NVM_DIR/nvm.sh && nvm use 20 | ||
- make package-all | ||
|