X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=mise_en_prod.rb;h=5c5a8f773d290eb24aa9d4a436229e17cb0de555;hp=ef1819e18b310409f331ad24bc18519adc6964ce;hb=13ea96f3600d1c42b22b6ea91dc75055555f72b7;hpb=e1c21cd05116920e07d1ab2b3b11d895edd9afb8 diff --git a/mise_en_prod.rb b/mise_en_prod.rb index ef1819e..5c5a8f7 100755 --- a/mise_en_prod.rb +++ b/mise_en_prod.rb @@ -1,17 +1,24 @@ #!/usr/bin/ruby -# la destination -$dest = 'gburri@euphorik.ch:/var/www/euphorik' -$dest = $*[0] if $*.length > 1 +def copy_files(dest, opt) + p "rsync #{opt} index.html #{dest}" + `rsync #{opt} index.html #{dest}` + `rsync #{opt} -r css #{dest}` + `rsync #{opt} -r img #{dest}` + `rsync #{opt} -r js #{dest}` + `rsync #{opt} -r lightbox #{dest}` + `rsync #{opt} -r modules/include #{dest}/modules` + `rsync #{opt} -r modules/ebin #{dest}/modules` + `rsync #{opt} -r pages #{dest}` +end -# les options communes -$opt = '' - -`rsync $opt index.html #{$dest}` -`rsync $opt -r css #{$dest}` -`rsync $opt -r img #{$dest}` -`rsync $opt -r js #{$dest}` -`rsync $opt -r lightbox #{$dest}` -`rsync $opt -r modules/include #{$dest}/modules` -`rsync $opt -r modules/ebin #{$dest}/modules` -`rsync $opt -r pages #{$dest}` +if __FILE__ == $0 + # la destination + $dest = 'gburri@euphorik.ch:/var/www/euphorik' + $dest = $*[0] if $*.length > 1 + + # les options communes + $opt = '' + + copy_files($dest, $opt) +end