21 Commits
node ... found

Author SHA1 Message Date
0fc95da317 added down message to staging 2017-01-16 17:39:21 -05:00
a495b99bc5 added down message to staging 2017-01-16 17:36:47 -05:00
cca2a255da Merge pull request #12 from wmantly/patch-for-track-dev
Update create.sh
2016-11-15 12:21:41 -05:00
615c347955 Update create.sh 2016-11-15 12:21:31 -05:00
e3fe13246c Update create.sh 2016-11-03 03:05:13 -04:00
634891019e delete 2016-10-11 22:37:46 -04:00
33d066fa39 Merge branch 'master' of https://github.com/wmantly/gitdeploy 2016-10-11 22:30:24 -04:00
ae48b9e715 stop node stuff 2016-10-11 22:29:56 -04:00
81ae2dc1e3 Update update.sh 2016-10-05 04:06:04 -04:00
3577d867d1 Update create.sh 2016-10-05 04:05:37 -04:00
563b252e68 node 2016-10-01 22:12:03 -04:00
f934e1bc70 node 2016-10-01 22:05:11 -04:00
daa9019e02 node 2016-10-01 22:04:37 -04:00
ab00414555 Merge pull request #10 from wmantly/node
node
2016-10-01 22:01:50 -04:00
df5d98e67a Merge pull request #9 from wmantly/node
node
2016-10-01 21:58:33 -04:00
f16f300f4b Merge pull request #8 from wmantly/node
node
2016-10-01 21:49:35 -04:00
9a2f17c6c3 Merge pull request #7 from wmantly/node
node
2016-10-01 21:47:02 -04:00
9149cfa44d Merge pull request #6 from wmantly/node
node
2016-10-01 21:42:32 -04:00
0a19f3fd18 Merge pull request #5 from wmantly/node
node
2016-10-01 21:28:50 -04:00
88408fd904 Merge pull request #4 from wmantly/node
node
2016-10-01 21:19:51 -04:00
08ec8f8002 Merge pull request #3 from wmantly/node
Node
2016-10-01 18:46:28 -04:00
3 changed files with 32 additions and 10 deletions

View File

@ -19,9 +19,19 @@ export DJANGO_SETTINGS_MODULE=project.settings.prod
NODE_ENV='staging'
export NODE_ENV='staging'
export NODEPORT=$nodePort
export djangoURL="http://$name.staging.bytedev.co"
git clone $sshURL .
echo "creating apache VirtualHost file and showing down"
echo "<VirtualHost *:80>" > /etc/apache2/sites-enabled/$name.conf
echo " ServerName $name.staging.bytedev.co" >> /etc/apache2/sites-enabled/$name.conf
echo " DocumentRoot $workingPath/static/error_pages" >> /etc/apache2/sites-enabled/$name.conf
echo "</VirtualHost>" >> /etc/apache2/sites-enabled/$name.conf
/usr/sbin/service apache2 reload
./scripts/setup.sh
source env/bin/activate
@ -46,10 +56,11 @@ git checkout $name
python3 manage.py collectstatic --noinput
python3 manage.py migrate
chmod 777 db.sqlite3
chmod 777 -R .track-storage
forever stop $workingPath/node_rtc/app.js
echo "starting node app on port $nodePort"
forever start $workingPath/node_rtc/app.js -l
forever start $workingPath/node_rtc/app.js
echo "creating apache VirtualHost file"
@ -61,15 +72,17 @@ echo " WSGIProcessGroup $name" >> /etc/apache2/sites-enabled/$name.conf
echo " WSGIScriptAlias / $workingPath/project/wsgi.py" >> /etc/apache2/sites-enabled/$name.conf
echo " # socket.io conf" >> /etc/apache2/sites-enabled/$name.conf
echo " <Location '/socket.io'>" >> /etc/apache2/sites-enabled/$name.conf
echo " RewriteEngine On" >> /etc/apache2/sites-enabled/$name.conf
echo " RewriteCond %{REQUEST_URI} ^/socket.io/1/websocket [NC]" >> /etc/apache2/sites-enabled/$name.conf
echo " RewriteCond %{HTTP:UPGRADE} ^WebSocket\$ [NC]" >> /etc/apache2/sites-enabled/$name.conf
echo " RewriteCond %{HTTP:CONNECTION} Upgrade\$ [NC]" >> /etc/apache2/sites-enabled/$name.conf
echo " RewriteRule .* ws://localhost:$nodePort%{REQUEST_URI} [P]" >> /etc/apache2/sites-enabled/$name.conf
echo " RewriteCond %{REQUEST_URI} ^/socket.io/\$1/websocket [NC]" >> /etc/apache2/sites-enabled/$name.conf
echo " RewriteRule socket.io/(.*) ws://localhost:$nodePort/socket.io/\$1 [P,L]" >> /etc/apache2/sites-enabled/$name.conf
echo " ProxyPass http://localhost:$nodePort/socket.io" >> /etc/apache2/sites-enabled/$name.conf
echo " ProxyPassReverse http://localhost:$nodePort/socket.io" >> /etc/apache2/sites-enabled/$name.conf
echo " </Location>" >> /etc/apache2/sites-enabled/$name.conf
echo " ProxyPass /socket.io http://localhost:$nodePort/socket.io" >> /etc/apache2/sites-enabled/$name.conf
echo " ProxyPassReverse /socket.io http://localhost:$nodePort/socket.io" >> /etc/apache2/sites-enabled/$name.conf
echo "</VirtualHost>" >> /etc/apache2/sites-enabled/$name.conf
/usr/sbin/service apache2 restart
/usr/sbin/service apache2 reload
exit 0

View File

@ -1,10 +1,17 @@
#!/bin/bash
name="$1"
sshURL="$2"
workingPath=/var/www/gitwrapper/$name
nodePort=`cat $workingPath/env/nodePort`
export NODEPORT=$nodePort
forever stop $workingPath/node_rtc/app.js
rm -rf /var/www/gitwrapper/$name
rm /etc/apache2/sites-enabled/$name.conf
/usr/sbin/service apache2 restart
exit 0

View File

@ -27,8 +27,10 @@ chmod 777 db.sqlite3
echo "starting node app"
NODE_ENV='staging'
export NODE_ENV='staging'
nodePort=cat env/nodePort
nodePort=`cat env/nodePort`
export NODEPORT=$nodePort
export djangoURL="http://$name.staging.bytedev.co"
forever stop $workingPath/node_rtc/app.js
forever start $workingPath/node_rtc/app.js