Commit 80d21431 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

No commit message

No commit message
parent f4e94e99
...@@ -84,6 +84,7 @@ fastx_reverse_complement = /usr/bin/fastx_reverse_complement ...@@ -84,6 +84,7 @@ fastx_reverse_complement = /usr/bin/fastx_reverse_complement
#ContaminationSearch.batch_options = -q unlimitq #ContaminationSearch.batch_options = -q unlimitq
[resources] [resources]
typo3_src = http://prdownloads.sourceforge.net/typo3/typo3_src+dummy-4.7.12.zip
phix_bwa = /bank/bwadb/phi.fa phix_bwa = /bank/bwadb/phi.fa
ecoli_bwa = /bank/bwadb/ecoli536 ecoli_bwa = /bank/bwadb/ecoli536
yeast_bwa = /bank/bwadb/yeast.nt yeast_bwa = /bank/bwadb/yeast.nt
......
...@@ -14,32 +14,36 @@ ...@@ -14,32 +14,36 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
from jflow.workflow import Workflow
import tempfile, os, sys, re, logging import tempfile, os, sys, re, logging
from jflow.workflow import Workflow
from ng6.config_reader import NG6ConfigReader from ng6.config_reader import NG6ConfigReader
from os.path import expanduser
class Install (Workflow): class Install (Workflow):
def process(self): def process(self):
#typo3 variables # typo3 variables
db_host ="localhost" ng6conf = NG6ConfigReader()
db_user ="root" db_host, db_user, db_password, db_name = ng6conf.get_typo3_db_params()
db_password ="root"
db_name ="t3"
db_tmp_name=db_name db_tmp_name=db_name
suffix_db = 1 suffix_db = 1
home_path = expanduser("~")
# TODO: a modifier ce n'est pas jolie, utilise la path du file, tu le fera en 1 ligne!!
if "/".join(sys.argv[0].split("/")[:-2])[0] != "/": if "/".join(sys.argv[0].split("/")[:-2])[0] != "/":
ng6_path = str(os.getcwd()) + "/" +"/".join(sys.argv[0].split("/")[:-2]) ng6_path = str(os.getcwd()) + "/" +"/".join(sys.argv[0].split("/")[:-2])
else: else:
ng6_path = "/".join(sys.argv[0].split("/")[:-2]) ng6_path = "/".join(sys.argv[0].split("/")[:-2])
# TODO: utililse os.path.join !!! ca c'est sous unix ...
db_path = ng6_path +"/workflows/install/data_typo3/database.sql" db_path = ng6_path +"/workflows/install/data_typo3/database.sql"
# TODO: web_dir doit etre un parametre
web_dir="/var/www" web_dir="/var/www"
save_data_path = NG6ConfigReader().get_save_directory()+"/data" save_data_path = NG6ConfigReader().get_save_directory()+"/data"
unzip_binary_path="" unzip_binary_path=""
...@@ -48,7 +52,8 @@ class Install (Workflow): ...@@ -48,7 +52,8 @@ class Install (Workflow):
# wget # wget
dummy_tmp = tempfile.NamedTemporaryFile(prefix = 'dummy_', suffix = '.zip').name dummy_tmp = tempfile.NamedTemporaryFile(prefix = 'dummy_', suffix = '.zip').name
wget = ["wget", "--output-document", dummy_tmp, "http://prdownloads.sourceforge.net/typo3/typo3_src+dummy-4.7.12.zip"] # TODO: j'ai mis le nom dans le .properties d'application c'est une ressource
wget = ["wget", "--output-document", dummy_tmp, self.get_resource("typo3_src")]
p = Popen(wget, stdout=PIPE, stderr=PIPE) p = Popen(wget, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate() stdout, stderr = p.communicate()
...@@ -60,11 +65,13 @@ class Install (Workflow): ...@@ -60,11 +65,13 @@ class Install (Workflow):
#rename typo3 folder #rename typo3 folder
typo3_dir = os.listdir(dummy_tmp_dir)[0] typo3_dir = os.listdir(dummy_tmp_dir)[0]
# TODO: c'est quoi ce ng62 ??
rename=["mv", dummy_tmp_dir+"/"+typo3_dir, dummy_tmp_dir+"/ng62"] rename=["mv", dummy_tmp_dir+"/"+typo3_dir, dummy_tmp_dir+"/ng62"]
p = Popen(rename, stdout=PIPE, stderr=PIPE) p = Popen(rename, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate() stdout, stderr = p.communicate()
#link ng6 folder #link ng6 folder
# TODO: ne fait pas des links mais des cp
slink_ext=["ln","-s", ng6_path+"/ui/nG6", dummy_tmp_dir+"/ng62/typo3conf/ext/nG6"] slink_ext=["ln","-s", ng6_path+"/ui/nG6", dummy_tmp_dir+"/ng62/typo3conf/ext/nG6"]
p = Popen(slink_ext, stdout=PIPE, stderr=PIPE) p = Popen(slink_ext, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate() stdout, stderr = p.communicate()
...@@ -129,6 +136,7 @@ class Install (Workflow): ...@@ -129,6 +136,7 @@ class Install (Workflow):
mysql_check_db= ["mysql", "--host=" + db_host, "--user=" + db_user, "--password=" + db_password, "-e", "SHOW DATABASES LIKE '" + db_tmp_name + "';" ] mysql_check_db= ["mysql", "--host=" + db_host, "--user=" + db_user, "--password=" + db_password, "-e", "SHOW DATABASES LIKE '" + db_tmp_name + "';" ]
p_mysql_check_db = Popen(mysql_check_db, stdout=PIPE, stderr=PIPE) p_mysql_check_db = Popen(mysql_check_db, stdout=PIPE, stderr=PIPE)
stdout, stderr = p_mysql_check_db.communicate() stdout, stderr = p_mysql_check_db.communicate()
# TODO: c'est quoi ce suffix_db ?
suffix_db = suffix_db+1 suffix_db = suffix_db+1
#Creating database typo3 #Creating database typo3
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment