Try with *cp $(git diff-tree --no-commit-id --name-only --diff-filter=ACMRTU -r HEAD) transitdir*
See also $ git help diff-tree 2015-12-18 16:02 GMT+01:00 Ismaila Baradji <[email protected]>: > Hi, thanks very much, this help me a lot, > but it works only if there are no delete files between the commit files. > this is my jenkins log > > rm -rf target_dir > + mkdir target_dir > + git diff-tree --no-commit-id --name-only -r HEAD > + cp -r --parents puro/error_log puro/tmp/test/tes2/testfile.php target_dir > cp: cannot stat `puro/error_log': No such file or directory > Build step 'Execute shell' marked build as failure > SSH: Current build result is [FAILURE], not going to run. > Finished: FAILURE > ----------- > when I displayed the delete files, I have > jenkins@vm-dev01:~/workspace/pmc$ git diff-tree --no-commit-id --name-status > --diff-filter=D -r HEAD > D puro/error_log > > and to push only added or modified files, I can do > rm -rf target_dir > mkdir target_dir > cp -r --parents $(git diff-tree --no-commit-id --name-status > --diff-filter=ACMRTUXB -r $GIT_COMMIT) target_dir > > but for the deleted files, I don't know how to do. > do you have any solution to delete files in the remote directory ? > > > > > Le jeudi 17 décembre 2015 17:14:40 UTC-5, Baptiste Mathus a écrit : >> >> How about something like: >> >> *rm -rf transitdir* >> *mkdir transitdir* >> *cp $(git diff-tree --no-commit-id --name-only -r HEAD) transitdir* >> >> >> Then configure publish over ssh to copy every files of that "transitdir" >> directory. >> >> Does that help? >> >> 2015-12-17 20:09 GMT+01:00 Ismaila Baradji <[email protected]>: >> >>> hi Batmat, >>> thanks for your help. >>> I create a shell execute commande and add: $ git diff-tree >>> --no-commit-id --name-only -r GIT_COMMIT >>> >>> but how to copy theses files and how to put in the publish over ssh >>> parameters such as Source files, Remove prefix ? >>> I read the documentation >>> https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+SSH+Plugin, >>> but I don't know how to do? >>> >>> thanks >>> >>> Le jeudi 17 décembre 2015 07:19:42 UTC-5, Baptiste Mathus a écrit : >>>> >>>> Hi, >>>> What is "commit files"? Do you mean something like "the files that were >>>> touched by the last commit" ? >>>> >>>> If so, then it should be pretty easy to introduce a shell step for >>>> example that would call something along >>>> >>>> $ git diff-tree --no-commit-id --name-only -r bd61ad98 >>>> <http://stackoverflow.com/a/424142/345845> >>>> >>>> Then copy those files in a directory, and configure publish over ssh to >>>> push all the files of that dir. >>>> >>>> My 2 cents. >>>> >>>> Cheers >>>> >>>> 2015-12-16 21:46 GMT+01:00 Ismaila Baradji <[email protected]>: >>>> >>>>> Hi, >>>>> I am trying to configure my job to send only commit files. >>>>> I have tryed with run ssh and after publish over ssh but no one is not >>>>> working. >>>>> any idea? >>>>> >>>>> >>>>> -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS58qDSN4qFew%2BY1tu0NOf6%3Dj-wC%2BW4Kx2bxp-jH2Lv1_w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
