Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitLab CI interprets "Nothing to migrate" as error #849

Closed
4d4ch4u32 opened this issue Aug 23, 2019 · 1 comment
Closed

GitLab CI interprets "Nothing to migrate" as error #849

4d4ch4u32 opened this issue Aug 23, 2019 · 1 comment
Assignees

Comments

@4d4ch4u32
Copy link

Bug Report

Q A
BC Break yes/no
Version 2.0.0

Summary

We are using the Doctrine migrations bundle for update database in our deployment process. Currently, we are switching to Gitlab-CI.

The problem: The CI is aborting the deployment process because the output of command php sf doctrine:migrations:diff contains stderr.

The part of our .gitlab-ci.yml:

deploy_live:
  type: deploy
  environment:
    name: live
    url: 1.2.3.4
  script:
      - ssh [email protected] "cd /var/www/html/ && git pull origin master && exit"
      - ssh [email protected] "cd /var/www/html/ && composer install -n && exit"
      - ssh [email protected] "cd /var/www/html/ && php sf doctrine:migrations:diff --env=prod && exit"
      - ssh [email protected] "cd /var/www/html/ && php sf doctrine:migrations:migrate -n --env=prod && exit"
      - 'ssh [email protected] "cd /var/www/html/ && chown www-data:www-data . -R && exit"'
  only:
    - master

Output of Gitlab CI:

$ ssh [email protected] "cd /var/www/html/ && php sf doctrine:migrations:diff --env=prod && exit"
#!/usr/bin/env php

In NoChangesDetected.php line 13:
                                                    
  No changes detected in your mapping information.  
                                                    

doctrine:migrations:diff [--configuration [CONFIGURATION]] [--db-configuration [DB-CONFIGURATION]] [--editor-cmd [EDITOR-CMD]] [--filter-expression [FILTER-EXPRESSION]] [--formatted] [--line-length [LINE-LENGTH]] [--check-database-platform [CHECK-DATABASE-PLATFORM]] [--db DB] [--em [EM]] [--shard SHARD] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

ERROR: Job failed: exit code 1

This may be a bug, but maybe it can be circumvented?

FYI: sf is a symlink to bin/console.

@alcaeus
Copy link
Member

alcaeus commented Aug 24, 2019

Duplicates #833, Fixed by #840. Closing here.

@alcaeus alcaeus closed this as completed Aug 24, 2019
@alcaeus alcaeus self-assigned this Aug 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants