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

How to use modman on multi-server deployments? #66

Open
horninc opened this issue Jun 13, 2014 · 2 comments
Open

How to use modman on multi-server deployments? #66

horninc opened this issue Jun 13, 2014 · 2 comments

Comments

@horninc
Copy link

horninc commented Jun 13, 2014

I am using AWS Elastic Beanstalk. This, and almost all other, multi server deployment requires all of the code to be in a .git repo, that can be updated, and then deployed all servers in the cluster at once.

My problem is that modman creates .git folders under .modman/extension_name folder, so all of this source code is automatically omitted when committing, and pushing changes.

I can, of course, manually connect to EC2 or similar instances and run modman commands from there, but it defies logic, as it disrupts the whole automatic scaling concept that large scale magento shops require.

Please advise.

@brb3
Copy link

brb3 commented Jun 13, 2014

The way we handle this is we setup all of our remote servers with a .modman/whatever folder, and initialize it as a git repo. We then add a post-receive git-hook that looks like this:

#!/bin/bash
RESTORE='\033[0m'
BOLD='\033[1m'
BLUE='\033[00;34m'
MSGBEGIN="${BOLD}${BLUE}::${RESTORE}${BOLD}"
read oldrev newrev refname
oldIFS=${IFS}
IFS='/' read -a parts <<< "$refname"
IFS=${oldIFS}
echo -e "${MSGBEGIN} Checking out branch '${parts[2]}'. ${RESTORE}"
git checkout -f ${parts[2]}
git reset --hard

echo -e "${MSGBEGIN} Redeploying modman. ${RESTORE}"
modman deploy

# Any other application specific stuff I need to do

echo -e "${MSGBEGIN} Done. ${RESTORE}"

Then I have a helper script that does a git push to all my remote servers at the same time.

We are not using EC2, however, and I'm not sure if this would translate directly, but hopefully this will help get you started.

@horninc
Copy link
Author

horninc commented Jun 13, 2014

Issue that we are having with Elastic Beanstalk is that it does not have post deployment hooks! I will try your version (I assume its derived from OpsWorks) to get started and on the right track, but it would be amazing if you could spare some minutes to give more details on why you take these steps in your code.

The first question I get about your setup is - why do you deploy, and why does it differ from checkout?

Its not clear to me how it actually works :( and if the modman in your case is still the part of other .git repository.

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

No branches or pull requests

2 participants