(no commit message)
authorGreg Burri <greg.burri@gmail.com>
Thu, 24 Jul 2008 08:14:21 +0000 (08:14 +0000)
committerGreg Burri <greg.burri@gmail.com>
Thu, 24 Jul 2008 08:14:21 +0000 (08:14 +0000)
tools/tool.rb [deleted file]
tools/tools.rb [new file with mode: 0644]

diff --git a/tools/tool.rb b/tools/tool.rb
deleted file mode 100644 (file)
index fe7eb9d..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/ruby
-=begin
-Copyright 2008 Grégory Burri
-
-This file is part of Euphorik.
-
-Euphorik is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Euphorik is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
-=end
-\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\r
-\r
-class MiseEnProd\r
-   @@rep_remote = '/var/www/euphorik'\r
-   @@host = 'euphorik.ch'\r
-   @@opt_rsync = ''\r
-   \r
-   def initialize      \r
-   end  \r
-\r
-   def creer_remote_rep(rep)      \r
-      begin\r
-         `ssh #{@@host} "mkdir #{@@rep_remote}/#{rep}"`\r
-      rescue\r
-      end\r
-   end\r
-   \r
-   def compiler_partie_serveuse\r
-      Dir.chdir(@@rep_remote + '/modules')\r
-      puts `make`\r
-      if $?.exitstatus != 0\r
-         puts "Echec de compilation de la partie serveuse"\r
-         exit 1\r
-      end\r
-      Dir.chdir('..')\r
-   end\r
-   \r
-   def creer_repertoire_bd      \r
-      # création du repertoire BD\r
-      creer_remote_rep('BD')\r
-      creer_remote_rep('BD/backup')\r
-      `ssh #{@@host} "chmod g+w #{@@rep_remote}/BD"`\r
-   end\r
-   \r
-   # css, images, html, etc..\r
-   def copier_partie_statique      \r
-      print `rsync #{$opt_rsync} index.yaws #{$host}:#{$rep_remote}`\r
-      print `rsync #{$opt_rsync} favicon.ico #{$host}:#{$rep_remote}`\r
-      print `rsync #{$opt_rsync} -r css #{$host}:#{$rep_remote}`\r
-      print `rsync #{$opt_rsync} -r pages #{$host}:#{$rep_remote}`\r
-      print `rsync #{$opt_rsync} -r --exclude 'autres' img #{$host}:#{$rep_remote}`      \r
-   end\r
-   \r
-   # contrôle des fichiers js à l'aide de jslint\r
-   # @return false si une erreur est survenue durant la vérification\r
-   def check_js\r
-      \r
-   end\r
-\r
-   # minification et package des fichiers js dans euphorik.js\r
-   def pack_js\r
-      # copie des js avec minification\r
-      rep_js = 'js'\r
-      creer_remote_rep(rep_js)\r
-      Dir.entries(rep_js).each{|fichier|\r
-         if fichier[0..0] != '.' and fichier != 'debug.js'\r
-            puts "Minimisation et copie de #{fichier}"\r
-            print `tools/jsmin.rb < #{rep_js}/#{fichier} | ssh #{@@host} "cat > #{@@rep_remote}/#{rep_js}/#{fichier}"`\r
-         end\r
-      }      \r
-   end\r
-   \r
-   def copie_modules_serveurs      \r
-      # copie des modules erlang\r
-      creer_remote_rep('modules')\r
-      `rsync #{@@opt_rsync} -r --exclude 'euphorik_test.beam' modules/ebin #{@@host}:#{@@rep_remote}/modules`\r
-      `rsync #{@@opt_rsync} -r modules/include #{@@host}:#{@@rep_remote}/modules`\r
-   end\r
-   \r
-   def set_droits_fichiers\r
-      # attribution des droits\r
-      `ssh #{$host} "chmod -R g+rx #{$rep_remote}"`      \r
-   end\r
-   \r
-   def maj\r
-      # execution du script de mise à jour\r
-      print `cat tools/mise_en_prod.erl | ssh #{$host} "cat > /tmp/mise_en_prod.erl"`\r
-      print `ssh #{$host} "chmod u+x /tmp/mise_en_prod.erl; /tmp/mise_en_prod.erl; rm /tmp/mise_en_prod.erl"`\r
-   end\r
-end
diff --git a/tools/tools.rb b/tools/tools.rb
new file mode 100644 (file)
index 0000000..fe7eb9d
--- /dev/null
@@ -0,0 +1,102 @@
+#!/usr/bin/ruby
+=begin
+Copyright 2008 Grégory Burri
+
+This file is part of Euphorik.
+
+Euphorik is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Euphorik is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Euphorik.  If not, see <http://www.gnu.org/licenses/>.
+=end
+\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\r
+\r
+class MiseEnProd\r
+   @@rep_remote = '/var/www/euphorik'\r
+   @@host = 'euphorik.ch'\r
+   @@opt_rsync = ''\r
+   \r
+   def initialize      \r
+   end  \r
+\r
+   def creer_remote_rep(rep)      \r
+      begin\r
+         `ssh #{@@host} "mkdir #{@@rep_remote}/#{rep}"`\r
+      rescue\r
+      end\r
+   end\r
+   \r
+   def compiler_partie_serveuse\r
+      Dir.chdir(@@rep_remote + '/modules')\r
+      puts `make`\r
+      if $?.exitstatus != 0\r
+         puts "Echec de compilation de la partie serveuse"\r
+         exit 1\r
+      end\r
+      Dir.chdir('..')\r
+   end\r
+   \r
+   def creer_repertoire_bd      \r
+      # création du repertoire BD\r
+      creer_remote_rep('BD')\r
+      creer_remote_rep('BD/backup')\r
+      `ssh #{@@host} "chmod g+w #{@@rep_remote}/BD"`\r
+   end\r
+   \r
+   # css, images, html, etc..\r
+   def copier_partie_statique      \r
+      print `rsync #{$opt_rsync} index.yaws #{$host}:#{$rep_remote}`\r
+      print `rsync #{$opt_rsync} favicon.ico #{$host}:#{$rep_remote}`\r
+      print `rsync #{$opt_rsync} -r css #{$host}:#{$rep_remote}`\r
+      print `rsync #{$opt_rsync} -r pages #{$host}:#{$rep_remote}`\r
+      print `rsync #{$opt_rsync} -r --exclude 'autres' img #{$host}:#{$rep_remote}`      \r
+   end\r
+   \r
+   # contrôle des fichiers js à l'aide de jslint\r
+   # @return false si une erreur est survenue durant la vérification\r
+   def check_js\r
+      \r
+   end\r
+\r
+   # minification et package des fichiers js dans euphorik.js\r
+   def pack_js\r
+      # copie des js avec minification\r
+      rep_js = 'js'\r
+      creer_remote_rep(rep_js)\r
+      Dir.entries(rep_js).each{|fichier|\r
+         if fichier[0..0] != '.' and fichier != 'debug.js'\r
+            puts "Minimisation et copie de #{fichier}"\r
+            print `tools/jsmin.rb < #{rep_js}/#{fichier} | ssh #{@@host} "cat > #{@@rep_remote}/#{rep_js}/#{fichier}"`\r
+         end\r
+      }      \r
+   end\r
+   \r
+   def copie_modules_serveurs      \r
+      # copie des modules erlang\r
+      creer_remote_rep('modules')\r
+      `rsync #{@@opt_rsync} -r --exclude 'euphorik_test.beam' modules/ebin #{@@host}:#{@@rep_remote}/modules`\r
+      `rsync #{@@opt_rsync} -r modules/include #{@@host}:#{@@rep_remote}/modules`\r
+   end\r
+   \r
+   def set_droits_fichiers\r
+      # attribution des droits\r
+      `ssh #{$host} "chmod -R g+rx #{$rep_remote}"`      \r
+   end\r
+   \r
+   def maj\r
+      # execution du script de mise à jour\r
+      print `cat tools/mise_en_prod.erl | ssh #{$host} "cat > /tmp/mise_en_prod.erl"`\r
+      print `ssh #{$host} "chmod u+x /tmp/mise_en_prod.erl; /tmp/mise_en_prod.erl; rm /tmp/mise_en_prod.erl"`\r
+   end\r
+end