-
Notifications
You must be signed in to change notification settings - Fork 26
/
ps_spec.yml
120 lines (103 loc) · 4.6 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
version: 1.0
service_name: nepal-client-libs
stages:
-
name: PR Test
when:
- pull_request
- pull_request:
trigger_phrase: test it
image: public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:5.0
compute_size: large
commands:
- npm install
- node_modules/lerna/cli.js info
- bash chrome_install.sh
- mv /usr/bin/google-chrome-stable /usr/bin/google-chrome
- google-chrome --version && which google-chrome
- npm run lint
- npm run test
- npx madge --circular --extensions ts --ts-config tsconfig.json packages
- |
ls
#code coverage section
COVERAGE_DIRECTORY=./coverage/*
echo "### Unit Test Coverage Report\n\n" > comments.txt
echo "| Lib | Branches | Functions | Lines | Statements |" >> comments.txt
echo "|:---|---|---|---|---|" >> comments.txt
for folder in $COVERAGE_DIRECTORY; do
project="$(basename $folder)"
if [ -d "$folder" ]; then
COVERGAE_JSON_SUMMARY_FILE=$folder/summary/json-summary.json
if [ -f $COVERGAE_JSON_SUMMARY_FILE ]; then
echo -n "| *$project* |" >> comments.txt
for k in $(jq -r '.total | keys | .[]' $COVERGAE_JSON_SUMMARY_FILE); do
if [ "$k" != "linesCovered" ]; then
total=$(jq -r ".total.$k.total" $COVERGAE_JSON_SUMMARY_FILE)
covered=$(jq -r ".total.$k.covered" $COVERGAE_JSON_SUMMARY_FILE)
pct=$(jq -r ".total.$k.pct" $COVERGAE_JSON_SUMMARY_FILE)
echo -n " $pct% $covered/$total |" >> comments.txt
fi
done
echo "" >> comments.txt
else
echo "| *$project* | N/A | N/A | N/A | N/A |" >> comments.txt
fi
else
echo "| *$project* | N/A | N/A | N/A | N/A |" >> comments.txt
fi
done
#end code coverage section
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.2
GITHUB_TOKEN=$ALPS_GH_TOKEN
#comments api call
bin/hub api repos/alertlogic/$ALPS_REPO_NAME/issues/$ALPS_PR_NUMBER/comments --field [email protected]
- npm run build
- echo done
-
name: Master Push - Publish
when:
- push: ['master']
image: public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:5.0
compute_size: large
commands:
- bash chrome_install.sh
- mv /usr/bin/google-chrome-stable /usr/bin/google-chrome
- google-chrome --version && which google-chrome
- |
set -ex
printenv
if [ -z "$NPM_TOKEN" ]
then
echo "\$NPM_TOKEN is empty"
exit 1
fi
# needed for lerna, it wont publish if the files are changed
git update-index --assume-unchanged .npmrc
echo //registry.npmjs.org/:_authToken="$NPM_TOKEN" >> .npmrc
npm whoami
# Release section
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.2
GITHUB_TOKEN=$ALPS_GH_TOKEN
npm install
node_modules/lerna/cli.js info
npm run build
git diff
node_modules/lerna/cli.js publish from-package --no-git-reset --no-git-tag-version --yes
- echo done
outputs:
file: ./packages/**/dist/*
-
name: mendscan
input:
stage: Master Push - Publish
when:
- push: ['master']
image: aws/codebuild/standard:7.0
compute_size: small
commands:
- curl -LJO https://github.com/whitesource/unified-agent-distribution/raw/master/standAlone/wss_agent.sh
- ls -la
- export WS_PROJECTNAME="${ALPS_REPO_NAME}"
- export WS_FORCECHECKALLDEPENDENCIES=true
- bash wss_agent.sh -apiKey $WS_APIKEY -project $WS_PROJECTNAME -product "$WS_PRODUCTNAME" -d . -wss.url $WS_WSS_URL