This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/.gitlab-ci.yml

146 lines
3 KiB
YAML
Raw Normal View History

2017-05-02 14:08:24 +00:00
---
stages:
2017-05-30 21:06:09 +00:00
- docker-build
2017-05-02 14:08:24 +00:00
- unit-tests
- integration
- release
- deploy
variables:
FAILFASTCI_NAMESPACE: 'quay'
IMAGE: quay.io/quay/quay
2017-05-30 21:06:09 +00:00
PIP_CACHE_DIR: pip-cache
2017-05-02 14:08:24 +00:00
PIP: /venv/bin/pip
PYTEST: /venv/bin/py.test
TEST: "true"
PYTHONPATH: "."
2017-05-30 21:06:09 +00:00
# STAGE 1: container build
2017-05-02 14:08:24 +00:00
2017-05-30 21:06:09 +00:00
.docker: &docker
variables:
DOCKER_DRIVER: aufs
image: docker:git
2017-05-02 14:08:24 +00:00
before_script:
2017-05-30 21:06:09 +00:00
- docker login -u $DOCKER_USER -p $DOCKER_PASS quay.io
services:
- docker:dind
tags:
- docker
container-base-build:
<<: *docker
stage: docker-build
2017-05-02 14:08:24 +00:00
script:
2017-05-30 21:06:09 +00:00
- docker build --cache-from quay.io/quay/quay-base:latest -t quay.io/quay/quay-base:latest -f quay-base.dockerfile .
- docker push quay.io/quay/quay-base:latest
when: manual
container-build:
<<: *docker
stage: docker-build
script:
- docker build -t quay.io/quay/quay-ci:$CI_COMMIT_REF_SLUG -f quay.dockerfile .
- docker push quay.io/quay/quay-ci:$CI_COMMIT_REF_SLUG
# STAGE 2: Unit tests & code-style
.job: &job
variables:
GIT_STRATEGY: none
image: quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
before_script:
- cd /
- source venv/bin/activate
2017-05-02 14:08:24 +00:00
tags:
- kubernetes
unit-tests:
<<: *job
stage: unit-tests
script:
2017-05-30 21:06:09 +00:00
- py.test --timeout=7200 --verbose --show-count ./ --color=no -x
2017-05-02 14:08:24 +00:00
registry-tests:
<<: *job
stage: unit-tests
script:
2017-05-30 21:06:09 +00:00
- py.test --timeout=7200 --verbose --show-count ./test/registry_tests.py --color=no -x
2017-05-02 14:08:24 +00:00
karma-tests:
<<: *job
stage: unit-tests
script:
- yarn test
2017-05-30 21:06:09 +00:00
2017-05-02 14:08:24 +00:00
code-styles:
<<: *job
stage: unit-tests
script:
- echo "yapf"
- echo "pycodestyle"
- echo "pylint"
2017-05-30 21:06:09 +00:00
# Stage 3: Integration/e2e tests
2017-05-02 14:08:24 +00:00
postgres:
<<: *job
variables:
TEST_DATABASE_URI: 'postgresql://quay:quay@localhost/quay'
SKIP_DB_SCHEMA: 'true'
POSTGRES_PASSWORD: quay
POSTGRES_USER: quay
2017-05-30 21:06:09 +00:00
GIT_STRATEGY: none
2017-05-02 14:08:24 +00:00
stage: integration
services:
- postgres:9.6
script:
2017-05-30 21:06:09 +00:00
- sleep 30
2017-05-02 14:08:24 +00:00
- alembic upgrade head
2017-05-30 21:06:09 +00:00
- PYTHONPATH="." TEST="true" py.test --timeout=7200 --verbose --show-count ./ --color=no --ignore=endpoints/appr/test/ -x
2017-05-02 14:08:24 +00:00
mysql:
<<: *job
variables:
2017-05-30 21:06:09 +00:00
TEST_DATABASE_URI: 'mysql+pymysql://quay:quay@localhost/quay'
2017-05-02 14:08:24 +00:00
SKIP_DB_SCHEMA: 'true'
MYSQL_ROOT_PASSWORD: quay
MYSQL_DATABASE: quay
MYSQL_USER: quay
MYSQL_PASSWORD: quay
2017-05-30 21:06:09 +00:00
GIT_STRATEGY: none
2017-05-02 14:08:24 +00:00
stage: integration
services:
- mysql
script:
2017-05-30 21:06:09 +00:00
- sleep 30
2017-05-02 14:08:24 +00:00
- alembic upgrade head
2017-05-30 21:06:09 +00:00
- PYTHONPATH="." TEST="true" py.test --timeout=7200 --verbose --show-count ./ --color=no --ignore=endpoints/appr/test/ -x
2017-05-02 14:08:24 +00:00
2017-05-30 21:06:09 +00:00
# e2e-demo:
# <<: *job
# image: python:2.7
2017-05-02 14:08:24 +00:00
# variables:
2017-05-30 21:06:09 +00:00
# TEST_DATABASE_URI: 'postgresql://quay:quay@localhost/quay'
# SKIP_DB_SCHEMA: 'true'
# POSTGRES_PASSWORD: quay
# POSTGRES_USER: quay
# GIT_STRATEGY: none
# stage: integration
2017-05-02 14:08:24 +00:00
# before_script:
2017-05-30 21:06:09 +00:00
# - cd /
2017-05-02 14:08:24 +00:00
# services:
2017-05-30 21:06:09 +00:00
# - postgres:9.6
# - quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
2017-05-02 14:08:24 +00:00
# script:
2017-05-30 21:06:09 +00:00
# - sleep 240
# - curl localhost:80/cnr/version
# allow_failure: true