Question

I have a project (web), that interacts heavily with a service layer. The client has different staging servers for the deployment of the project and the service layer, like this:

  • Servers from A0..A9 for developement,
  • Servers from B0..B9 for data migration tests,
  • Servers from C0..C9 for integration test,
  • Servers from D0..D9 for QA,
  • Servers from E0..E9 for production

The WSDLs I'm consuming on the website to interact with the service layer, change from one group of server to the other.

How can I keep different versions of the WSDLs in the different branches using a git workflow with three branches (master, dev, qa)?

Was it helpful?

Solution

As you explained in your comment, the branches will be merged, and the WSDL files will conflict. When that happens, you have to resolve the conflict by keeping the right version of the WSDL file.

For example, if you are on qa, merging from dev, and there is a conflict on a WSDL file, you can resolve it with:

git checkout HEAD file.wsdl

This will restore the WSDL file as it was before the merge, and you can commit the merge.

However, if there are changes in the WSDL file but there are no conflicts, then git merge will automatically merge them. If that's not what you want, and you really want to preserve the file without merging, then you could merge like this:

git merge dev --no-commit --no-ff
git checkout HEAD file.wsdl
git commit

UPDATE

To make this easier, see the first answer to this other question: Git: ignore some files during a merge (keep some files restricted to one branch)

It offers 3 different solutions, make sure to consider all of them.

OTHER TIPS

I think branching is the wrong tool to use. Branches are highly useful for (more or less) independent development that needs that take place in parallel and in isolation. Your use case of multiple deployment environments doesn't appear to fit that model. It also doesn't scale very well if you need multiple branches for e.g. releases and always have to create and maintain the deployment-specific child branches.

You would probably be better served by a single branch that defines multiple configurations (either for deployment or building, depending on what consumes the WSDL file).

This assumes that the WSDL file is the only different between the branches, which is the impression I get from the question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top