-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathbuild-with-docker.sh
More file actions
executable file
·47 lines (41 loc) · 1004 Bytes
/
build-with-docker.sh
File metadata and controls
executable file
·47 lines (41 loc) · 1004 Bytes
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
#!/bin/bash
usage () {
echo -e "Expects one of the following arguments: "
echo -e "ci - runs npm ci"
echo -e "test - runs npm run test"
echo -e "cypress-test - runs npm run cypress-test. For this option, expects username, password, and url to be passed as subsequent arguments. eg. admin Admin123 localhost:8080/"
echo -e "build - runs npm run build. For this option, the build number should be passed in as the second argument"
echo -e "If no argument is passed, executes ci, followed by test, followed by build"
}
npmci() {
docker run --rm \
-v $(pwd):/data \
-w="/data" \
node:14 \
npm ci
}
npmtest() {
docker run --rm \
-v $(pwd):/data \
-w="/data" \
node:14 \
npm run test:update-snapshots
}
npmlint() {
docker run --rm \
-v $(pwd):/data \
-w="/data" \
node:14 \
npm run lint
}
npmpack() {
docker run --rm \
-v $(pwd):/data \
-w="/data" \
node:14 \
npm run pack
}
npmci
npmtest
npmlint
npmpack