Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.admin
Commits
a1c3eed1
Commit
a1c3eed1
authored
8 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
Try to make bootstrap.sh more colorful
parent
5dfe58ed
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ci/bootstrap.sh
+28
-15
28 additions, 15 deletions
ci/bootstrap.sh
with
28 additions
and
15 deletions
ci/bootstrap.sh
+
28
−
15
View file @
a1c3eed1
...
...
@@ -25,24 +25,37 @@ else
ARCH
=
"linux"
fi
# Functions for coloring echo commands
red_echo
()
{
echo
-e
"
\0
33[1;31m
${
@
}
\0
33[0m"
}
green_echo
()
{
echo
-e
"
\0
33[1;32m
${
@
}
\0
33[0m"
}
yellow_echo
()
{
echo
-e
"
\0
33[1;33m
${
@
}
\0
33[0m"
}
# Function for running command and echoing results
run_cmd
()
{
echo
"[(
`
date
+%c
`
)>>] Running
\"
${
@
}
\"
..."
green_
echo
"[(
`
date
+%c
`
)>>] Running
\"
${
@
}
\"
..."
${
@
}
if
[
"
$?
"
!=
"0"
]
;
then
echo
"[(
`
date
+%c
`
)!!] Command Failed
\"
${
@
}
\"
"
red_
echo
"[(
`
date
+%c
`
)!!] Command Failed
\"
${
@
}
\"
"
exit
1
else
echo
"[(
`
date
+%c
`
)<<] Finished comand
\"
${
@
}
\"
"
green_
echo
"[(
`
date
+%c
`
)<<] Finished comand
\"
${
@
}
\"
"
fi
}
# Clones the conda dev environment to use
if
[
!
-d
${
PREFIX
}
]
;
then
echo
"[++] Downloading environment list into file
\`
env.txt'..."
yellow_
echo
"[++] Downloading environment list into file
\`
env.txt'..."
pyver
=
$(
echo
${
PYTHON_VERSION
}
|
tr
-d
'.'
)
curl
--silent
https://gitlab.idiap.ch/bob/bob.admin/raw/master/install/
${
ARCH
}
/devel-py
${
pyver
}
.txt
>
env.txt
echo
"[++] Bootstrapping conda installation at
${
PREFIX
}
..."
yellow_
echo
"[++] Bootstrapping conda installation at
${
PREFIX
}
..."
run_cmd
${
CONDA_FOLDER
}
/bin/conda create
--prefix
${
PREFIX
}
--file
env.txt
--yes
# Dirty fix to libjpeg.8 compilation issues:
...
...
@@ -52,49 +65,49 @@ if [ ! -d ${PREFIX} ]; then
fi
run_cmd
${
CONDA_FOLDER
}
/bin/conda clean
--lock
else
echo
"[!!] Prefix directory
${
PREFIX
}
exists, not re-installing..."
yellow_
echo
"[!!] Prefix directory
${
PREFIX
}
exists, not re-installing..."
fi
# Source the newly created conda environment
echo
"[>>] Running
\"
source
${
CONDA_FOLDER
}
/bin/activate
${
PREFIX
}
\"
..."
green_
echo
"[>>] Running
\"
source
${
CONDA_FOLDER
}
/bin/activate
${
PREFIX
}
\"
..."
source
${
CONDA_FOLDER
}
/bin/activate
${
PREFIX
}
echo
"[<<] Environment
${
PREFIX
}
activated"
green_
echo
"[<<] Environment
${
PREFIX
}
activated"
# Verify where pip is installed
use_pip
=
`
which pip
`
if
[
-z
"
${
use_pip
}
"
]
;
then
echo
"[!!] Cannot find pip, aborting..."
red_
echo
"[!!] Cannot find pip, aborting..."
exit
1
else
echo
"[++] Using pip:
${
use_pip
}
"
yellow_
echo
"[++] Using pip:
${
use_pip
}
"
fi
use_python
=
`
which python
`
if
[
-z
"
${
use_python
}
"
]
;
then
echo
"[!!] Cannot find python, aborting..."
red_
echo
"[!!] Cannot find python, aborting..."
exit
1
else
echo
"[++] Using python:
${
use_python
}
"
yellow_
echo
"[++] Using python:
${
use_python
}
"
fi
# Install this package's build dependencies
if
[
-e
requirements.txt
]
;
then
run_cmd
${
use_pip
}
install
--find-links
${
WHEELS_REPOSITORY
}
--use-wheel
--no-index
--trusted-host
${
WHEELS_SERVER
}
--pre
--requirement
requirements.txt
else
echo
"[!!] No requirements.txt file found, skipping 'pip install <build-deps>'..."
yellow_
echo
"[!!] No requirements.txt file found, skipping 'pip install <build-deps>'..."
fi
# Install this package's test dependencies
if
[
-e
test-requirements.txt
]
;
then
run_cmd
${
use_pip
}
install
--find-links
${
WHEELS_REPOSITORY
}
--use-wheel
--no-index
--trusted-host
${
WHEELS_SERVER
}
--pre
--requirement
test-requirements.txt
else
echo
"[!!] No test-requirements.txt file found, skipping 'pip install <test-deps>'..."
yellow_
echo
"[!!] No test-requirements.txt file found, skipping 'pip install <test-deps>'..."
fi
# Finally, bootstrap the installation from the new environment
if
[
-e
bootstrap-buildout.py
]
;
then
run_cmd
${
use_python
}
bootstrap-buildout.py
else
echo
"[!!] No bootstrap-buildout.py file found, s
ki
pping
'buildout bootstrap'
..."
red_
echo
"[!!] No bootstrap-buildout.py file found, s
to
pping..."
exit
1
fi
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