-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.sh
30 lines (25 loc) · 910 Bytes
/
startup.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
#!/bin/bash
if [[ ! -v ArtifactUrl ]]; then
echo "ArtifactUrl not set. Doing nothing while waiting for something."
node -e "setTimeout(()=>{},1000 * 60 * 60 * 20)"
else
echo "build version: $BuildVersion"
echo "host: $host"
echo "HOST: $HOST"
node -e "console.log('node version:', process.version)"
echo "Downloading artifact"
w3m -dump_source -header "Authorization: Bearer $AppveyorToken" -header "Content-type: application/json" $ArtifactUrl > artifact.zip
7za x -y artifact.zip >> 7za.log
if [ -f "install.sh" ]; then
echo "executing install.sh"
chmod +x ./install.sh
./install.sh
fi
if [ -d "node_modules" ];
then
echo npm install was executed at build time
else
npm install --production
fi
exec npm-start # npm-start (bash script) supports correct SIGTTERM + correct tmpdir in nodejs
fi