bash - Incremental deploy from a shell script -


I have a project, where I want to use FTP as a means of deploying files on a live server I have been developing on linux, so I have a script that makes backups of the content of the FTP server, removes all the files on the FTP, and uploads all the fresh files from the Mercurial repository, to the one Have hop together. (And users should take care of uploaded files and folders, and change in post-deployment etc.)

This is working well, but the project is too long to make the deployment process very long is triggered.

I would like to modify the script to see which files have been changed, and deploy only modified files (backup is exactly like ATM)

As I am using Mercurial, my opinion is to request between two modified modifications in any way, between its two modifications, iterate over the changed files, and upload each modified file, and prefix Delete the removed file.

I can use hg log-vR rev1: rev2 , and from the output, I change the files to grep / Sed / etc.

Two problems:

I've heard horror stories that lead to insanity to paralyze the production of LS, so my guess is that here applies, If I try to parse the output of the hg log , the variables will go through word-sharing and all types of changes.

hg log does not tell me to modify / add / remove a file that is less than the difference between modified and deleted files.

So, what would be the right way to do this? I am using yafc as a FTP client, if it is needed, but ready to switch.

You can use a custom style that parses for you

  hg log --rev rev1: rev2 --style mystyle  

then pipe it to sort -u to find a unique list of files file "MySstyle" will look like this:

  changeset = '{file_mods} {file_adds} \ n' file_mod = '{file_mod} \ n' file_add = '{file_add} \ n'  

Add modes and templates files are modified or added. There is a similar file_dels and file_del template for deleted files.

Alternatively, you hg position -m --rev rev1- 1: rev2 before modified / added files M or A . You need to reduce a different revision category than a rev1, because it is the position since "baseline" deleted files are the same - you need a -d flag and before each deleted file < Em> D is added.


Comments