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

Add mutagen support #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arendarenko
Copy link
Contributor

@arendarenko arendarenko commented Mar 28, 2020

Description

These changes is related to #64

Working with dockergento on Mac is really challenging because you always need to run sync manually when modifying something on the host.

Using mutagen.io tool developers who use Mac can eliminate this step and be more focused on coding.

This PR adds mutagen support without breaking "unison-way" sync.

How to test

  • Install homebrew:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  • Install mutagen: brew install havoc-io/mutagen/mutagen
  • Setup dockergento project and add USE_MUTAGEN_SYNC="1" to properties file
  • Start dockergento & enjoy coding without worrying about files sync

Other notes

  • In order to check Mutagen sync status you can run: mutagen sync list

@arendarenko arendarenko force-pushed the add-mutagen-support branch 3 times, most recently from e91d344 to 0320798 Compare March 30, 2020 04:51
- add mutagen tasks lib
- update commands in order to work with mutagen
- update configuration in order to work with mutagen
- remove unnecessary volume declaration in docker-compose for mac
@arendarenko
Copy link
Contributor Author

this need to be added:

  • check if mutagen is installed during creating project - add it to the properties file to use by default.

@@ -4,11 +4,11 @@ services:
phpfpm:
volumes: &appvolumes-mac
- workspace:/var/www/html
- ./app:/var/www/html/app:delegated
Copy link
Member

Choose a reason for hiding this comment

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

Hi! @arendarenko this change is probably going to break the mac setup if you don't use mutagen. Maybe I'm not uderstanding it in the right way, could you explain me this change? Thank you!

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's better to fully switch to mutagen instead or having an option?

Copy link
Member

Choose a reason for hiding this comment

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

I dont know if it's a good option because you are making this project dependant on mutagen, and we're forcing ppl to install mutagen in order to be able to use this tool!

Could be great making it optional!

Copy link
Contributor

Choose a reason for hiding this comment

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

@danielozano i think it’s better to add one more tool for Mac OS in order to get much better experience.

@jalogut
Copy link
Contributor

jalogut commented Jul 4, 2020

@ihor-sviziev I agree with @danielozano . The purpose of this tool was always to keep it as simple as possible without needing to install anything but docker.

I do not doubt that mutagen might improve it but in that case it should be optional. You could create a pull request to update the docs instead. Add a new section with the couple of steps needed for mutagen for those who want to use it. I think that would be the best for now. What do you think?

@jalogut
Copy link
Contributor

jalogut commented Jul 4, 2020

I checked the PR again and noticed that a lot of changes are needed, so this could be difficult to explain in the docs. I noticed that you use the param USE_MUTAGEN which is great. To approve this PR, you should update the setup command to give the user the option to use mutagen or not during the setup. If yes is selected, then the parameter should be set automatically to 1 and the docker-compose.yml for mac can be changed accordingly. Do you know how to implement that?

@arendarenko
Copy link
Contributor Author

arendarenko commented Jul 5, 2020

Hi @ihor-sviziev, @danielozano, @jalogut. Thanks for your comments.

Tbh I don't see any reason to use unison any further since mutagen is working in background and you don't need to enable/disable sync manually anymore. But I'm agree with @jalogut that for backward compatibility sake we need to have both: unison and mutagen tools support for mac, so I will update this PR and let you know.

@jalogut
Copy link
Contributor

jalogut commented Jul 5, 2020

Yes, for that I think the simplest would be to add a check on the watch command. If USE_MUTAGEN is enabled, just return a comment like "this command is not needed with mutagen" and stop the execution. That way the unison container is no started.

@gallyamov
Copy link

How about this https://docs.docker.com/docker-for-mac/mutagen-caching/? I have already tried edge and it works fine.

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.

5 participants