Hello Forum,
Please help me out a little bit. I have a little laravel-skeleton on my own that we use at the company. The skeleton works like a charm on localhosts and on our webservers. However, I’m running into issues when I want to test it on GitLab.
I use iolsons .gitlab-ci.yml that seems to be fine (removed the PHP5.5 part, cause we son’t need that)
Starts building the project at git push, but fails at the database section.
$ php artisan migrate:refresh --seed
[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
ERROR: Build failed with: exit code 1
Tried the usual fixes what we do in a situation like this, but none of them have worked, the build always get stuck at this point. Any clue why?
OK, the sollution was to modify my .env file (the example, to be more precise) because I had custom names for the Mysql variables and they had a special character. After making them to look like the codes in iolsons script, it works nicely.
How can I close this forum topic?
1 Like
Hello bertalanimre,
How were you able to resolve your issue ?
I made my .env.exmpale file exact. But still I am having an issue with
`[PDOException]
SQLSTATE[HY000] [2002] No such file or directory
ERROR: Build failed with: exit code 1`
Hello,
Sorry for the very late answer, I hope you’ve already solved your issue. Anyhow here is my answer:
Created a seperate .env.example called .env.gitlab and filled the database parts like this:
DB_HOST=mysql
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
After this, in the gitlab-ci.yml file I’ve set up the variables like:
variables:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_DATABASE: homestead
services:
Plus I’m using image: bobey/docker-gitlab-ci-runner-php5.6
for testing. I hope it helps somebody