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?
Something like
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.