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
OmegaCEN
ci-templates
Commits
fae96dc6
Commit
fae96dc6
authored
Aug 25, 2020
by
Teake Nutma
Browse files
Dynamically set CONDA_OFFLINE based on pkgs dir existance
parent
e560b050
Changes
1
Hide whitespace changes
Inline
Side-by-side
conda-build.yml
View file @
fae96dc6
...
...
@@ -69,8 +69,22 @@ variables:
-
conda-recipe/meta.yaml
prefix
:
${CI_PROJECT_PATH_SLUG}_conda_pkgs
script
:
-
conda info
-
ls -l .conda-pkgs ||
true
# Determine if we should go online or not by looking at whether or not there is a cache.
# If there's a fresh cache, the pkgs dirs will not be created at this point.
# Since there's only a fresh cache if the recipe has changed (see cache:key:files above),
# we allow conda to pull in new packages online in that case.
-
|
if [ -z ${CONDA_OFFLINE+x} ]; then
if [ -d .conda-pkgs ]; then
echo "DEBUG: Found GitLab cache. Telling conda to use offline packages from cache."
export CONDA_OFFLINE="True"
else
echo "DEBUG: Did not found GitLab cache. Telling conda to use online repositories."
# Online is default, so don't do anything.
fi
else
echo "DEBUG: CONDA_OFFLINE is pre-set to ${CONDA_OFFLINE}"
fi
# Disable environment verification when we're in a MR.
# Environment verficiation is normally done just after the test env is created, and can be quite expensive.
# Because we're in containers and because the same job will be run on the default branch _with_ env verification,
...
...
@@ -110,7 +124,6 @@ variables:
if [ -f "coverage.xml" ]; then
coverage-fixpaths --loglevel debug --source . coverage.xml
fi
-
ls -l .conda-pkgs ||
true
dependencies
:
-
conda_build
artifacts
:
...
...
@@ -141,20 +154,5 @@ conda_build:
paths
:
-
${CONDA_OUTPUT_FOLDER}/**/*.{tar.bz2,conda}
# Run conda test online if there are changes to the recipe.
# This will allow conda to pull in new dependencies and add them to the cache.
conda_test_online
:
conda_test
:
extends
:
.abstract_conda_test
rules
:
-
changes
:
-
conda-recipe/meta.yaml
# Run conda test offline if there are no changes to the recipe.
# All dependencies will be pulled from the cache.
conda_test_offline
:
extends
:
.abstract_conda_test
variables
:
CONDA_OFFLINE
:
"
True"
except
:
changes
:
-
conda-recipe/meta.yaml
Write
Preview
Supports
Markdown
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