Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
lscsoft
gracedb
Commits
62cc6ad3
Verified
Commit
62cc6ad3
authored
May 01, 2019
by
Duncan Macleod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci: added apt caching
parent
ab878415
Pipeline
#62237
passed with stages
in 12 minutes and 9 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
.gitlab-ci.yml
.gitlab-ci.yml
+8
-3
No files found.
.gitlab-ci.yml
View file @
62cc6ad3
...
...
@@ -2,10 +2,11 @@
image
:
docker:latest
variables
:
APT_CACHE_DIR
:
"
${CI_PROJECT_DIR}/.cache/apt"
DOCKER_DRIVER
:
overlay
DOCKER_BRANCH
:
$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
DOCKER_LATEST
:
$CI_REGISTRY_IMAGE:latest
PIP_CACHE_DIR
:
"
$CI_PROJECT_DIR/.cache/pip"
PIP_CACHE_DIR
:
"
$
{
CI_PROJECT_DIR
}
/.cache/pip"
stages
:
-
test
...
...
@@ -40,13 +41,15 @@ before_script:
MYSQL_DB
:
"
${DJANGO_DB_NAME}"
MYSQL_ROOT_PASSWORD
:
"
${DJANGO_DB_PASSWORD}"
before_script
:
# create apt cache directory
-
mkdir -pv ${APT_CACHE_DIR}
# set python version
-
PYTHON_VERSION="${CI_JOB_NAME##*:}"
-
PYTHON_MAJOR="${PYTHON_VERSION:0:1}"
-
if [[ "${PYTHON_MAJOR}" -eq 2 ]]; then PYTHON="python"; else PYTHON="python3"; fi
# install build requirements
-
apt-get -yqq update
-
apt-get install -yqq
-
apt-get
-o dir::cache::archives="${APT_CACHE_DIR}"
install -yqq
git
libmariadbclient-dev
libldap2-dev
...
...
@@ -56,7 +59,7 @@ before_script:
swig
${PYTHON}-pip
# install voeventlib for python2
-
if [[ "${PYTHON_MAJOR}" -eq 2 ]]; then apt-get install -yqq python-voeventlib; fi
-
if [[ "${PYTHON_MAJOR}" -eq 2 ]]; then apt-get
-o dir::cache::archives="${APT_CACHE_DIR}"
install -yqq python-voeventlib; fi
# install everything else from pip
-
${PYTHON} -m pip install -r requirements.txt
-
${PYTHON} -m pip install pytest-django pytest-cov
...
...
@@ -75,8 +78,10 @@ before_script:
reports
:
junit
:
junit.xml
cache
:
key
:
"
${CI_JOB_NAME}"
paths
:
-
.cache/pip
-
.cache/apt
test:2.7:
<<
:
*test
...
...
Write
Preview
Markdown
is supported
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