How can I get Jenkins to archive git difference between last build and latest one? -


so i'm trying jenkins make update.zip of changed files (including path) between last build git commit , latest one.

i have script make full files zip , update zip if make multiple commits , push, make archive of latest commit.

is there way can make archive of changed , new files in update zip previous build commit latest?

zip -r -9 $workspace/builds/full-files-$build_number.zip files git archive -o $workspace/builds/update-$build_number.zip head $(git diff --name-only head^) 

(hopefully i'm explaining correctly)

any appreciated.

to this, need able retrieve last commit built. according git plugin documentation, should available in git_previous_commit environment variable. hence try getting diff using

git diff --name-only $git_previous_commit 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -