Skip to content

Commit

Permalink
Some server updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Jbudone committed May 9, 2018
1 parent 2380c6d commit 1accb59
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
3 changes: 3 additions & 0 deletions emailcrash
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ echo " " >> emailFile
echo " " >> emailFile
echo " " >> emailFile
tail -n 100 nohup.out >> emailFile
echo " " >> emailFile
echo " " >> emailFile
tail -n 100 nohup.err >> emailFile
sendmail [email protected] < emailFile
13 changes: 9 additions & 4 deletions patchserver
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
# - Check Dreamhost password correct before starting
# - Turn off server (w/out errors) before starting -- what if there's an inspector waiting though?
# - SCP once (seems login is incredibly slow, but actual copying is fast)
# - View initial server start log? Or some way to show that the server has successfully started?

printf "Enter the password for Dreamhost: "
read -s passphrase


# Wtf???
scp -i ~/home/awskeypair.pem -r dist/js/SCRIPTINJECT.js [email protected]:~/myquest/dist/js/

ssh -i ~/home/awskeypair.pem -t [email protected] << EOF
cd myquest
Expand Down Expand Up @@ -48,11 +52,12 @@ ssh -i ~/home/awskeypair.pem -t [email protected]
node fuckingtaskrunner.js --dont-watch
# SCP game to webserver
sshpass -p "$passphrase" scp -r dist/ [email protected]:~/jbud.me/playground/myquest/
sshpass -p "$passphrase" scp -r node_modules/ [email protected]:~/jbud.me/playground/myquest/
sshpass -p "$passphrase" scp index.html [email protected]:~/jbud.me/playground/myquest/
sshpass -p "$passphrase" scp styles.css [email protected]:~/jbud.me/playground/myquest/
sshpass -p "$passphrase" scp -r ./{dist,node_modules,index.html,styles.css} [email protected]:~/jbud.me/playground/myquest/
# Running server
sudo killall runserver
ps aux | grep -i node | awk '{ print $2 }' | xargs kill -9 $1
nohup ./runserver > nohup.out 2> nohup.err < /dev/null &
echo "Finished patching"
EOF
4 changes: 2 additions & 2 deletions resourceBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,8 @@ let processResources = (package) => {
distHash = fs.existsSync(asset.output) ? fileHash(asset.output) : "";
if (asset.processedHash !== distHash || asset.rawHash !== hash || Settings.forceRebuild) { // FIXME: Force rebuild
console.log(`Asset to process (hash has changed)! ${package.name}: ${asset.name}`);
console.log("Output: " + asset.processedHash + " !== " + distHash + " ? ");
console.log("Raw Asset: " + asset.rawHash + " !== " + hash + " ? ");
console.log("Output: " + asset.processedHash + " !== " + distHash + " ? (has the output file changed since last time?) ");
console.log("Raw Asset: " + asset.rawHash + " !== " + hash + " ? (has the source file changed?) ");

if (Settings.checkNeedsRebuild) {
process.exit(2);
Expand Down
4 changes: 2 additions & 2 deletions runserver
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ do
#nodejs --nouse-idle-notification --expose-gc --max-new-space-size=2048 --max-old-space-size=8192 dist/js/server.js
node --nouse-idle-notification --expose-gc dist/js/server.js

echo "Server Shutdown... restarting in 5 seconds"
echo "Server Shutdown... restarting in 20 seconds"
./emailcrash
sleep 5
sleep 20
done

0 comments on commit 1accb59

Please sign in to comment.