X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=tools%2Fmise_en_prod.rb;fp=tools%2Fmise_en_prod.rb;h=4ca524b1bcb82d577ad40933eea2d4f99a972b0c;hp=19e180ba9bbce72ec0ead280325b49fc778787ad;hb=5863ffcf7e4d95a95316dd1a64f471cf7a46d944;hpb=a193d10c45d8226937c91a17dc588e4f6f1586fd diff --git a/tools/mise_en_prod.rb b/tools/mise_en_prod.rb index 19e180b..4ca524b 100755 --- a/tools/mise_en_prod.rb +++ b/tools/mise_en_prod.rb @@ -18,13 +18,6 @@ You should have received a copy of the GNU General Public License along with Euphorik. If not, see . =end - - -### MAKE -Dir.chdir('../modules') -puts `make` - -### COPIE $rep_remote = '/var/www/euphorik' $host = 'euphorik.ch' $opt_rsync = '' @@ -36,13 +29,21 @@ def creer_remote_rep(rep) end end + +# Compilation de la partie serveur +Dir.chdir('../modules') +puts `make` + +# création du repertoire BD creer_remote_rep('BD') `ssh #{$host} "chmod g+w #{$rep_remote}/BD"` +# copie de la partie statique : css, images, html, etc.. Dir.chdir('..') print `rsync #{$opt_rsync} index.yaws #{$host}:#{$rep_remote}` print `rsync #{$opt_rsync} favicon.ico #{$host}:#{$rep_remote}` print `rsync #{$opt_rsync} -r css #{$host}:#{$rep_remote}` +print `rsync #{$opt_rsync} -r pages #{$host}:#{$rep_remote}` print `rsync #{$opt_rsync} -r --exclude 'autres' img #{$host}:#{$rep_remote}` # copie des js avec minification @@ -55,10 +56,14 @@ Dir.entries(rep_js).each{|fichier| end } +# copie des modules erlang creer_remote_rep('modules') `rsync #{$opt_rsync} -r modules/ebin #{$host}:#{$rep_remote}/modules` `rsync #{$opt_rsync} -r modules/include #{$host}:#{$rep_remote}/modules` -`rsync #{$opt_rsync} -r pages #{$host}:#{$rep_remote}` - +# attribution des droits +`ssh #{$host} "chmod -R g+rx #{$rep_remote}"` +# execution du script de mise à jour +print `cat tools/mise_en_prod.erl | ssh #{$host} "cat > /tmp/mise_en_prod.erl"` +print `ssh #{$host} "chmod u+x /tmp/mise_en_prod.erl; /tmp/mise_en_prod.erl; rm /tmp/mise_en_prod.erl"`