Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.devtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.devtools
Commits
2a5ac5a9
Commit
2a5ac5a9
authored
6 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[bootstrap] make set_environment use logger in a simpler way...
parent
a6959ee5
No related branches found
No related tags found
No related merge requests found
Pipeline
#26166
passed
6 years ago
Stage: build
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bob/devtools/bootstrap.py
+2
-6
2 additions, 6 deletions
bob/devtools/bootstrap.py
bob/devtools/build.py
+6
-9
6 additions, 9 deletions
bob/devtools/build.py
bob/devtools/scripts/build.py
+5
-5
5 additions, 5 deletions
bob/devtools/scripts/build.py
with
13 additions
and
20 deletions
bob/devtools/bootstrap.py
+
2
−
6
View file @
2a5ac5a9
...
...
@@ -46,7 +46,7 @@ import logging
logger
=
logging
.
getLogger
(
__name__
)
def
set_environment
(
name
,
value
,
env
=
os
.
environ
,
verbose
=
False
):
def
set_environment
(
name
,
value
,
env
=
os
.
environ
):
'''
Function to setup the environment variable and print debug message
Args:
...
...
@@ -54,14 +54,10 @@ def set_environment(name, value, env=os.environ, verbose=False):
name: The name of the environment variable to set
value: The value to set the environment variable to
env: Optional environment (dictionary) where to set the variable at
verbose: Increases the verbosity of variable reporting
'''
env
[
name
]
=
value
logat
=
logger
.
debug
if
verbose
:
logat
=
logger
.
info
logat
(
'
environ[
"
%s
"
] = %s
'
,
name
,
value
)
logger
.
info
(
'
environ[
"
%s
"
] = %s
'
,
name
,
value
)
return
value
...
...
This diff is collapsed.
Click to expand it.
bob/devtools/build.py
+
6
−
9
View file @
2a5ac5a9
...
...
@@ -451,15 +451,13 @@ if __name__ == '__main__':
bootstrap
.
setup_logger
(
logger
,
args
.
verbose
)
VERB
=
(
verbose
>=
2
)
bootstrap
.
set_environment
(
'
DOCSERVER
'
,
bootstrap
.
_SERVER
,
verbose
=
VERB
)
bootstrap
.
set_environment
(
'
LANG
'
,
'
en_US.UTF-8
'
,
verbose
=
VERB
)
bootstrap
.
set_environment
(
'
LC_ALL
'
,
os
.
environ
[
'
LANG
'
],
verbose
=
VERB
)
bootstrap
.
set_environment
(
'
DOCSERVER
'
,
bootstrap
.
_SERVER
)
bootstrap
.
set_environment
(
'
LANG
'
,
'
en_US.UTF-8
'
)
bootstrap
.
set_environment
(
'
LC_ALL
'
,
os
.
environ
[
'
LANG
'
])
# get information about the version of the package being built
version
,
is_prerelease
=
check_version
(
args
.
work_dir
,
args
.
tag
)
bootstrap
.
set_environment
(
'
BOB_PACKAGE_VERSION
'
,
version
,
verbose
=
VERB
)
bootstrap
.
set_environment
(
'
BOB_PACKAGE_VERSION
'
,
version
)
# create the build configuration
conda_build_config
=
os
.
path
.
join
(
mydir
,
'
data
'
,
'
conda_build_config.yaml
'
)
...
...
@@ -489,8 +487,7 @@ if __name__ == '__main__':
# retrieve the current build number for this build
build_number
,
_
=
next_build_number
(
channels
[
0
],
args
.
name
,
version
,
args
.
python_version
)
bootstrap
.
set_environment
(
'
BOB_BUILD_NUMBER
'
,
str
(
build_number
),
verbose
=
VERB
)
bootstrap
.
set_environment
(
'
BOB_BUILD_NUMBER
'
,
str
(
build_number
))
# runs the build using the conda-build API
arch
=
conda_arch
()
...
...
@@ -500,4 +497,4 @@ if __name__ == '__main__':
conda_build
.
api
.
build
(
os
.
path
.
join
(
args
.
work_dir
,
'
conda
'
),
config
=
conda_config
)
git_clean_build
(
bootstrap
.
run_cmdline
,
verbose
=
VERB
)
git_clean_build
(
bootstrap
.
run_cmdline
,
verbose
=
(
args
.
verbose
>=
2
)
)
This diff is collapsed.
Click to expand it.
bob/devtools/scripts/build.py
+
5
−
5
View file @
2a5ac5a9
...
...
@@ -114,14 +114,14 @@ def build(recipe_dir, python, condarc, config, no_test, append_file,
conda_config
=
make_conda_config
(
config
,
python
,
append_file
,
condarc_options
)
set_environment
(
'
MATPLOTLIBRC
'
,
MATPLOTLIB_RCDIR
,
verbose
=
True
)
set_environment
(
'
MATPLOTLIBRC
'
,
MATPLOTLIB_RCDIR
)
# setup BOB_DOCUMENTATION_SERVER environment variable (used for bob.extension
# and derived documentation building via Sphinx)
set_environment
(
'
DOCSERVER
'
,
server
,
verbose
=
True
)
set_environment
(
'
DOCSERVER
'
,
server
)
doc_urls
=
get_docserver_setup
(
public
=
(
not
private
),
stable
=
stable
,
server
=
server
,
intranet
=
ci
)
set_environment
(
'
BOB_DOCUMENTATION_SERVER
'
,
doc_urls
,
verbose
=
True
)
set_environment
(
'
BOB_DOCUMENTATION_SERVER
'
,
doc_urls
)
for
d
in
recipe_dir
:
...
...
@@ -131,7 +131,7 @@ def build(recipe_dir, python, condarc, config, no_test, append_file,
version_candidate
=
os
.
path
.
join
(
d
,
'
..
'
,
'
version.txt
'
)
if
os
.
path
.
exists
(
version_candidate
):
version
=
open
(
version_candidate
).
read
().
rstrip
()
set_environment
(
'
BOB_PACKAGE_VERSION
'
,
version
,
verbose
=
True
)
set_environment
(
'
BOB_PACKAGE_VERSION
'
,
version
)
# pre-renders the recipe - figures out package name and version
metadata
=
get_rendered_metadata
(
d
,
conda_config
)
...
...
@@ -151,7 +151,7 @@ def build(recipe_dir, python, condarc, config, no_test, append_file,
rendered_recipe
[
'
package
'
][
'
name
'
],
rendered_recipe
[
'
package
'
][
'
version
'
],
python
)
set_environment
(
'
BOB_BUILD_NUMBER
'
,
str
(
build_number
)
,
verbose
=
True
)
set_environment
(
'
BOB_BUILD_NUMBER
'
,
str
(
build_number
))
logger
.
info
(
'
Building %s-%s-py%s (build: %d) for %s
'
,
rendered_recipe
[
'
package
'
][
'
name
'
],
...
...
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