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

Override docker-compose.yaml on ddev start, fixes #762 #819

Merged
merged 2 commits into from
May 4, 2018

Conversation

rfay
Copy link
Member

@rfay rfay commented May 1, 2018

The Problem/Issue/Bug:

OP #762: We keep having to tell people to delete docker-compose.yaml on ddev upgrades. We made the decision to take control of docker-compose.yaml

This PR addresses the changes for docker-compose.yaml, another PR will address the changes to config.yaml handling.

How this PR Solves The Problem:

  • Looks for docker-compose.yaml #ddev-generated in docker-compose. If not found, renames the file to docker-compose.yaml.bak and warns the user.
  • Creates the docker-compose.yaml on every start
  • Overrides can be done in docker-compose.*.yaml

Manual Testing Instructions:

  • Run ddev start with this version
  • Existing docker-compose.yaml should be renamed to .bak, and new one created.
  • Run it again, with or without changes. A new one should be created. No warning should be given.

Automated Testing Overview:

Nothing at this point.

Related Issue Link(s):

OP #762

Release/Deployment notes:

@rfay rfay self-assigned this May 1, 2018
@rfay rfay changed the title Override docker-compose.yaml on ddev start, fixes #762 Override docker-compose.yaml on ddev start, for #762 May 1, 2018
Copy link
Contributor

@rickmanelius rickmanelius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preparation

  • git checkout 124ad099 and make darwin
  • ddev version => v0.17.0-9-g124ad099
  • Fresh drupal-7.59 site

Testing

  • Fresh site, run ddev config
  • Reviewed .ddev/config.yml to see if there were any notable differences (none jumped out at me).
  • Ran ddev start
  • Reviewed .ddev/docker-compose.yml and observed #ddev-generated on line 2
  • Removed the comment, re-ran ddev start
    • Observed "User-managed docker-compose.yaml will be replaced with ddev-generated docker-compose.yaml. Original file will be placed in docker-compose.yaml.bak"
    • Idea: I almost feel like with this change we need to lead people to a page in our documentation that describes why we do this and how to best structure your overrides or individual services.
  • Removed the comment, re-ran ddev start a second time.
    • I noted we only keep one backup. This is probably fine because I don't want to keep .bak.10.REALIMPORTANT things laying around.
  • Running again with not changes. Everything went smoothly.

I do think with such a significant change that we probably need to have documentation updates to reflect this along with the fact that we now version config.yml and we don't explicitly call out the default containers in config.yml. That said, I'm thumbs up on the functionality.

@rfay rfay force-pushed the 20180501_override_docker_compose branch from 124ad09 to 7349cb2 Compare May 3, 2018 16:23
@rfay
Copy link
Member Author

rfay commented May 3, 2018

@rickmanelius I think you requested changes because of required docs. Please check the paragraph that I already had slipped in upstream, https://github.com/drud/ddev/blob/master/docs/users/extend/custom-compose-files.md#restrictions-on-the-docker-composeyaml-file and see if that does it for you, and approve if it does.

@rickmanelius rickmanelius self-requested a review May 4, 2018 02:49
Copy link
Contributor

@rickmanelius rickmanelius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rfay. I had missed that documentation change. Looks good. Approved!

@rfay rfay force-pushed the 20180501_override_docker_compose branch from e8dbef0 to 696251a Compare May 4, 2018 03:12
@rfay rfay changed the title Override docker-compose.yaml on ddev start, for #762 Override docker-compose.yaml on ddev start, fixes #762 May 4, 2018
@rfay rfay merged commit ba4cfde into ddev:master May 4, 2018
@rfay rfay deleted the 20180501_override_docker_compose branch May 4, 2018 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants