-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
live-test.sh
executable file
·41 lines (31 loc) · 1.27 KB
/
live-test.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
40
41
#!/bin/sh -x
rm -rf dist
rm e2e/results/*.spec.ts
rm -rf example/results
# in case it's running still
docker-compose -f ./.verdaccio/docker-compose.yml down
#kill the script if a command fails
set -e
npm run build
# start the local registry
## give the ./.verdaccio/verdaccio folder ownership to the 10001 user from the 65533 group as per verdaccio documentation
## https://verdaccio.org/docs/docker#running-verdaccio-using-docker
sudo chown -R 10001:65533 $PWD/.verdaccio/verdaccio
docker-compose -f ./.verdaccio/docker-compose.yml up -d
# publish to local registry
npm_config_registry=http://localhost:4873/ npm publish
docker pull gparlakov/scuri:angular-14-app-v2
APP_DIR="$(docker inspect --format='{{.Config.WorkingDir}}' gparlakov/scuri:angular-14-app-v2)"
export EXAMPLE_FOLDER='example'
if test -z "${DEBUG_LIVE_TEST}"; then
FLAGS='-t --rm'
ENTRYPOINT=$APP_DIR/$EXAMPLE_FOLDER/run-plus.sh
else
FLAGS='-it'
ENTRYPOINT=/bin/bash
fi
docker run $FLAGS -v $(pwd)/example:$APP_DIR/example --entrypoint $ENTRYPOINT --net=host -e npm_config_registry=http://localhost:4873/ gparlakov/scuri:angular-14-app-v2
cp ./example/results/*.* ./e2e/results
npx jest --roots=./e2e -- ./e2e/check-results.spec.ts
# stop local registry
docker-compose -f ./.verdaccio/docker-compose.yml down