问题
What do you guys use to deploy and application and track their files in production? I mean tracking if the file was not changed directly in the server?
thanks
回答1:
I have been using Git for 3 years to track /usr/local on a HPC production cluster.
For 2.2G (mostly binaries) it takes 1 minute running git log -n 1; git status
(over NFS!) to convince myself that the files were not modified after deployment. On local disk the scan would take seconds. If change did happen, I see which files and diffs (if it's not binary).
回答2:
I wouldn't track those files through a VCS on the server.
Normally (except for simple webapp deployment), you don't have any "unnecessary" tool on a production server past the ones you actually need to run the app (i.e.: certainly not a VCS).
A Version Control System is there up until the pre-production environment, for you to get a specific tag to deploy.
But once that tag is used to get your files, then a deployment process takes place:
- replace the variables from your generic config files with production-specific values
- stop the production processes
- copy and deploy the files onto the production server
- restart
- monitor...
So I would set an external (i.e. not directly managed by a VCS) job to compare a versioned file and the corresponding deployed file.
来源:https://stackoverflow.com/questions/3863964/tracking-deployed-applications-files