1
0
mirror of https://github.com/gsi-upm/senpy synced 2024-11-24 09:02:28 +00:00
senpy/.gitlab-ci.yml

80 lines
1.8 KiB
YAML
Raw Normal View History

2017-02-13 11:04:29 +00:00
image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
2017-02-13 17:29:38 +00:00
DOCKERFILE: Dockerfile
2017-02-13 11:04:29 +00:00
before_script:
- sh version.sh > senpy/VERSION
2017-02-13 11:04:29 +00:00
stages:
- test
2017-02-13 18:41:18 +00:00
- images
2017-02-13 11:04:29 +00:00
- release
.test: &test_definition
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
2017-02-13 11:04:29 +00:00
cache:
paths:
2017-02-13 19:07:20 +00:00
- .eggs/
- "$CI_PROJECT_DIR/pip-cache"
- .venv
2017-02-13 11:04:29 +00:00
key: "$CI_PROJECT_NAME"
2017-02-13 18:41:18 +00:00
stage: test
2017-02-13 11:04:29 +00:00
script:
- pip install --use-wheel -U pip setuptools virtualenv
- virtualenv .venv/$PYTHON_VERSION
- source .venv/$PYTHON_VERSION/bin/activate
- pip install --use-wheel -r requirements.txt
- pip install --use-wheel -r test-requirements.txt
2017-02-17 10:24:57 +00:00
- py.test --cov=senpy --cov-report term-missing
- python
2017-02-17 10:24:57 +00:00
2017-02-13 11:04:29 +00:00
test-3.5:
<<: *test_definition
2017-02-13 11:30:44 +00:00
image: "python:3.5"
2017-02-13 11:04:29 +00:00
test-2.7:
<<: *test_definition
2017-02-13 11:30:44 +00:00
image: "python:2.7"
2017-02-13 11:04:29 +00:00
2017-02-13 18:41:18 +00:00
2017-02-13 11:04:29 +00:00
.image: &image_definition
2017-02-13 18:41:18 +00:00
variables:
PYTHON_VERSION: "3.5"
2017-02-13 18:43:52 +00:00
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
2017-02-13 11:04:29 +00:00
script:
2017-02-13 19:07:20 +00:00
- docker build -f Dockerfile-3.5 . -t $CI_REGISTRY_IMAGE:$CI_BUILD_REF_SLUG-$PYTHON_VERSION
- docker push $CI_REGISTRY_IMAGE:$CI_BUILD_REF_SLUG-$PYTHON_VERSION
2017-02-13 18:41:18 +00:00
stage: images
2017-02-13 11:04:29 +00:00
only:
2017-02-13 18:41:18 +00:00
- tags
- triggers
2017-02-13 11:04:29 +00:00
image-3.5:
<<: *image_definition
variables:
2017-02-13 18:41:18 +00:00
PYTHON_VERSION: "3.5"
2017-02-13 11:04:29 +00:00
image-2.7:
<<: *image_definition
variables:
2017-02-13 18:41:18 +00:00
PYTHON_VERSION: "2.7"
image-latest:
stage: release
2017-02-13 19:36:12 +00:00
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
2017-02-13 18:41:18 +00:00
script:
- docker build -f Dockerfile . -t $CI_REGISTRY_IMAGE
- docker tag $CI_REGISTRY_IMAGE $CI_REGISTRY_IMAGE:$CI_BUILD_REF_SLUG
2017-02-13 19:24:10 +00:00
- docker push $CI_REGISTRY_IMAGE
- docker push $CI_REGISTRY_IMAGE:$CI_BUILD_REF_SLUG
2017-02-13 18:41:18 +00:00
only:
- master
2017-02-13 19:36:12 +00:00
- triggers