Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.devtools
Commits
b61e2f9e
Commit
b61e2f9e
authored
Jan 17, 2019
by
André Anjos
💬
Browse files
[build] Fix missing channels
parent
57406c3c
Pipeline
#26038
failed with stages
in 1 minute and 22 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/devtools/build.py
View file @
b61e2f9e
...
...
@@ -105,6 +105,23 @@ def next_build_number(channel_url, name, version, python):
def
make_conda_config
(
config
,
python
,
append_file
,
condarc_options
):
'''Creates a conda configuration for a build merging various sources
This function will use the conda-build API to construct a configuration by
merging different sources of information.
Args:
config: Path leading to the ``conda_build_config.yaml`` to use
python: The version of python to use for the build as ``x.y`` (e.g.
``3.6``)
append_file: Path leading to the ``recipe_append.yaml`` file to use
condarc_options: A dictionary (typically read from a condarc YAML file)
that contains build and channel options
Returns: A dictionary containing the merged configuration, as produced by
conda-build API's ``get_or_merge_config()`` function.
'''
from
conda_build.api
import
get_or_merge_config
from
conda_build.conda_interface
import
url_path
...
...
@@ -271,6 +288,13 @@ if __name__ == '__main__':
with
open
(
condarc
,
'rb'
)
as
f
:
condarc_options
=
yaml
.
load
(
f
)
# notice this condarc typically will only contain the defaults channel - we
# need to boost this up with more channels to get it right.
channels
=
bootstrap
.
get_channels
(
public
=
(
os
.
environ
[
'CI_PROJECT_VISIBILITY'
]
==
'public'
),
stable
=
(
not
is_prerelease
),
server
=
bootstrap
.
_SERVER
,
intranet
=
True
)
condarc_options
[
'channels'
]
=
channels
+
[
'defaults'
]
conda_config
=
make_conda_config
(
conda_build_config
,
pyver
,
recipe_append
,
condarc_options
)
...
...
@@ -296,9 +320,7 @@ if __name__ == '__main__':
'a tagged build. Use ``bdt release`` to create stable releases'
,
version
)
channels
=
bootstrap
.
get_channels
(
public
=
(
os
.
environ
[
'CI_PROJECT_VISIBILITY'
]
==
'public'
),
stable
=
(
not
is_prerelease
),
server
=
bootstrap
.
_SERVER
,
intranet
=
True
)
# retrieve the current build number for this build
build_number
,
_
=
next_build_number
(
channels
[
0
],
name
,
version
,
pyver
)
bootstrap
.
set_environment
(
'BOB_BUILD_NUMBER'
,
str
(
build_number
),
verbose
=
True
)
...
...
bob/devtools/scripts/build.py
View file @
b61e2f9e
...
...
@@ -92,7 +92,6 @@ def build(recipe_dir, python, condarc, config, no_test, append_file,
# get potential channel upload and other auxiliary channels
channels
=
get_channels
(
public
=
(
not
private
),
stable
=
stable
,
server
=
server
,
intranet
=
private
)
channel
=
channels
[
0
]
# where we would upload this package
if
condarc
is
not
None
:
logger
.
info
(
'Loading CONDARC file from %s...'
,
condarc
)
...
...
@@ -133,12 +132,9 @@ def build(recipe_dir, python, condarc, config, no_test, append_file,
rendered_recipe
=
get_parsed_recipe
(
metadata
)
# if a channel URL was passed, set the build number
if
channel
:
build_number
,
_
=
next_build_number
(
channel
,
rendered_recipe
[
'package'
][
'name'
],
rendered_recipe
[
'package'
][
'version'
],
python
)
else
:
build_number
=
0
build_number
,
_
=
next_build_number
(
channels
[
0
],
rendered_recipe
[
'package'
][
'name'
],
rendered_recipe
[
'package'
][
'version'
],
python
)
set_environment
(
'BOB_BUILD_NUMBER'
,
str
(
build_number
),
os
.
environ
)
...
...
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