GIT Packaging Script

Helps create packages for deployment, can be used to create a deployment package for files changed between two git tags or two git Head revisions like HEAD³ and HEAD or between commit ids.

the resulting zip can be exploded on to production and the delete script is run to clean up stale files.

how does the script work ?

  1. The script gets the git diff between 2 Tags or HEADS or Commit IDs to give a list of all files(with paths) there were either added, modified or deleted.
  2. It checks the results for files that were added or modified and pushes them to file_list.
  3. It also checks the results for files that were marked as deleted and pushes them to delete_list.
  4. If the lists are not empty it then proceeds to create a folder with the timestamp as the name.
  5. Using the files from file_list and git archive it creates a . zip under the above folder.
  6. Finally dumps the file paths from delete_list to a txt file under the above folder.

comments powered by Disqus