Add quay-kubernetes package / Add quay CD to k8s

This commit is contained in:
Antoine Legrand 2017-07-17 01:24:31 +02:00
parent 2f750bfc87
commit 1d0313229e
45 changed files with 1129 additions and 10 deletions

View file

@ -47,6 +47,28 @@ container-release:
variables:
DOCKER_DRIVER: overlay
DOCKER_HOST: tcp://docker-host.gitlab-runner.svc.cluster.local:2375
deploy-preview:
before_script:
- appr login -u $DOCKER_USER -p $DOCKER_PASS quay.io
environment:
name: review/${CI_COMMIT_REF_SLUG}
on_stop: stop-preview
url: https://quay-${CI_COMMIT_REF_SLUG}.k8s.devtable.com
image: quay.io/appr/appr:kubectl
only:
- branches
script:
- cd deploy/quay-demo-app
- echo -n 1.0.0-${CI_COMMIT_REF_SLUG} > VERSION
- 'echo "{\"image\": \"quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}\", \"tag\": \"${CI_COMMIT_REF_SLUG}\"}" > params.json'
- cat params.json
- appr push quay.io/quay -f
- appr deploy quay.io/quay/quay-demo-app@1.0.0-${CI_COMMIT_REF_SLUG} --namespace ci-quay-${CI_COMMIT_REF_SLUG} -x docker_user=$DOCKER_USER -x docker_pass=$DOCKER_PASS
- kubectl get ingresses -n ci-quay-${CI_COMMIT_REF_SLUG} -o wide
stage: deploy
tags:
- kubernetes
when: manual
karma-tests:
before_script:
- cd $QUAYDIR
@ -130,12 +152,34 @@ registry-tests:
QUAYDIR: /quay-registry
TEST: 'true'
stages:
- docker_base
- deploy
- docker_build
- docker_base
- unit_tests
- integration
- docker_release
- teardown
stop-preview:
before_script:
- appr login -u $DOCKER_USER -p $DOCKER_PASS quay.io
environment:
action: stop
name: review/${CI_COMMIT_REF_SLUG}
url: https://quay-${CI_COMMIT_REF_SLUG}.k8s.devtable.com
image: quay.io/appr/appr:kubectl
only:
- branches
script:
- 'echo "{\"image\": \"quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG}\", \"tag\": \"${CI_COMMIT_REF_SLUG}\"}" > params.json'
- cat params.json
- appr remove quay.io/quay/quay-demo-app@1.0.0-${CI_COMMIT_REF_SLUG} --namespace ci-quay-${CI_COMMIT_REF_SLUG} -x docker_user=$DOCKER_USER -x docker_pass=$DOCKER_PASS -x params.json
- kubectl get pods -n ci-quay-${CI_COMMIT_REF_SLUG} -o wide
stage: deploy
tags:
- kubernetes
variables:
GIT_STRATEGY: none
when: manual
unit-tests:
before_script:
- cd $QUAYDIR