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
f22845d6
Commit
f22845d6
authored
Jan 10, 2019
by
André Anjos
💬
Browse files
[ci] Prevent artifact forget
parent
93edfdca
Pipeline
#25806
failed with stages
in 40 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ci/bootstrap.sh
View file @
f22845d6
...
...
@@ -36,6 +36,18 @@ run_cmd() {
fi
}
# Checks just if the variable is defined and has non-zero length
check_defined
()
{
if
[
-z
"
${
!1+abc
}
"
]
;
then
log_error
"Variable
${
1
}
is undefined - aborting..."
;
exit
1
elif
[
-z
"
${
!1
}
"
]
;
then
log_error
"Variable
${
1
}
is zero-length - aborting..."
;
exit
1
fi
log_info
"
${
1
}
=
${
!1
}
"
}
# merges conda cache folders
# $1: Path to the main cache to keep. The directory must exist.
# $2: Path to the extra cache to be merged into main cache
...
...
@@ -45,24 +57,15 @@ merge_conda_cache() {
_urlstxt
=
"
${
1
}
/urls.txt"
if
[
-e
${
2
}
]
;
then
log_info
"Merging urls.txt and packages with cached files..."
mv
${
2
}
/
*
.tar.bz2
${
1
}
/
run_cmd
mv
${
2
}
/
pkgs/
*
.tar.bz2
${
1
}
/
pkgs
cat
${
_urlstxt
}
${
_cached_urlstxt
}
|
sort
|
uniq
>
${
_urlstxt
}
log_info
"Moving conda-bld packages (artifacts)..."
run_cmd
mv
${
2
}
/conda-bld
${
1
}
run_cmd conda index
${
1
}
/conda-bld
fi
fi
}
# Checks just if the variable is defined and has non-zero length
check_defined
()
{
if
[
-z
"
${
!1+abc
}
"
]
;
then
log_error
"Variable
${
1
}
is undefined - aborting..."
;
exit
1
elif
[
-z
"
${
!1
}
"
]
;
then
log_error
"Variable
${
1
}
is zero-length - aborting..."
;
exit
1
fi
log_info
"
${
1
}
=
${
!1
}
"
}
# installs a miniconda installation.
# $1: Path to where to install miniconda.
install_miniconda
()
{
...
...
@@ -93,7 +96,7 @@ install_miniconda() {
run_cmd bash miniconda.sh
-b
-p
${
1
}
# Put back cache and merge urls.txt
merge_conda_cache
${
1
}
/pkgs
${
1
}
.cached
/pkgs
merge_conda_cache
${
1
}
${
1
}
.cached
# remove the backup cache folder
rm
-rf
${
1
}
.cached
...
...
@@ -133,9 +136,7 @@ CONDA_CLI_CHANNELS="-c ${CONDA_CHANNEL_ROOT} -c defaults"
if
[
"
${
1
}
"
==
"build"
]
;
then
run_cmd
${
CONDA_ROOT
}
/bin/conda
install
-n
base python
conda
=
4 conda-build
=
3
elif
[
"
${
1
}
"
==
"local"
]
;
then
run_cmd
${
CONDA_ROOT
}
/bin/conda index
${
CONDA_ROOT
}
/conda-bld
CONDA_CLI_CHANNELS
=
"-c
${
CONDA_ROOT
}
/conda-bld
${
CONDA_CLI_CHANNELS
}
"
run_cmd
ls
-l
${
CONDA_ROOT
}
/conda-bld/
run_cmd
${
CONDA_ROOT
}
/bin/conda create
-n
"
${
2
}
"
--override-channels
${
CONDA_CLI_CHANNELS
}
bob.devtools
elif
[
"
${
1
}
"
==
"beta"
]
||
[
"
${
1
}
"
==
"stable"
]
;
then
run_cmd
${
CONDA_ROOT
}
/bin/conda create
-n
"
${
2
}
"
--override-channels
${
CONDA_CLI_CHANNELS
}
bob.devtools
...
...
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