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
1808f37b
Commit
1808f37b
authored
6 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[ci][bootstrap] Improve channel setup
parent
6a318f49
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#25997
passed
6 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ci/bootstrap.py
+30
-7
30 additions, 7 deletions
ci/bootstrap.py
with
30 additions
and
7 deletions
ci/bootstrap.py
+
30
−
7
View file @
1808f37b
...
...
@@ -228,12 +228,32 @@ def install_miniconda(prefix):
shutil
.
rmtree
(
cached
)
def
get_
local_
channels
():
'''
Returns the relevant conda channels to consider if building project
'''
def
get_channels
(
public
,
stable
):
'''
Returns the relevant conda channels to consider if building project
# add channels
public
=
os
.
environ
[
'
CI_PROJECT_VISIBILITY
'
]
==
'
public
'
stable
=
os
.
environ
.
get
(
'
CI_COMMIT_TAG
'
)
is
not
None
The subset of channels to be returned depends on the visibility and stability
of the package being built. Here are the rules:
* public and stable: only returns the public stable channel(s)
* public and not stable: returns both public stable and beta channels
* not public and stable: returns both public and private stable channels
* not public and not stable: returns all channels
Beta channels have priority over stable channels, if returned. Private
channels have priority over public channles, if turned.
Args:
public: Boolean indicating if we
'
re supposed to include only public
channels
stable: Boolean indicating if we
'
re supposed to include only stable
channels
Returns: a list of channels that need to be considered.
'''
server
=
"
http://www.idiap.ch
"
channels
=
[]
...
...
@@ -343,13 +363,16 @@ if __name__ == '__main__':
conda_bld_path
=
os
.
path
.
join
(
prefix
,
'
conda-bld
'
)
run_cmdline
([
conda_bin
,
'
index
'
,
conda_bld_path
])
# add the locally build directory before defaults, boot from there
add_channels_condarc
([
conda_bld_path
,
'
defaults
'
],
condarc
)
channels
=
get_channels
(
public
=
True
,
stable
=
True
)
add_channels_condarc
(
channels
+
[
conda_bld_path
,
'
defaults
'
],
condarc
)
run_cmdline
([
conda_bin
,
'
create
'
,
'
-n
'
,
sys
.
argv
[
2
],
'
bob.devtools
'
])
elif
sys
.
argv
[
1
]
in
(
'
beta
'
,
'
stable
'
):
# installs from channel
channels
=
get_local_channels
()
channels
=
get_channels
(
public
=
os
.
environ
[
'
CI_PROJECT_VISIBILITY
'
]
==
'
public
'
,
stable
=
os
.
environ
.
get
(
'
CI_COMMIT_TAG
'
)
is
not
None
)
add_channels_condarc
(
channels
+
[
'
defaults
'
],
condarc
)
run_cmdline
([
conda_bin
,
'
create
'
,
'
-n
'
,
sys
.
argv
[
2
],
'
bob.devtools
'
])
...
...
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