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.
- Loading branch information
Rakhi Mundhada
authored and
Rakhi Mundhada
committed
Jan 23, 2024
1 parent
4f1b709
commit 1dc57f2
Showing
1 changed file
with
83 additions
and
86 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,94 +2,91 @@ version: 1.0 | |
service_name: paws-collector | ||
|
||
stages: | ||
- | ||
name: PR Test | ||
when: | ||
- pull_request | ||
- pull_request: | ||
trigger_phrase: test it | ||
image: node:18 | ||
compute_size: small | ||
commands: | ||
- make test | ||
|
||
- | ||
name: Master Push - Publish | ||
when: | ||
- push: ['master'] | ||
image: node:18 | ||
compute_size: small | ||
commands: | ||
- | | ||
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/* | ||
- name: PR Test | ||
when: | ||
- pull_request | ||
- pull_request: | ||
trigger_phrase: test it | ||
image: node:18 | ||
compute_size: small | ||
commands: | ||
- make test | ||
|
||
- name: build-collector-auth0 | ||
image: 422372788747.dkr.ecr.us-east-1.amazonaws.com/al-paws-collector-pipeline:latest | ||
compute_size: small_arm | ||
when: | ||
- pull_request: | ||
- name: Master Push - Publish | ||
when: | ||
- push: ["master"] | ||
image: node:18 | ||
compute_size: small | ||
commands: | ||
- | | ||
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/* | ||
- name: build-collector-auth0 | ||
image: 422372788747.dkr.ecr.us-east-1.amazonaws.com/al-paws-collector-pipeline:latest | ||
compute_size: small_arm | ||
when: | ||
- pull_request: | ||
trigger_phrase: build-collector-auth0 | ||
commands: | ||
- source $NVM_DIR/nvm.sh && nvm use 18 | ||
- export ALPS_SERVICE_VERSION=$(node -p "require('./collectors/auth0/package.json').version") | ||
# - echo "ALPS_SERVICE_VERSION=$ALPS_SERVICE_VERSION" >> $GITHUB_ENV | ||
- npm install | ||
- make package | ||
- mkdir auth0-collecctor | ||
- cp -r cfn al-auth0-collector.zip al-auth0-collector.json auth0-collector | ||
env: | ||
- ALPS_SERVICE_VERSION: ${{ env.ALPS_SERVICE_VERSION }} | ||
outputs: | ||
file: ./auth0-collecctor | ||
commands: | ||
- source $NVM_DIR/nvm.sh && nvm use 18 | ||
- export ALPS_SERVICE_VERSION=$(node -p "require('./collectors/auth0/package.json').version") | ||
# - echo "ALPS_SERVICE_VERSION=$ALPS_SERVICE_VERSION" >> $GITHUB_ENV | ||
- npm install | ||
- make package | ||
- mkdir auth0-collecctor | ||
- cp -r cfn al-auth0-collector.zip al-auth0-collector.json auth0-collector | ||
env: | ||
- ALPS_SERVICE_VERSION: ${{ env.ALPS_SERVICE_VERSION }} | ||
outputs: | ||
file: ./auth0-collecctor | ||
packagers: | ||
- basic | ||
|
||
- name: build-collector-carbonback | ||
image: 422372788747.dkr.ecr.us-east-1.amazonaws.com/al-paws-collector-pipeline:latest | ||
compute_size: small_arm | ||
when: | ||
- pull_request: | ||
trigger_phrase: build-collector-carbonback | ||
commands: | ||
- source $NVM_DIR/nvm.sh && nvm use 18 | ||
- export ALPS_SERVICE_VERSION=$(node -p "require('./collectors/carbonblack/package.json').version") | ||
# - echo "ALPS_SERVICE_VERSION=$ALPS_SERVICE_VERSION" >> $GITHUB_ENV | ||
- npm install | ||
- make package | ||
- mkdir auth0-collecctor | ||
- cp -r cfn al-auth0-collector.zip al-auth0-collector.json auth0-collector | ||
env: | ||
- ALPS_SERVICE_VERSION: ${{ env.ALPS_SERVICE_VERSION }} | ||
outputs: | ||
file: ./auth0-collecctor | ||
packagers: | ||
- basic | ||
- name: build-collector-carbonback | ||
image: 422372788747.dkr.ecr.us-east-1.amazonaws.com/al-paws-collector-pipeline:latest | ||
compute_size: small_arm | ||
when: | ||
- pull_request: | ||
trigger_phrase: build-collector-carbonback | ||
commands: | ||
- source $NVM_DIR/nvm.sh && nvm use 18 | ||
- export ALPS_SERVICE_VERSION=$(node -p "require('./collectors/carbonblack/package.json').version") | ||
# - echo "ALPS_SERVICE_VERSION=$ALPS_SERVICE_VERSION" >> $GITHUB_ENV | ||
- npm install | ||
- make package | ||
- mkdir auth0-collecctor | ||
- cp -r cfn al-auth0-collector.zip al-auth0-collector.json auth0-collector | ||
env: | ||
- ALPS_SERVICE_VERSION: ${{ env.ALPS_SERVICE_VERSION }} | ||
outputs: | ||
file: ./auth0-collecctor | ||
packagers: | ||
- basic |