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
11d83d6d
Commit
11d83d6d
authored
7 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
Even simpler
parent
ae95051b
No related branches found
No related tags found
1 merge request
!63
Conda package based CI
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
gitlab/before_build.sh
+16
-19
16 additions, 19 deletions
gitlab/before_build.sh
gitlab/build.sh
+4
-7
4 additions, 7 deletions
gitlab/build.sh
gitlab/functions.sh
+5
-9
5 additions, 9 deletions
gitlab/functions.sh
with
25 additions
and
35 deletions
gitlab/before_build.sh
+
16
−
19
View file @
11d83d6d
...
@@ -4,16 +4,13 @@
...
@@ -4,16 +4,13 @@
source
$(
dirname
${
0
}
)
/functions.sh
source
$(
dirname
${
0
}
)
/functions.sh
# checks if a conda installation exists. Otherwise, install one
# checks if a conda installation exists. Otherwise, install one
if
[
!
-e
${
CONDA_
FOLDER
}
/bin/conda
]
;
then
if
[
!
-e
${
CONDA_
ROOT
}
/bin/conda
]
;
then
install_miniconda
${
CONDA_
FOLDER
}
install_miniconda
${
CONDA_
ROOT
}
fi
fi
# moves the cache to conda folder
mkdir
-p
${
CONDA_ROOT
}
/pkgs
mkdir
-p
${
CONDA_FOLDER
}
/pkgs
touch
${
CONDA_ROOT
}
/pkgs/urls
touch
${
CONDA_FOLDER
}
/pkgs/urls
touch
${
CONDA_ROOT
}
/pkgs/urls.txt
touch
${
CONDA_FOLDER
}
/pkgs/urls.txt
merge_conda_cache
${
CONDA_FOLDER
}
/pkgs
${
CONDA_ENVS_PATH
}
/.pkgs
cat
<<
EOF
>
${
CONDARC
}
cat
<<
EOF
>
${
CONDARC
}
default_channels:
default_channels:
...
@@ -25,22 +22,22 @@ EOF
...
@@ -25,22 +22,22 @@ EOF
echo
"Contents of
\`
${
CONDARC
}
':"
echo
"Contents of
\`
${
CONDARC
}
':"
cat
${
CONDARC
}
cat
${
CONDARC
}
run_cmd
${
CONDA_
FOLDER
}
/bin/conda config
--set
add_pip_as_python_dependency
false
run_cmd
${
CONDA_
ROOT
}
/bin/conda config
--set
add_pip_as_python_dependency
false
run_cmd
${
CONDA_
FOLDER
}
/bin/conda config
--set
always_yes
yes
--set
changeps1 no
run_cmd
${
CONDA_
ROOT
}
/bin/conda config
--set
always_yes
yes
--set
changeps1 no
run_cmd
${
CONDA_
FOLDER
}
/bin/conda config
--set
always_yes
true
run_cmd
${
CONDA_
ROOT
}
/bin/conda config
--set
always_yes
true
run_cmd
${
CONDA_
FOLDER
}
/bin/conda config
--set
show_channel_urls
true
run_cmd
${
CONDA_
ROOT
}
/bin/conda config
--set
show_channel_urls
true
run_cmd
${
CONDA_
FOLDER
}
/bin/conda config
--set
anaconda_upload no
run_cmd
${
CONDA_
ROOT
}
/bin/conda config
--set
anaconda_upload no
run_cmd
${
CONDA_
FOLDER
}
/bin/conda config
--add
channels
${
CONDA_CHANNEL
}
run_cmd
${
CONDA_
ROOT
}
/bin/conda config
--add
channels
${
CONDA_CHANNEL
}
if
[
-z
"
${
CI_COMMIT_TAG
}
"
]
;
then
if
[
-z
"
${
CI_COMMIT_TAG
}
"
]
;
then
run_cmd
${
CONDA_
FOLDER
}
/bin/conda config
--add
channels
${
CONDA_BETA_CHANNEL
}
run_cmd
${
CONDA_
ROOT
}
/bin/conda config
--add
channels
${
CONDA_BETA_CHANNEL
}
fi
fi
run_cmd
${
CONDA_
FOLDER
}
/bin/conda config
--set
ssl_verify
false
run_cmd
${
CONDA_
ROOT
}
/bin/conda config
--set
ssl_verify
false
# updates conda installation
# updates conda installation
run_cmd
${
CONDA_
FOLDER
}
/bin/conda
install
--quiet
--yes
python
conda
=
4.4 curl conda-build
=
3
run_cmd
${
CONDA_
ROOT
}
/bin/conda
install
--quiet
--yes
python
conda
=
4.4 curl conda-build
=
3
# cleans up
# cleans up
run_cmd
${
CONDA_
FOLDER
}
/bin/conda clean
--lock
run_cmd
${
CONDA_
ROOT
}
/bin/conda clean
--lock
# print conda information for debugging purposes
# print conda information for debugging purposes
run_cmd
${
CONDA_
FOLDER
}
/bin/conda info
run_cmd
${
CONDA_
ROOT
}
/bin/conda info
This diff is collapsed.
Click to expand it.
gitlab/build.sh
+
4
−
7
View file @
11d83d6d
...
@@ -4,22 +4,19 @@
...
@@ -4,22 +4,19 @@
source
$(
dirname
${
0
}
)
/functions.sh
source
$(
dirname
${
0
}
)
/functions.sh
# Makes sure we activate the base environment if available
# Makes sure we activate the base environment if available
run_cmd
source
${
CONDA_
FOLDER
}
/etc/profile.d/conda.sh
run_cmd
source
${
CONDA_
ROOT
}
/etc/profile.d/conda.sh
run_cmd conda activate base
run_cmd conda activate base
run_cmd
mkdir
-p
./_ci/
${
OS_SLUG
}
/
${
PYTHON_VERSION
}
run_cmd
mkdir
-p
./_ci/
${
OS_SLUG
}
/
${
PYTHON_VERSION
}
if
[
-z
"
${
CI_COMMIT_TAG
}
"
]
;
then
if
[
-z
"
${
CI_COMMIT_TAG
}
"
]
;
then
run_cmd
${
CONDA_
FOLDER
}
/bin/python _ci/channel_support.py
${
CONDA_BETA_CHANNEL
}
${
CI_PROJECT_NAME
}
${
BOB_PACKAGE_VERSION
}
${
PYTHON_VERSION
}
-u
--log
./_ci/
${
OS_SLUG
}
/
${
PYTHON_VERSION
}
/build_number.txt
run_cmd
${
CONDA_
ROOT
}
/bin/python _ci/channel_support.py
${
CONDA_BETA_CHANNEL
}
${
CI_PROJECT_NAME
}
${
BOB_PACKAGE_VERSION
}
${
PYTHON_VERSION
}
-u
--log
./_ci/
${
OS_SLUG
}
/
${
PYTHON_VERSION
}
/build_number.txt
else
else
run_cmd
${
CONDA_
FOLDER
}
/bin/python _ci/channel_support.py
${
CONDA_CHANNEL
}
${
CI_PROJECT_NAME
}
${
BOB_PACKAGE_VERSION
}
${
PYTHON_VERSION
}
-u
--log
./_ci/
${
OS_SLUG
}
/
${
PYTHON_VERSION
}
/build_number.txt
run_cmd
${
CONDA_
ROOT
}
/bin/python _ci/channel_support.py
${
CONDA_CHANNEL
}
${
CI_PROJECT_NAME
}
${
BOB_PACKAGE_VERSION
}
${
PYTHON_VERSION
}
-u
--log
./_ci/
${
OS_SLUG
}
/
${
PYTHON_VERSION
}
/build_number.txt
fi
fi
BOB_BUILD_NUMBER
=
`
head
-n
1 ./_ci/
${
OS_SLUG
}
/
${
PYTHON_VERSION
}
/build_number.txt |
tr
-d
'\n'
`
BOB_BUILD_NUMBER
=
`
head
-n
1 ./_ci/
${
OS_SLUG
}
/
${
PYTHON_VERSION
}
/build_number.txt |
tr
-d
'\n'
`
export_env BOB_BUILD_NUMBER
export_env BOB_BUILD_NUMBER
run_cmd
${
CONDA_FOLDER
}
/bin/conda build
--variant-config-files
_ci/conda_build_config.yaml
--quiet
--python
=
${
PYTHON_VERSION
}
conda
run_cmd
${
CONDA_ROOT
}
/bin/conda build
--variant-config-files
_ci/conda_build_config.yaml
--quiet
--python
=
${
PYTHON_VERSION
}
conda
# Move the cache to conda env folder to cache it
merge_conda_cache
${
CONDA_ENVS_PATH
}
/.pkgs
${
CONDA_FOLDER
}
/pkgs
This diff is collapsed.
Click to expand it.
gitlab/functions.sh
+
5
−
9
View file @
11d83d6d
...
@@ -346,10 +346,6 @@ check_env OSNAME
...
@@ -346,10 +346,6 @@ check_env OSNAME
check_env VISIBILITY
check_env VISIBILITY
check_env IS_MASTER
check_env IS_MASTER
if
[
-z
"
${
CONDA_FOLDER
}
"
]
;
then
CONDA_FOLDER
=
/opt/miniconda
fi
PYVER
=
py
$(
echo
${
PYTHON_VERSION
}
|
tr
-d
'.'
)
PYVER
=
py
$(
echo
${
PYTHON_VERSION
}
|
tr
-d
'.'
)
if
[
-z
"
${
DOCSERVER
}
"
]
;
then
if
[
-z
"
${
DOCSERVER
}
"
]
;
then
...
@@ -360,6 +356,9 @@ fi
...
@@ -360,6 +356,9 @@ fi
CONDA_CHANNEL
=
"
${
DOCSERVER
}
/public/conda/label/main"
CONDA_CHANNEL
=
"
${
DOCSERVER
}
/public/conda/label/main"
CONDA_BETA_CHANNEL
=
"
${
DOCSERVER
}
/private/conda"
CONDA_BETA_CHANNEL
=
"
${
DOCSERVER
}
/private/conda"
# Sets up the location of our rc file for conda
CONDARC
=
${
CONDA_ROOT
}
/condarc
if
[
-z
"
${
OS_SLUG
}
"
]
;
then
if
[
-z
"
${
OS_SLUG
}
"
]
;
then
OS_SLUG
=
"
${
OSNAME
}
-64"
OS_SLUG
=
"
${
OSNAME
}
-64"
fi
fi
...
@@ -372,9 +371,10 @@ check_env PREFIX
...
@@ -372,9 +371,10 @@ check_env PREFIX
export_env PREFIX
export_env PREFIX
check_env DOCSERVER
check_env DOCSERVER
check_env TESTSERVER
check_env TESTSERVER
check_env CONDA_
FOLDER
check_env CONDA_
ROOT
check_env CONDA_CHANNEL
check_env CONDA_CHANNEL
check_env CONDA_BETA_CHANNEL
check_env CONDA_BETA_CHANNEL
export_env CONDARC
# Setup default documentation server
# Setup default documentation server
if
[
-z
"
${
CI_COMMIT_TAG
}
"
]
;
then
if
[
-z
"
${
CI_COMMIT_TAG
}
"
]
;
then
...
@@ -439,7 +439,3 @@ LANG="en_US.UTF-8"
...
@@ -439,7 +439,3 @@ LANG="en_US.UTF-8"
LC_ALL
=
"
${
LANG
}
"
LC_ALL
=
"
${
LANG
}
"
export_env LANG
export_env LANG
export_env LC_ALL
export_env LC_ALL
# Sets up the location of our rc file for conda
CONDARC
=
${
CONDA_FOLDER
}
/condarc
export_env CONDARC
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