dimanche 10 novembre 2019

connection refused in gitlab-ci

I can no longer connect to the mysql database in the gitlab. I change my connection variables in the file but I can't establish the connection.

here my gitlab-ci.yml

image: lorisleiva/laravel-docker:latest

variables:
  MYSQL_ROOT_PASSWORD: root
  MYSQL_USER: root
  MYSQL_PASSWORD: root
  MYSQL_DATABASE: homestead
  DB_HOST: mysql

composer:
  stage: build
  script:
    - composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
    - cp .env.example .env
    - php artisan key:generate
  artifacts:
    expire_in: 30 days
    paths:
      - vendor/
      - .env
  cache:
    key: ${CI_COMMIT_REF_SLUG}-composer
    paths:
      - vendor/

phpunit:
  services:
    - mysql:5.7
  stage: test
  dependencies:
    - composer
  script:
    - php artisan migrate
    - phpunit --coverage-text --colors=never

Here my .env.exemple

...
DB_CONNECTION=mysql
DB_HOST_WRITER=127.0.0.1
DB_HOST_READER=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=root
DB_PASSWORD=root
...


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire