-
Notifications
You must be signed in to change notification settings - Fork 12
/
ps_spec.yml
54 lines (47 loc) · 1.83 KB
/
ps_spec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
version: 1.0
service_name: al-aws-collector-js
stages:
-
name: PR Test
when:
- pull_request
- pull_request:
trigger_phrase: test it
image: node:20
compute_size: small
commands:
- make test
-
name: Master Push - Publish
when:
- push: ['master']
image: node:20
compute_size: small
commands:
- make test
- git clone [email protected]:alertlogic/al-ps-tools.git
- cp coverage/cobertura-coverage.xml al-aws-collector-js.coverage.xml
- bash ./al-ps-tools/helpers/collect.sh -c 'al-aws-collector-js.coverage.xml'
- rm -rf ./al-ps-tools/
- |
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
git tag -a $PKGVERSION -m "$PKGNAME release $PKGVERSION" HEAD
npm install
if [ "$WORDCOUNT" -eq 0 ]; then
echo "PUBLISHING $PKGNAME $PKGVERSION"
npm run lint
git push origin $PKGVERSION
npm publish --access public
else
echo "NOT PUBLISHING $PKGNAME $PKGVERSION"
fi
- echo done
outputs:
file: ./.ps_outputs/*