-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathverify-open-source.sh
More file actions
executable file
·92 lines (81 loc) · 2.25 KB
/
Copy pathverify-open-source.sh
File metadata and controls
executable file
·92 lines (81 loc) · 2.25 KB
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
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "$0")" && pwd)"
copy_env_if_missing() {
local directory="$1"
if [ ! -f "$directory/.env" ] && [ -f "$directory/.env.example" ]; then
cp "$directory/.env.example" "$directory/.env"
printf 'Created %s/.env from .env.example\n' "${directory#"$ROOT_DIR/"}"
fi
}
required_files=(
".gitignore"
".dockerignore"
".env.deploy.example"
"LICENSE"
"CODE_OF_CONDUCT.md"
"CONTRIBUTING.md"
"NOTICE"
"README.md"
"README.zh.md"
"SECURITY.md"
"THIRD_PARTY_NOTICES.md"
"TRADEMARKS.md"
"workmesh-business/.env.example"
"workmesh-business/server/.env.example"
"workmesh-app/portal/.env.example"
"workmesh-app/app/.env.example"
"start-local-demo.sh"
"stop-local-demo.sh"
"verify-local-demo.sh"
"deploy.sh"
"verify-deployment.sh"
"docker-compose.yml"
"workmesh-business/Dockerfile"
"workmesh-business/server/Dockerfile"
"workmesh-app/portal/Dockerfile"
"workmesh-app/app/Dockerfile"
"workmesh-governance/Dockerfile"
"docker/nginx-spa.conf"
)
for file in "${required_files[@]}"; do
if [ ! -f "$ROOT_DIR/$file" ]; then
printf 'Missing required open-source file: %s\n' "$file" >&2
exit 1
fi
done
bash -n \
"$ROOT_DIR/start-local-demo.sh" \
"$ROOT_DIR/stop-local-demo.sh" \
"$ROOT_DIR/verify-local-demo.sh" \
"$ROOT_DIR/deploy.sh" \
"$ROOT_DIR/verify-deployment.sh" \
"$ROOT_DIR/verify-open-source.sh"
node --check "$ROOT_DIR/scripts/capture-readme-screenshots.mjs"
node --check "$ROOT_DIR/workmesh-governance/shared-api.js"
docker compose -f "$ROOT_DIR/docker-compose.yml" config >/dev/null
copy_env_if_missing "$ROOT_DIR/workmesh-business"
copy_env_if_missing "$ROOT_DIR/workmesh-business/server"
copy_env_if_missing "$ROOT_DIR/workmesh-app/portal"
copy_env_if_missing "$ROOT_DIR/workmesh-app/app"
projects=(
"workmesh-business"
"workmesh-business/server"
"workmesh-app/portal"
"workmesh-app/app"
)
for project in "${projects[@]}"; do
printf '\nInstalling locked dependencies: %s\n' "$project"
(
cd "$ROOT_DIR/$project"
npm ci --no-audit --no-fund
)
done
for project in "${projects[@]}"; do
printf '\nBuilding: %s\n' "$project"
(
cd "$ROOT_DIR/$project"
npm run build
)
done
printf '\nOpen-source build verification passed.\n'