Con este shell script simplificaremos el proceso para hacer un push a nuestros repos Git.
Nota: Se asume que se tiene un repositorio Git previamente configurado.
USO
| (function($,w){ | |
| $(function(){ | |
| var $w = $(w).width(); | |
| var $h = $(w).height(); | |
| var vEngine = { | |
| render : function(){ |
| (function($){ | |
| $.fn.Focus = function(){ | |
| $(this).focus(); | |
| $(this).attr('autofocus',''); | |
| } | |
| $(function(){ |
A continuación configuraremos nuestro repositorio local, para que este tenga la habilidad de actualizarce desde dos origenes (origin/master y upstream/master):
origin/master: es nuestro repositorio forked en github. upstream/master: es el repositorio master al cual le hemos hecho fork
Con este pequeño código haremos un autodespliegue de nuestro repositorio en nuestro servidor. Debemos tener instalando Node.js con Npm (Instalar nodejs y npm), también es necesario GIT (Instalar Git) previamente. Luego podemos seguir con las instruciones.
Instruciones:
| #!/bin/sh | |
| echo 'Desplegando máquina' | |
| cd /etc | |
| sudo apt-get install nginx | |
| sudo apt-get install mysql-server | |
| sudo apt-get install mysql_secure_installation | |
| sudo apt-get install php5 php-pear php5-fpm php5-mysql php5-dev | |
| echo 'cgi.fix_pathinfo=0' >> php5/fpm/php.ini | |
| sudo service php5-fpm restart |
| $.fn.serializeObject = function() | |
| { | |
| var o = {}; | |
| var a = this.serializeArray(); | |
| $.each(a, function() { | |
| if (o[this.name] !== undefined) { | |
| if (!o[this.name].push) { | |
| o[this.name] = [o[this.name]]; | |
| } | |
| o[this.name].push(this.value || ''); |
| // String cuando_paso | |
| // params | |
| // int time <tiempo unix> | |
| function cuando_paso (time) | |
| { | |
| var time = Math.floor( (new Date().getTime() / 1000) - Math.floor(time / 1000)); // obtenemos el tiempo actual | |
| var tiempos = { |