-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathverdaccio-build-s2-webpack.sh
executable file
·39 lines (30 loc) · 1.18 KB
/
verdaccio-build-s2-webpack.sh
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
#!/usr/bin/env bash
port=4000
registry="http://localhost:$port"
output="output.out"
set -e
echo "Building docs with verdaccio"
# Wait for verdaccio to start
grep -q 'http address' <(tail -f $output)
if curl -sI http://localhost:4000/ >/dev/null; then
echo "Verdaccio is running on port 4000."
else
echo "Verdaccio is NOT running on port 4000."
fi
yarn config set npmPublishRegistry --home $registry
yarn config set npmRegistryServer --home $registry
yarn config set npmAlwaysAuth --home false
yarn config set npmAuthToken --home abc
yarn config set unsafeHttpWhitelist --home localhost
npm set registry $registry
# Rename the dist folder from dist/production/docs to verdaccio_dist/COMMIT_HASH_BEFORE_PUBLISH/verdaccio/docs
# This is so we can have verdaccio build in a separate stream from deploy and deploy_prod
verdaccio_path=verdaccio_dist/`git rev-parse HEAD~0`/verdaccio
mkdir -p $verdaccio_path
echo 'build Spectrum 2 + Webpack test app'
cd examples/s2-webpack-5-example
yarn config set npmRegistryServer $registry
yarn install --no-immutable
yarn build
mv dist ../../$verdaccio_path/s2-webpack-5-example
netstat -tpln | awk -F'[[:space:]/:]+' '$5 == 4000 {print $(NF-2)}' | xargs kill