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
Post a Comment