-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathapiactions
More file actions
executable file
·68 lines (51 loc) · 1.25 KB
/
apiactions
File metadata and controls
executable file
·68 lines (51 loc) · 1.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
#!/bin/sh
set -e # Exit immediately if a command exits with a non-zero status
while getopts "z:c:" arg; do
case $arg in
z)
zapp=$OPTARG
;;
c)
cnstrctrInput=$OPTARG
;;
*)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
echo "Constructor Input: $cnstrctrInput"
echo "Setting up ZApp: $zapp"
# Check if temp-zapps directory exists
if [ ! -d "temp-zapps/$zapp" ]; then
echo "Error: ZApp directory temp-zapps/$zapp does not exist"
exit 1
fi
cd temp-zapps/$zapp
# Run npm install with error checking
echo "Running npm install..."
if ! npm install; then
echo "Error: npm install failed for $zapp"
exit 1
fi
# Set execute permissions
echo "Setting execute permissions..."
if ! (chmod +x ./bin/setup && chmod +x ./bin/startup); then
echo "Error: Failed to set execute permissions for $zapp"
exit 1
fi
# Run setup
echo "Running setup..."
if ! ./bin/setup; then
echo "Error: Setup failed for $zapp"
exit 1
fi
# Run startup
echo "Running startup with constructor input: $cnstrctrInput"
if ! ./bin/startup "$cnstrctrInput"; then
echo "Error: Startup failed for $zapp"
exit 1
fi
echo "Waiting 20 seconds for services to be ready..."
sleep 20
echo "ZApp $zapp setup completed successfully"