We are implementing a file storage system via Stash, and what we are replacing now uses a descriptor file. This file, called deployment.xml, contains configuration information for our other processes such as documenting production transfers. Ideally, we would require the deployers to include this .xml file with every push, and we currently have a pre-receive hook implemented that will block a push if it doesn't contain it. The second, and more tricky, part is to remove the deployment.xml file from their repository, and move it to a different directory on our Linux file system. What would a good way to implement this be? A pre or post receive hook? Should we look at implementing a shell script on the back end that moves the file? Any assistance or ideas would be appreciated.
If I understand you correctly, I don't think there's a good way to do that. Removing files from the repository necessarily changes the commit hash. So your options would be to either:
Are you sure you don't want to copy the XML file to a new directory? Is it necessary that you remove the file from the repository?
git show master:deployment.xml > /other/dir/deployment.xml
should do the trick for copying.
Sorry for the late response. Thank you for your answer, it started a conversation with my team about how we wanted to process this information. If I wanted to use that git command in a java pre-receive hook similar to this other resource I've been using: https://bitbucket.org/atlassianlabs/stash-filesize-hook-plugin/src/cd31c72b002c0337a7bb93b0ae30c13af0a77f6e/src/main/java/com/atlassian/stash/plugin/filesize/FilesizeHook.java?at=master how would I do that?
As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs