Generate .gitlab.yaml via .gitlab.jsonnet
This commit is contained in:
parent
165486180d
commit
24044df945
6 changed files with 379 additions and 137 deletions
275
.gitlab-ci.yml
275
.gitlab-ci.yml
|
@ -1,152 +1,153 @@
|
|||
# Generated from .gitlab-ci.jsonnet
|
||||
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
|
||||
---
|
||||
stages:
|
||||
- docker-build
|
||||
- unit-tests
|
||||
- integration
|
||||
- release
|
||||
- deploy
|
||||
|
||||
variables:
|
||||
FAILFASTCI_NAMESPACE: 'quay'
|
||||
IMAGE: quay.io/quay/quay
|
||||
PIP_CACHE_DIR: pip-cache
|
||||
PIP: /venv/bin/pip
|
||||
PYTEST: /venv/bin/py.test
|
||||
TEST: "true"
|
||||
PYTHONPATH: "."
|
||||
|
||||
|
||||
# STAGE 1: container build
|
||||
|
||||
.docker: &docker
|
||||
container-base-build:
|
||||
before_script:
|
||||
- docker login -u $DOCKER_USER -p $DOCKER_PASS quay.io
|
||||
image: docker:git
|
||||
only:
|
||||
- master
|
||||
- tags
|
||||
script:
|
||||
- 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
|
||||
services:
|
||||
- docker:dind
|
||||
stage: docker_base
|
||||
tags:
|
||||
- docker
|
||||
variables:
|
||||
DOCKER_DRIVER: aufs
|
||||
image: docker:git
|
||||
before_script:
|
||||
- docker login -u $DOCKER_USER -p $DOCKER_PASS quay.io
|
||||
services:
|
||||
- docker:dind
|
||||
tags:
|
||||
- docker
|
||||
|
||||
container-base-build:
|
||||
<<: *docker
|
||||
stage: docker-build
|
||||
script:
|
||||
- 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
|
||||
before_script:
|
||||
- docker login -u $DOCKER_USER -p $DOCKER_PASS quay.io
|
||||
image: docker:git
|
||||
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
|
||||
- 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}
|
||||
services:
|
||||
- docker:dind
|
||||
stage: docker_build
|
||||
tags:
|
||||
- docker
|
||||
variables:
|
||||
DOCKER_DRIVER: aufs
|
||||
container-release:
|
||||
before_script:
|
||||
- docker login -u $DOCKER_USER -p $DOCKER_PASS quay.io
|
||||
image: docker:git
|
||||
only:
|
||||
- master
|
||||
- tags
|
||||
script:
|
||||
- docker pull quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
|
||||
- docker tag quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG} quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHA}
|
||||
- docker push quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHA}
|
||||
services:
|
||||
- docker:dind
|
||||
stage: docker_release
|
||||
tags:
|
||||
- docker
|
||||
variables:
|
||||
DOCKER_DRIVER: aufs
|
||||
karma-tests:
|
||||
before_script:
|
||||
- cd /
|
||||
- source venv/bin/activate
|
||||
image: quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
|
||||
script:
|
||||
- curl -Ss https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
|
||||
- echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
|
||||
- apt-get update -yqqq
|
||||
- apt-get install -y google-chrome-stable
|
||||
- yarn test
|
||||
stage: unit_tests
|
||||
tags:
|
||||
- kubernetes
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
image: quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
|
||||
PYTHONPATH: .
|
||||
TEST: 'true'
|
||||
mysql:
|
||||
before_script:
|
||||
- cd /
|
||||
- source venv/bin/activate
|
||||
- cd /
|
||||
- source venv/bin/activate
|
||||
image: quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
|
||||
script:
|
||||
- sleep 30
|
||||
- alembic upgrade head
|
||||
- PYTHONPATH="." TEST="true" py.test --timeout=7200 --verbose --show-count ./ --color=no --ignore=endpoints/appr/test/ -x
|
||||
services:
|
||||
- mysql:latest
|
||||
stage: unit_tests
|
||||
tags:
|
||||
- kubernetes
|
||||
|
||||
unit-tests:
|
||||
<<: *job
|
||||
stage: unit-tests
|
||||
script:
|
||||
- py.test --timeout=7200 --verbose --show-count ./ --color=no -x
|
||||
|
||||
|
||||
registry-tests:
|
||||
<<: *job
|
||||
stage: unit-tests
|
||||
script:
|
||||
- py.test --timeout=7200 --verbose --show-count ./test/registry_tests.py --color=no -x
|
||||
|
||||
|
||||
karma-tests:
|
||||
<<: *job
|
||||
stage: unit-tests
|
||||
script:
|
||||
# Install Chrome
|
||||
- set -xe
|
||||
- curl -Ss https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
|
||||
- echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
|
||||
- apt-get update -yqqq
|
||||
- apt-get install -y google-chrome-stable
|
||||
|
||||
- yarn test
|
||||
|
||||
|
||||
code-styles:
|
||||
<<: *job
|
||||
stage: unit-tests
|
||||
script:
|
||||
- echo "yapf"
|
||||
- echo "pycodestyle"
|
||||
- echo "pylint"
|
||||
|
||||
|
||||
# Stage 3: Integration/e2e tests
|
||||
postgres:
|
||||
<<: *job
|
||||
- kubernetes
|
||||
variables:
|
||||
TEST_DATABASE_URI: 'postgresql://quay:quay@localhost/quay'
|
||||
GIT_STRATEGY: none
|
||||
MYSQL_DATABASE: quay
|
||||
MYSQL_PASSWORD: quay
|
||||
MYSQL_ROOT_PASSWORD: quay
|
||||
MYSQL_USER: quay
|
||||
PYTHONPATH: .
|
||||
SKIP_DB_SCHEMA: 'true'
|
||||
TEST: 'true'
|
||||
TEST_DATABASE_URI: mysql+pymysql://quay:quay@localhost/quay
|
||||
postgres:
|
||||
before_script:
|
||||
- cd /
|
||||
- source venv/bin/activate
|
||||
image: quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
|
||||
script:
|
||||
- sleep 30
|
||||
- alembic upgrade head
|
||||
- PYTHONPATH="." TEST="true" py.test --timeout=7200 --verbose --show-count ./ --color=no --ignore=endpoints/appr/test/ -x
|
||||
services:
|
||||
- postgres:9.6
|
||||
stage: unit_tests
|
||||
tags:
|
||||
- kubernetes
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
POSTGRES_PASSWORD: quay
|
||||
POSTGRES_USER: quay
|
||||
GIT_STRATEGY: none
|
||||
stage: integration
|
||||
services:
|
||||
- postgres:9.6
|
||||
script:
|
||||
- sleep 30
|
||||
- alembic upgrade head
|
||||
- PYTHONPATH="." TEST="true" py.test --timeout=7200 --verbose --show-count ./ --color=no --ignore=endpoints/appr/test/ -x
|
||||
|
||||
|
||||
mysql:
|
||||
<<: *job
|
||||
variables:
|
||||
TEST_DATABASE_URI: 'mysql+pymysql://quay:quay@localhost/quay'
|
||||
PYTHONPATH: .
|
||||
SKIP_DB_SCHEMA: 'true'
|
||||
MYSQL_ROOT_PASSWORD: quay
|
||||
MYSQL_DATABASE: quay
|
||||
MYSQL_USER: quay
|
||||
MYSQL_PASSWORD: quay
|
||||
GIT_STRATEGY: none
|
||||
stage: integration
|
||||
services:
|
||||
- mysql
|
||||
TEST: 'true'
|
||||
TEST_DATABASE_URI: postgresql://quay:quay@localhost/quay
|
||||
registry-tests:
|
||||
before_script:
|
||||
- cd /
|
||||
- source venv/bin/activate
|
||||
image: quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
|
||||
script:
|
||||
- sleep 30
|
||||
- alembic upgrade head
|
||||
- PYTHONPATH="." TEST="true" py.test --timeout=7200 --verbose --show-count ./ --color=no --ignore=endpoints/appr/test/ -x
|
||||
|
||||
|
||||
# e2e-demo:
|
||||
# <<: *job
|
||||
# image: python:2.7
|
||||
# variables:
|
||||
# TEST_DATABASE_URI: 'postgresql://quay:quay@localhost/quay'
|
||||
# SKIP_DB_SCHEMA: 'true'
|
||||
# POSTGRES_PASSWORD: quay
|
||||
# POSTGRES_USER: quay
|
||||
# GIT_STRATEGY: none
|
||||
# stage: integration
|
||||
# before_script:
|
||||
# - cd /
|
||||
# services:
|
||||
# - postgres:9.6
|
||||
# - quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
|
||||
# script:
|
||||
# - sleep 240
|
||||
# - curl localhost:80/cnr/version
|
||||
# allow_failure: true
|
||||
- py.test --timeout=7200 --verbose --show-count ./test/registry_tests.py --color=no -x
|
||||
stage: unit_tests
|
||||
tags:
|
||||
- kubernetes
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
PYTHONPATH: .
|
||||
TEST: 'true'
|
||||
stages:
|
||||
- docker_base
|
||||
- docker_build
|
||||
- unit_tests
|
||||
- integration
|
||||
- docker_release
|
||||
- teardown
|
||||
unit-tests:
|
||||
before_script:
|
||||
- cd /
|
||||
- source venv/bin/activate
|
||||
image: quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}
|
||||
script:
|
||||
- py.test --timeout=7200 --verbose --show-count ./ --color=no -x
|
||||
stage: unit_tests
|
||||
tags:
|
||||
- kubernetes
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
PYTHONPATH: .
|
||||
TEST: 'true'
|
||||
variables:
|
||||
FAILFASTCI_NAMESPACE: quay
|
||||
|
|
Reference in a new issue