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

69 lines
1.3 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
7 years ago
IMAGE_NAME: $CI_REGISTRY_IMAGE:$CI_BUILD_TAG
DOCKERFILE: Dockerfile
7 years ago
stages:
- test
- release
- deploy
.test: &test_definition
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
cache:
paths:
- .venv/
- pip-cache/
key: "$CI_PROJECT_NAME"
stage: deploy
7 years ago
script:
- pip install virtualenv
- virtualenv -q .venv
- source .venv/bin/activate
- python setup.py test
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
.image: &image_definition
stage: release
before_script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
script:
- docker build -f $DOCKERFILE . -t $IMAGE_NAME
- docker push $IMAGE_NAME
# only:
# - tags
# - triggers
7 years ago
7 years ago
image-master:
7 years ago
<<: *image_definition
only:
- master
image-3.5:
<<: *image_definition
variables:
7 years ago
IMAGE_NAME: "$REGISTRY_IMAGE:$CI_BUILD_TAG-python3.5"
7 years ago
DOCKERFILE: Dockerfile-3.5
image-2.7:
<<: *image_definition
variables:
7 years ago
IMAGE_NAME: "$REGISTRY_IMAGE:$CI_BUILD_TAG-python2.7"
DOCKERFILE: Dockerfile-2.7