Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
ca572502
Commit
ca572502
authored
13 years ago
by
cramakri
Browse files
Options
Downloads
Patches
Plain Diff
LMS-2381 Added script that creates metabolomics version of openBIS.
SVN: 22013
parent
c9d28e89
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openbis_all/source/bash/upload-sprint-to-confluence.py
+44
-7
44 additions, 7 deletions
openbis_all/source/bash/upload-sprint-to-confluence.py
with
44 additions
and
7 deletions
openbis_all/source/bash/upload-sprint-to-confluence.py
+
44
−
7
View file @
ca572502
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#
#
from
__future__
import
with_statement
from
__future__
import
with_statement
from
datetime
import
date
from
datetime
import
date
import
sys
,
string
,
xmlrpclib
,
re
,
os
,
getpass
import
sys
,
string
,
xmlrpclib
,
re
,
os
,
getpass
,
subprocess
,
shutil
DOWNLOAD_FOLDER
=
"
./tmp/
"
DOWNLOAD_FOLDER
=
"
./tmp/
"
confluenceToken
=
None
confluenceToken
=
None
...
@@ -23,21 +23,20 @@ def printWiki(text=""):
...
@@ -23,21 +23,20 @@ def printWiki(text=""):
def
logIntoConfluence
():
def
logIntoConfluence
():
global
confluenceToken
global
confluenceToken
user
=
getpass
.
getuser
()
user
=
getpass
.
getuser
()
print
"
Please spe
fic
y Confluence password for user
"
,
user
print
"
Please spe
cif
y Confluence password for user
"
,
user
password
=
getpass
.
getpass
()
password
=
getpass
.
getpass
()
confluenceToken
=
confluenceServer
.
confluence1
.
login
(
user
,
password
)
confluenceToken
=
confluenceServer
.
confluence1
.
login
(
user
,
password
)
if
confluenceToken
is
None
:
if
confluenceToken
is
None
:
exit
(
"
Could not login page
"
+
spacekey
+
"
:
"
+
pagetitle
)
exit
(
"
Could not login page
"
+
spacekey
+
"
:
"
+
pagetitle
)
def
uploadReleaseBinaryToConfluence
(
filename
):
def
uploadReleaseBinaryToConfluence
(
filename
,
pagetitle
):
# ugly, but I don't want to spend more time here
# ugly, but I don't want to spend more time here
filepath
=
DOWNLOAD_FOLDER
+
"
/
"
+
filename
filepath
=
DOWNLOAD_FOLDER
+
"
/
"
+
filename
with
open
(
filepath
,
'
rb
'
)
as
f
:
with
open
(
filepath
,
'
rb
'
)
as
f
:
data
=
f
.
read
();
# slurp all the data
data
=
f
.
read
();
# slurp all the data
spacekey
=
"
bis
"
spacekey
=
"
bis
"
pagetitle
=
"
Sprint Releases
"
if
confluenceToken
is
None
:
if
confluenceToken
is
None
:
logIntoConfluence
()
logIntoConfluence
()
...
@@ -63,9 +62,9 @@ def printVersion(version):
...
@@ -63,9 +62,9 @@ def printVersion(version):
today
=
date
.
today
().
strftime
(
"
%d %B %Y
"
)
today
=
date
.
today
().
strftime
(
"
%d %B %Y
"
)
printWiki
(
"
h2. Version {0} ({1})
"
.
format
(
version
,
today
))
printWiki
(
"
h2. Version {0} ({1})
"
.
format
(
version
,
today
))
def
processFile
(
linkName
,
filePattern
,
version
,
listNestedLevels
=
1
):
def
processFile
(
linkName
,
filePattern
,
version
,
listNestedLevels
=
1
,
pagetitle
=
"
Sprint Releases
"
):
fileName
=
findFile
(
filePattern
+
"
-
"
+
version
)
fileName
=
findFile
(
filePattern
+
"
-
"
+
version
)
uploadReleaseBinaryToConfluence
(
fileName
)
uploadReleaseBinaryToConfluence
(
fileName
,
pagetitle
)
nestedPrefix
=
"
*
"
*
listNestedLevels
nestedPrefix
=
"
*
"
*
listNestedLevels
printWiki
(
"
{0} [{1}|^{2}]
"
.
format
(
nestedPrefix
,
linkName
,
fileName
))
printWiki
(
"
{0} [{1}|^{2}]
"
.
format
(
nestedPrefix
,
linkName
,
fileName
))
...
@@ -89,6 +88,36 @@ def uploadToConfluenceAndPrintPageText(version):
...
@@ -89,6 +88,36 @@ def uploadToConfluenceAndPrintPageText(version):
processFile
(
"
API
"
,
"
screening-api
"
,
version
)
processFile
(
"
API
"
,
"
screening-api
"
,
version
)
def
uploadToConfluenceMetabolomicsAndPrintPageText
(
version
):
wikiText
=
""
printVersion
(
version
)
printWiki
()
printWiki
(
"
h5. openBIS for Metabolomics
"
)
printWiki
()
processFile
(
"
Application Server (AS)
"
,
"
openBIS-server
"
,
version
,
1
,
"
openBIS Metabolomics
"
)
processFile
(
"
Data Store Server (DSS)
"
,
"
datastore_server_metabolomics
"
,
version
,
1
,
"
openBIS Metabolomics
"
)
processFile
(
"
DSS Client
"
,
"
dss_client
"
,
version
,
1
,
"
openBIS Metabolomics
"
)
printWiki
(
"
* [Documentation|^CISDDoc-{0}.html.zip]
"
.
format
(
version
))
printWiki
()
# datastore_server_plugin-yeastx
def
createMetabolomicsDssDist
(
version
):
# find the files we want to work with
datastore_server
=
findFile
(
"
datastore_server
"
+
"
-
"
+
version
)
yeastx_plugin
=
findFile
(
"
datastore_server_plugin-yeastx
"
+
"
-
"
+
version
)
# unzip the yeastx plugin and set up the dir structure
datastore_dir
=
DOWNLOAD_FOLDER
+
"
datastore_server/
"
subprocess
.
call
([
"
unzip
"
,
"
-d
"
+
datastore_dir
,
str
(
DOWNLOAD_FOLDER
+
yeastx_plugin
)])
# update the datastore_server zip
version_string
=
datastore_server
[
len
(
"
datastore_server
"
):
len
(
datastore_server
)]
metabolomics_zip
=
DOWNLOAD_FOLDER
+
"
datastore_server_metabolomics
"
+
version_string
shutil
.
copy
(
str
(
DOWNLOAD_FOLDER
+
datastore_server
),
metabolomics_zip
)
file_to_update
=
datastore_dir
+
"
lib/datastore_server_plugin-yeastx.jar
"
subprocess
.
call
([
"
zip
"
,
"
-u
"
,
metabolomics_zip
,
file_to_update
])
def
findFile
(
filePattern
):
def
findFile
(
filePattern
):
for
file
in
os
.
listdir
(
DOWNLOAD_FOLDER
):
for
file
in
os
.
listdir
(
DOWNLOAD_FOLDER
):
if
file
.
startswith
(
filePattern
):
if
file
.
startswith
(
filePattern
):
...
@@ -106,4 +135,12 @@ Example command: {0} S104
...
@@ -106,4 +135,12 @@ Example command: {0} S104
print
"
====================================================================
"
print
"
====================================================================
"
print
"
Paste the following text on the Sprint Releases page in confluence
"
print
"
Paste the following text on the Sprint Releases page in confluence
"
print
"
====================================================================
"
print
"
====================================================================
"
print
wikiText
print
wikiText
\ No newline at end of file
# Agios wants to access the yeastX version from this page
createMetabolomicsDssDist
(
version
)
uploadToConfluenceMetabolomicsAndPrintPageText
(
version
)
print
"
=========================================================================
"
print
"
Paste the following text on the openBIS Metabolomics page in confluence
"
print
"
=========================================================================
"
print
wikiText
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment