Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorCode Raguet <ignacio.code@gmail.com>2013-09-19 16:16:18 (GMT)
committer Code Raguet <ignacio.code@gmail.com>2013-09-19 16:16:18 (GMT)
commita6c6aac49cb62cb29aad5669f9d645e6dc02e325 (patch)
tree7d3c86e01bab0dfdad4d199916f660d0c1728994 /webapp
parent06be5ee6b7df89e269f0da21347d926fa15d8e8e (diff)
add deploy scripts as they are in the jenkins jobs
Diffstat (limited to 'webapp')
-rw-r--r--webapp/deploy/deploy_prod.sh25
-rw-r--r--webapp/deploy/deploy_staging.sh26
2 files changed, 51 insertions, 0 deletions
diff --git a/webapp/deploy/deploy_prod.sh b/webapp/deploy/deploy_prod.sh
new file mode 100644
index 0000000..780b03a
--- /dev/null
+++ b/webapp/deploy/deploy_prod.sh
@@ -0,0 +1,25 @@
+cd $WORKSPACE
+
+# hacer el archive
+ARCHIVE="$BUILD_NUMBER.tar"
+git archive --format=tar HEAD webapp > $ARCHIVE
+
+# Copiar al server
+PROD=190.0.148.232
+USER=activitycentral
+scp $ARCHIVE $USER@$PROD:
+
+#pisar
+REPO=virtualenvs/polls
+ssh $USER@$PROD <<END
+tar --overwrite --exclude='webapp/db' -xvf $ARCHIVE -C $REPO
+sudo chown -R www-data $REPO/webapp/webapp/media
+sudo chown -R www-data $REPO/webapp/db
+cp -f $REPO/webapp/deploy/prod/env_settings.py $REPO/webapp/webapp/
+END
+
+# reiniciar uwsgi y apache
+ssh $USER@$PROD <<END
+sudo service uwsgi restart
+sudo service apache2 restart
+END
diff --git a/webapp/deploy/deploy_staging.sh b/webapp/deploy/deploy_staging.sh
new file mode 100644
index 0000000..5b97ab3
--- /dev/null
+++ b/webapp/deploy/deploy_staging.sh
@@ -0,0 +1,26 @@
+cd $WORKSPACE
+
+# hacer el archive
+ARCHIVE="$BUILD_NUMBER.tar"
+git archive --format=tar HEAD webapp > $ARCHIVE
+
+# Copiar al server
+ENV=staging
+SERVER=127.0.0.1
+USER=ceibal
+scp $ARCHIVE $USER@$SERVER:
+
+#pisar
+REPO=virtualenvs/polls/$ENV
+ssh $USER@$SERVER <<END
+tar --overwrite --exclude='webapp/db' -xvf $ARCHIVE -C $REPO
+sudo chown -R www-data $REPO/webapp/webapp/media
+sudo chown -R www-data $REPO/webapp/db
+cp -f $REPO/webapp/deploy/$ENV/env_settings.py $REPO/webapp/webapp/
+END
+
+# reiniciar uwsgi y apache
+ssh $USER@$SERVER <<END
+sudo service uwsgi restart
+sudo service apache2 restart
+END