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
759e9305
Commit
759e9305
authored
5 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[ci] Allow builds to define their custom condarc to be used
parent
2db104b3
No related branches found
No related tags found
1 merge request
!82
Allow builds to define their custom condarc to be used
Pipeline
#32332
passed
5 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
bob/devtools/ci.py
+10
-0
10 additions, 0 deletions
bob/devtools/ci.py
bob/devtools/scripts/ci.py
+24
-5
24 additions, 5 deletions
bob/devtools/scripts/ci.py
with
35 additions
and
5 deletions
.gitignore
+
1
−
0
View file @
759e9305
...
@@ -18,3 +18,4 @@ build
...
@@ -18,3 +18,4 @@ build
record.txt
record.txt
miniconda.sh
miniconda.sh
miniconda/
miniconda/
.DS_Store
This diff is collapsed.
Click to expand it.
bob/devtools/ci.py
+
10
−
0
View file @
759e9305
...
@@ -195,3 +195,13 @@ def select_conda_recipe_append(paths, branch):
...
@@ -195,3 +195,13 @@ def select_conda_recipe_append(paths, branch):
from
.constants
import
CONDA_RECIPE_APPEND
as
default
from
.constants
import
CONDA_RECIPE_APPEND
as
default
return
select_build_file
(
default
,
paths
,
branch
)
or
default
return
select_build_file
(
default
,
paths
,
branch
)
or
default
def
select_user_condarc
(
paths
,
branch
):
'''
Selects the user condarc file to read (if any)
See :py:func:`select_build_file` for implementation details. If no recipe
condarc is found by :py:func:`select_build_file`, then returns ``None``.
'''
return
select_build_file
(
'
condarc
'
,
paths
,
branch
)
This diff is collapsed.
Click to expand it.
bob/devtools/scripts/ci.py
+
24
−
5
View file @
759e9305
...
@@ -14,7 +14,7 @@ from . import bdt
...
@@ -14,7 +14,7 @@ from . import bdt
from
..constants
import
SERVER
,
WEBDAV_PATHS
,
BASE_CONDARC
from
..constants
import
SERVER
,
WEBDAV_PATHS
,
BASE_CONDARC
from
..deploy
import
deploy_conda_package
,
deploy_documentation
from
..deploy
import
deploy_conda_package
,
deploy_documentation
from
..ci
import
read_packages
,
comment_cleanup
,
uniq
,
\
from
..ci
import
read_packages
,
comment_cleanup
,
uniq
,
\
select_conda_build_config
,
select_conda_recipe_append
select_conda_build_config
,
select_conda_recipe_append
,
select_user_condarc
from
..log
import
verbosity_option
,
get_logger
,
echo_normal
from
..log
import
verbosity_option
,
get_logger
,
echo_normal
logger
=
get_logger
(
__name__
)
logger
=
get_logger
(
__name__
)
...
@@ -278,7 +278,11 @@ def base_build(order, group, python, dry_run):
...
@@ -278,7 +278,11 @@ def base_build(order, group, python, dry_run):
this context.
this context.
"""
"""
condarc
=
os
.
path
.
join
(
os
.
environ
[
'
CONDA_ROOT
'
],
'
condarc
'
)
condarc
=
select_user_condarc
(
paths
=
[
recipe
,
os
.
curdir
],
branch
=
os
.
environ
.
get
(
'
CI_COMMIT_REF_NAME
'
))
condarc
=
condarc
or
os
.
path
.
join
(
os
.
environ
[
'
CONDA_ROOT
'
],
'
condarc
'
)
if
os
.
path
.
exists
(
condarc
):
if
os
.
path
.
exists
(
condarc
):
logger
.
info
(
'
Loading (this build
\'
s) CONDARC file from %s...
'
,
condarc
)
logger
.
info
(
'
Loading (this build
\'
s) CONDARC file from %s...
'
,
condarc
)
with
open
(
condarc
,
'
rb
'
)
as
f
:
with
open
(
condarc
,
'
rb
'
)
as
f
:
...
@@ -375,6 +379,11 @@ def test(ctx, dry_run):
...
@@ -375,6 +379,11 @@ def test(ctx, dry_run):
# Use custom variants and append files if available on recipe-dir
# Use custom variants and append files if available on recipe-dir
recipe_dir
=
os
.
path
.
join
(
os
.
path
.
realpath
(
os
.
curdir
),
'
conda
'
)
recipe_dir
=
os
.
path
.
join
(
os
.
path
.
realpath
(
os
.
curdir
),
'
conda
'
)
condarc
=
select_user_condarc
(
paths
=
[
recipe
,
os
.
curdir
],
branch
=
os
.
environ
.
get
(
'
CI_COMMIT_REF_NAME
'
))
if
condarc
is
not
None
:
logger
.
info
(
'
Condarc configuration file: %s
'
,
condarc
)
variants_file
=
select_conda_build_config
(
paths
=
[
recipe_dir
,
os
.
curdir
],
variants_file
=
select_conda_build_config
(
paths
=
[
recipe_dir
,
os
.
curdir
],
branch
=
os
.
environ
.
get
(
'
CI_COMMIT_REF_NAME
'
))
branch
=
os
.
environ
.
get
(
'
CI_COMMIT_REF_NAME
'
))
logger
.
info
(
'
Conda build configuration file: %s
'
,
variants_file
)
logger
.
info
(
'
Conda build configuration file: %s
'
,
variants_file
)
...
@@ -387,7 +396,7 @@ def test(ctx, dry_run):
...
@@ -387,7 +396,7 @@ def test(ctx, dry_run):
ctx
.
invoke
(
test
,
ctx
.
invoke
(
test
,
package
=
glob
.
glob
(
os
.
path
.
join
(
os
.
environ
[
'
CONDA_ROOT
'
],
'
conda-bld
'
,
package
=
glob
.
glob
(
os
.
path
.
join
(
os
.
environ
[
'
CONDA_ROOT
'
],
'
conda-bld
'
,
'
*
'
,
os
.
environ
[
'
CI_PROJECT_NAME
'
]
+
'
*.tar.bz2
'
)),
'
*
'
,
os
.
environ
[
'
CI_PROJECT_NAME
'
]
+
'
*.tar.bz2
'
)),
condarc
=
None
,
#custom build configuration
condarc
=
condarc
,
config
=
variants_file
,
config
=
variants_file
,
append_file
=
append_file
,
append_file
=
append_file
,
server
=
SERVER
,
server
=
SERVER
,
...
@@ -429,6 +438,11 @@ def build(ctx, dry_run):
...
@@ -429,6 +438,11 @@ def build(ctx, dry_run):
# Use custom variants and append files if available on recipe-dir
# Use custom variants and append files if available on recipe-dir
recipe_dir
=
os
.
path
.
join
(
os
.
path
.
realpath
(
os
.
curdir
),
'
conda
'
)
recipe_dir
=
os
.
path
.
join
(
os
.
path
.
realpath
(
os
.
curdir
),
'
conda
'
)
condarc
=
select_user_condarc
(
paths
=
[
recipe
,
os
.
curdir
],
branch
=
os
.
environ
.
get
(
'
CI_COMMIT_REF_NAME
'
))
if
condarc
is
not
None
:
logger
.
info
(
'
Condarc configuration file: %s
'
,
condarc
)
variants_file
=
select_conda_build_config
(
paths
=
[
recipe_dir
,
os
.
curdir
],
variants_file
=
select_conda_build_config
(
paths
=
[
recipe_dir
,
os
.
curdir
],
branch
=
os
.
environ
.
get
(
'
CI_COMMIT_REF_NAME
'
))
branch
=
os
.
environ
.
get
(
'
CI_COMMIT_REF_NAME
'
))
logger
.
info
(
'
Conda build configuration file: %s
'
,
variants_file
)
logger
.
info
(
'
Conda build configuration file: %s
'
,
variants_file
)
...
@@ -441,7 +455,7 @@ def build(ctx, dry_run):
...
@@ -441,7 +455,7 @@ def build(ctx, dry_run):
ctx
.
invoke
(
build
,
ctx
.
invoke
(
build
,
recipe_dir
=
[
recipe_dir
],
recipe_dir
=
[
recipe_dir
],
python
=
os
.
environ
[
'
PYTHON_VERSION
'
],
#python version
python
=
os
.
environ
[
'
PYTHON_VERSION
'
],
#python version
condarc
=
None
,
#custom build configuration
condarc
=
condarc
,
config
=
variants_file
,
config
=
variants_file
,
no_test
=
False
,
no_test
=
False
,
append_file
=
append_file
,
append_file
=
append_file
,
...
@@ -552,6 +566,11 @@ def nightlies(ctx, order, dry_run):
...
@@ -552,6 +566,11 @@ def nightlies(ctx, order, dry_run):
# Use custom variants and append files if available on recipe-dir
# Use custom variants and append files if available on recipe-dir
recipe_dir
=
os
.
path
.
join
(
clone_to
,
'
conda
'
)
recipe_dir
=
os
.
path
.
join
(
clone_to
,
'
conda
'
)
condarc
=
select_user_condarc
(
paths
=
[
recipe
,
os
.
curdir
],
branch
=
os
.
environ
.
get
(
'
CI_COMMIT_REF_NAME
'
))
if
condarc
is
not
None
:
logger
.
info
(
'
Condarc configuration file: %s
'
,
condarc
)
variants_file
=
select_conda_build_config
(
paths
=
[
recipe_dir
,
os
.
curdir
],
variants_file
=
select_conda_build_config
(
paths
=
[
recipe_dir
,
os
.
curdir
],
branch
=
os
.
environ
.
get
(
'
CI_COMMIT_REF_NAME
'
))
branch
=
os
.
environ
.
get
(
'
CI_COMMIT_REF_NAME
'
))
logger
.
info
(
'
Conda build configuration file: %s
'
,
variants_file
)
logger
.
info
(
'
Conda build configuration file: %s
'
,
variants_file
)
...
@@ -563,7 +582,7 @@ def nightlies(ctx, order, dry_run):
...
@@ -563,7 +582,7 @@ def nightlies(ctx, order, dry_run):
ctx
.
invoke
(
build
,
ctx
.
invoke
(
build
,
recipe_dir
=
[
recipe_dir
],
recipe_dir
=
[
recipe_dir
],
python
=
os
.
environ
[
'
PYTHON_VERSION
'
],
#python version
python
=
os
.
environ
[
'
PYTHON_VERSION
'
],
#python version
condarc
=
None
,
#custom build configuration
condarc
=
condarc
,
config
=
variants_file
,
config
=
variants_file
,
no_test
=
False
,
no_test
=
False
,
append_file
=
append_file
,
append_file
=
append_file
,
...
...
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