Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Maintenance - Mise à jour mensuelle Lundi 6 Février entre 7h00 et 9h00
Open sidebar
genotoul-bioinfo
ng6
Commits
80d21431
Commit
80d21431
authored
Oct 15, 2013
by
Jerome Mariette
Browse files
No commit message
No commit message
parent
f4e94e99
Changes
2
Hide whitespace changes
Inline
Side-by-side
application.properties
View file @
80d21431
...
...
@@ -84,6 +84,7 @@ fastx_reverse_complement = /usr/bin/fastx_reverse_complement
#ContaminationSearch.batch_options = -q unlimitq
[resources]
typo3_src
=
http://prdownloads.sourceforge.net/typo3/typo3_src+dummy-4.7.12.zip
phix_bwa
=
/bank/bwadb/phi.fa
ecoli_bwa
=
/bank/bwadb/ecoli536
yeast_bwa
=
/bank/bwadb/yeast.nt
...
...
workflows/install/__init__.py
View file @
80d21431
...
...
@@ -14,32 +14,36 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from
subprocess
import
Popen
,
PIPE
from
jflow.workflow
import
Workflow
import
tempfile
,
os
,
sys
,
re
,
logging
from
jflow.workflow
import
Workflow
from
ng6.config_reader
import
NG6ConfigReader
from
os.path
import
expanduser
class
Install
(
Workflow
):
def
process
(
self
):
#typo3 variables
db_host
=
"localhost"
db_user
=
"root"
db_password
=
"root"
db_name
=
"t3"
# typo3 variables
ng6conf
=
NG6ConfigReader
()
db_host
,
db_user
,
db_password
,
db_name
=
ng6conf
.
get_typo3_db_params
()
db_tmp_name
=
db_name
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
]
!=
"/"
:
ng6_path
=
str
(
os
.
getcwd
())
+
"/"
+
"/"
.
join
(
sys
.
argv
[
0
].
split
(
"/"
)[:
-
2
])
else
:
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"
# TODO: web_dir doit etre un parametre
web_dir
=
"/var/www"
save_data_path
=
NG6ConfigReader
().
get_save_directory
()
+
"/data"
unzip_binary_path
=
""
...
...
@@ -48,7 +52,8 @@ class Install (Workflow):
# wget
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
)
stdout
,
stderr
=
p
.
communicate
()
...
...
@@ -60,11 +65,13 @@ class Install (Workflow):
#rename typo3 folder
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"
]
p
=
Popen
(
rename
,
stdout
=
PIPE
,
stderr
=
PIPE
)
stdout
,
stderr
=
p
.
communicate
()
#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"
]
p
=
Popen
(
slink_ext
,
stdout
=
PIPE
,
stderr
=
PIPE
)
stdout
,
stderr
=
p
.
communicate
()
...
...
@@ -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
+
"';"
]
p_mysql_check_db
=
Popen
(
mysql_check_db
,
stdout
=
PIPE
,
stderr
=
PIPE
)
stdout
,
stderr
=
p_mysql_check_db
.
communicate
()
# TODO: c'est quoi ce suffix_db ?
suffix_db
=
suffix_db
+
1
#Creating database typo3
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment