You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
senpy/.gitlab-ci.yml

80 lines
1.8 KiB
YAML

7 years ago
image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
DOCKERFILE: Dockerfile
7 years ago
stages:
- test
- images
7 years ago
- release
.test: &test_definition
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
7 years ago
cache:
paths:
- .eggs/
- "$CI_PROJECT_DIR/pip-cache"
- .venv
7 years ago
key: "$CI_PROJECT_NAME"
stage: test
7 years ago
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
7 years ago
- python setup.py test
7 years ago
7 years ago
test-3.5:
<<: *test_definition
7 years ago
image: "python:3.5"
7 years ago
test-3.4:
<<: *test_definition
7 years ago
image: "python:3.4"
7 years ago
test-2.7:
<<: *test_definition
7 years ago
image: "python:2.7"
7 years ago
7 years ago
.image: &image_definition
variables:
PYTHON_VERSION: "3.5"
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
7 years ago
script:
- 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
stage: images
7 years ago
only:
- tags
- triggers
7 years ago
image-3.5:
<<: *image_definition
variables:
PYTHON_VERSION: "3.5"
7 years ago
image-2.7:
<<: *image_definition
variables:
PYTHON_VERSION: "2.7"
image-latest:
stage: release
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
script:
- docker build -f Dockerfile . -t $CI_REGISTRY_IMAGE
- docker tag $CI_REGISTRY_IMAGE $CI_REGISTRY_IMAGE:$CI_BUILD_REF_SLUG
- docker push $CI_REGISTRY_IMAGE
- docker push $CI_REGISTRY_IMAGE:$CI_BUILD_REF_SLUG
only:
- master
- triggers