Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
limbra
limbra
Commits
08370113
Commit
08370113
authored
May 29, 2016
by
LE GAC Renaud
Browse files
Update build_version.py to search git and pdflatex only on the localhost.
parent
35110733
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
build_version.py
build_version.py
+18
-15
No files found.
build_version.py
View file @
08370113
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
> ./build_version -h
> ./build_version -h
AUTHOR
AUTHOR
R. Le Gac,
renaud.
legac@cppm.in2p3.fr
R. Le Gac, legac@cppm.in2p3.fr
Copyright (c) 2012-2016 R. Le Gac
Copyright (c) 2012-2016 R. Le Gac
...
@@ -83,7 +83,7 @@ JSLIBSRC_CNT = opj(APP_STATIC_CNT, APP, "src")
...
@@ -83,7 +83,7 @@ JSLIBSRC_CNT = opj(APP_STATIC_CNT, APP, "src")
def
_do_sencha
(
sencha
,
extjssrc
,
jslibsrc
,
dbuisrc
,
jslibdebug
,
jslibmin
):
def
_do_sencha
(
sencha
,
extjssrc
,
jslibsrc
,
dbuisrc
,
jslibdebug
,
jslibmin
):
"""Build javascript libraries when the sencha command is located
"""Build javascript libraries when the sencha command is located
on
h
te local host or run behind a docker container.
on t
h
e local host or run behind a docker container.
Args:
Args:
sencha (list): sencha command
sencha (list): sencha command
...
@@ -101,7 +101,7 @@ def _do_sencha(sencha, extjssrc, jslibsrc, dbuisrc, jslibdebug, jslibmin):
...
@@ -101,7 +101,7 @@ def _do_sencha(sencha, extjssrc, jslibsrc, dbuisrc, jslibdebug, jslibmin):
"exclude"
,
"--namespace"
,
"Ext,App"
,
"exclude"
,
"--namespace"
,
"Ext,App"
,
"and"
,
"concat"
,
jslibdebug
])
"and"
,
"concat"
,
jslibdebug
])
c
all
(
cmd
)
c
heck_output
(
cmd
)
cmd
=
list
(
sencha
)
cmd
=
list
(
sencha
)
cmd
.
extend
([
cmd
.
extend
([
...
@@ -110,7 +110,7 @@ def _do_sencha(sencha, extjssrc, jslibsrc, dbuisrc, jslibdebug, jslibmin):
...
@@ -110,7 +110,7 @@ def _do_sencha(sencha, extjssrc, jslibsrc, dbuisrc, jslibdebug, jslibmin):
"exclude"
,
"--namespace"
,
"Ext,App"
,
"exclude"
,
"--namespace"
,
"Ext,App"
,
"and"
,
"concat"
,
"--yui"
,
jslibmin
])
"and"
,
"concat"
,
"--yui"
,
jslibmin
])
c
all
(
cmd
)
c
heck_output
(
cmd
)
def
build
():
def
build
():
...
@@ -121,10 +121,7 @@ def build():
...
@@ -121,10 +121,7 @@ def build():
build_html
()
build_html
()
for
doc
in
(
USER
,):
for
doc
in
(
USER
,):
docsrc
=
opj
(
DOCSRC
,
doc
)
build_pdf
(
doc
)
if
os
.
path
.
exists
(
docsrc
):
build_pdf
(
doc
)
def
build_html
():
def
build_html
():
...
@@ -154,7 +151,7 @@ def build_pdf(doc):
...
@@ -154,7 +151,7 @@ def build_pdf(doc):
"""
"""
print
"
\n\t
Build the PDF documentations..."
print
"
\n\t
Build the PDF documentations..."
if
not
which
(
"pdflatex"
):
if
not
which
(
"pdflatex"
,
localhost
=
True
):
print
'
\n\t
The application pdflatex is missing !'
print
'
\n\t
The application pdflatex is missing !'
print
'
\t
Skip this step.
\n
'
print
'
\t
Skip this step.
\n
'
return
return
...
@@ -214,7 +211,7 @@ def change_log():
...
@@ -214,7 +211,7 @@ def change_log():
"""
"""
print
"
\n\t
Commit CHANGELOG..."
print
"
\n\t
Commit CHANGELOG..."
if
not
which
(
"git"
):
if
not
which
(
"git"
,
localhost
=
True
):
print
'
\n\t
The application git is missing !'
print
'
\n\t
The application git is missing !'
print
'
\t
Skip this step.
\n
'
print
'
\t
Skip this step.
\n
'
return
return
...
@@ -345,7 +342,7 @@ def git(*args, **kwargs):
...
@@ -345,7 +342,7 @@ def git(*args, **kwargs):
git("commit", stdout=fi)
git("commit", stdout=fi)
"""
"""
if
not
which
(
"git"
):
if
not
which
(
"git"
,
localhost
=
True
):
print
'
\n\t
The application git is missing !'
print
'
\n\t
The application git is missing !'
print
'
\t
Skip this step.
\n
'
print
'
\t
Skip this step.
\n
'
return
return
...
@@ -670,12 +667,14 @@ def start_release():
...
@@ -670,12 +667,14 @@ def start_release():
build
()
build
()
def
which
(
cmd
):
def
which
(
cmd
,
localhost
=
False
):
"""Test if the command exists on the localhost or on a docker container.
"""Test if the command exists on the localhost or on a docker container.
Return the sequence to execute it. Priority is given to the localhost.
Return the sequence to execute it. Priority is given to the localhost.
Args:
Args:
cmd (str): name of the command
cmd (str): name of the command
localhost (bool): force the command to be on localhost even if
the option force_container is true.
Returns:
Returns:
list: command to be executed. The list is empty when the command is
list: command to be executed. The list is empty when the command is
...
@@ -683,13 +682,15 @@ def which(cmd):
...
@@ -683,13 +682,15 @@ def which(cmd):
"""
"""
# local host
# local host
if
not
ARGS
.
force_container
:
if
not
ARGS
.
force_container
or
localhost
:
try
:
try
:
out
=
check_output
([
"which"
,
cmd
])
out
=
check_output
([
"which"
,
cmd
])
print
"
\n\t
Command"
,
cmd
,
"found on the localhost"
return
[
out
.
strip
(
"
\n
"
)]
return
[
out
.
strip
(
"
\n
"
)]
except
CalledProcessError
:
except
CalledProcessError
:
print
"
\n\t
Command"
,
cmd
,
"not found on the localhost"
if
localhost
:
return
[]
# docker container is running ?
# docker container is running ?
container
=
ARGS
.
docker_container
container
=
ARGS
.
docker_container
...
@@ -711,10 +712,12 @@ def which(cmd):
...
@@ -711,10 +712,12 @@ def which(cmd):
try
:
try
:
out
=
check_output
([
"docker"
,
"exec"
,
container
,
"which"
,
cmd
])
out
=
check_output
([
"docker"
,
"exec"
,
container
,
"which"
,
cmd
])
path
=
out
.
strip
(
"
\n
"
)
path
=
out
.
strip
(
"
\n
"
)
print
"
\n\t
Command"
,
cmd
,
"found on the container"
,
container
return
[
"docker"
,
"exec"
,
container
,
path
]
return
[
"docker"
,
"exec"
,
container
,
path
]
except
CalledProcessError
:
except
CalledProcessError
:
print
"
\n\t
Command"
,
cmd
,
"not found on the %s container"
%
container
print
"
\n\t
Command"
,
cmd
,
\
"not found on the localhost nor in the container %s"
%
container
return
[]
return
[]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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