From 0d7ed89ca56f300262983fccc8e45c52039c7893 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Mon, 5 Dec 2016 19:22:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B1=D0=B0=20=D1=82=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20gitlab-ci=20services?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 32 +++++++++++++++++++++++++------- Dockerfile-dev | 2 +- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d5aa9ca..f70e788 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,21 +4,39 @@ stages: - release variables: - CONTAINER_IMAGE: registry.ely.by/elyby/accounts + CONTAINER_IMAGE: "registry.ely.by/elyby/accounts" test:backend: - image: jonaskello/docker-and-compose:1.12.1-1.8.0 + image: docker:latest services: - - docker:1.12.1-dind + - mariadb:10.0 + - redis:3.0-alpine + variables: + # mariadb config + MYSQL_RANDOM_ROOT_PASSWORD: "true" + MYSQL_DATABASE: "ely_accounts_test" + MYSQL_USER: "ely_accounts_tester" + MYSQL_PASSWORD: "ely_accounts_tester_password" stage: test before_script: - docker login -u gitlab-ci -p $CI_BUILD_TOKEN registry.ely.by - echo "$SSH_PRIVATE_KEY" > id_rsa - - docker-compose -f tests/docker-compose.yml build --pull testphp - after_script: - - docker-compose -f tests/docker-compose.yml down -v script: - - docker-compose -f tests/docker-compose.yml run --rm testphp ./vendor/bin/codecept run -c tests + - export TEMP_DEV_IMAGE="${CONTAINER_IMAGE}:ci-${CI_BUILD_ID}" + - docker build --pull -f Dockerfile-dev -t $TEMP_DEV_IMAGE . + - > + docker run --rm + --add-host=mariadb:`getent hosts mariadb | awk '{ print $1 ; exit }'` + --add-host=redis:`getent hosts redis | awk '{ print $1 ; exit }'` + -e YII_DEBUG="true" + -e YII_ENV="test" + -e DB_HOST="mariadb" + -e DB_DATABASE="ely_accounts_test" + -e DB_USER="ely_accounts_tester" + -e DB_PASSWORD="ely_accounts_tester_password" + -e REDIS_HOST="redis" + $TEMP_DEV_IMAGE + php vendor/bin/codecept run -c tests test:frontend: image: node:5.12 diff --git a/Dockerfile-dev b/Dockerfile-dev index 133d64d..9d3ad4a 100644 --- a/Dockerfile-dev +++ b/Dockerfile-dev @@ -1,4 +1,4 @@ -FROM registry.ely.by/elyby/accounts-php:1.1.2-dev +FROM registry.ely.by/elyby/accounts-php:latest-dev # Вносим конфигурации для крона и воркеров COPY docker/cron/* /etc/cron.d/