Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.devtools
Commits
dc920de6
Commit
dc920de6
authored
Feb 13, 2019
by
André Anjos
💬
Browse files
[scripts][ci] Add base-build subcommand for bob.conda
parent
40fbdd3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
bob/devtools/scripts/ci.py
View file @
dc920de6
...
...
@@ -300,6 +300,57 @@ def pypi(package, dry_run):
logger
.
info
(
'%s: Deployed to PyPI - OK'
,
k
)
@
ci
.
command
(
epilog
=
'''
Examples:
1. Builds a list of packages (base dependencies) defined in a text file
$ bdt ci base-build -vv order.txt
'''
)
@
click
.
argument
(
'order'
,
required
=
True
,
type
=
click
.
Path
(
file_okay
=
True
,
dir_okay
=
False
,
exists
=
True
),
nargs
=
1
)
@
click
.
option
(
'-d'
,
'--dry-run/--no-dry-run'
,
default
=
False
,
help
=
'Only goes through the actions, but does not execute them '
\
'(combine with the verbosity flags - e.g. ``-vvv``) to enable '
\
'printing to help you understand what will be done'
)
@
verbosity_option
()
@
bdt
.
raise_on_error
def
base_build
(
order
,
dry_run
):
"""Builds base (dependence) packages
This command builds dependence packages (packages that are not Bob/BEAT
packages) in the CI infrastructure. It is **not** meant to be used outside
this context.
"""
from
..constants
import
CONDA_BUILD_CONFIG
from
..build
import
base_build
as
_build
condarc
=
os
.
path
.
join
(
os
.
environ
[
'CONDA_ROOT'
],
'condarc'
)
logger
.
info
(
'Loading (this build
\'
s) CONDARC file from %s...'
,
condarc
)
with
open
(
condarc
,
'rb'
)
as
f
:
condarc_options
=
yaml
.
load
(
f
)
# dump packages at conda_root
condarc_options
[
'croot'
]
=
os
.
path
.
join
(
os
.
environ
[
'CONDA_ROOT'
],
'conda-bld'
)
# loads dirnames from order file (accepts # comments and empty lines)
recipes
=
[]
with
open
(
order
,
'rt'
)
as
f
:
for
line
in
f
:
line
=
line
.
partition
(
'#'
)[
0
].
strip
()
if
line
:
recipes
.
append
(
line
)
for
recipe
in
recipes
:
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
recipe
,
'meta.yaml'
)):
# ignore - not a conda package
continue
base_build
(
SERVER
,
True
,
recipe
,
CONDA_BUILD_CONFIG
,
os
.
environ
[
'PYTHON_VERSION'
],
args
.
python_version
,
condarc_options
)
@
ci
.
command
(
epilog
=
'''
Examples:
...
...
setup.py
View file @
dc920de6
...
...
@@ -59,6 +59,7 @@ setup(
],
'bdt.ci.cli'
:
[
'base-build = bob.devtools.scripts.ci:base_build'
,
'build = bob.devtools.scripts.ci:build'
,
'clean = bob.devtools.scripts.ci:clean'
,
'base-deploy = bob.devtools.scripts.ci:base_deploy'
,
...
...
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