MOD mineurs
[euphorik.git] / tools / mise_en_prod.rb
index 4ca524b..d95156c 100755 (executable)
@@ -20,7 +20,12 @@ along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
 
 $rep_remote = '/var/www/euphorik'
 $host = 'euphorik.ch'
-$opt_rsync = ''
+$opt_rsync = ''\r
+\r
+\r
+#TODO \r
+# - mettre à jour les numéros de versions en appelant le script "cope_num_version.rb"\r
+# - création de unit tests (voir eunit) et validation avant la mise en prod
 
 def creer_remote_rep(rep)
    begin
@@ -33,13 +38,17 @@ end
 # Compilation de la partie serveur
 Dir.chdir('../modules')
 puts `make`
+if $?.exitstatus != 0
+   puts "Echec de compilation de la partie serveuse"
+   exit 1
+end
+Dir.chdir('..')
 
 # 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}`
@@ -58,7 +67,7 @@ Dir.entries(rep_js).each{|fichier|
 
 # copie des modules erlang
 creer_remote_rep('modules')
-`rsync #{$opt_rsync} -r modules/ebin #{$host}:#{$rep_remote}/modules`
+`rsync #{$opt_rsync} -r --exclude 'euphorik_test.beam' modules/ebin #{$host}:#{$rep_remote}/modules`
 `rsync #{$opt_rsync} -r modules/include #{$host}:#{$rep_remote}/modules`
 
 # attribution des droits