How to mention specific Git-folder within the master branch in Jenkins
I would like to run jenkins job when the specific folder in Git/Git-hub master branch changes. Currently its running whenever Git master is changing but i need only when the specific folder is changing within the Git master than only its supposed to run. As I mentioned above,only subFolder changes than only I need to run the job,i tried with different options but its unable to identifying my folder. Looking for you advice and solutions. Thanks for advance.
One hack I can think of is in your jenkins test script, first read the latest commit (use the GIT_COMMIT environment variable), and scan for any change in the target sub-directory you care about. If no change shows up, then just terminate the build early. It is not pretty, but should work in your scenario. Example: git diff --name-only $GIT_PREVIOUS_SUCCESSFUL_COMMIT $GIT_COMMIT | grep "the/directory/you/care/" -q if [ $? -ne 0 ]; then # if there is no change under the directory you care, exit now. echo "No change under the target directory. Skipping build.." exit 0 fi # your existing build/test script...
git: Merged two branches into each other - is this bad?
Git fetch does not update origin/master
Unresponsive git status, diff, add (hanging)
GITHUB - Auto Re-base of branches when commit happens on current branch
Clone a specific branch from Google Cloud
git repo reorganization via branch
Bitbucket's Access Key Not Working
What is the base branch when a new one is created?
Git grep on files from last commit only
Merging changes to a file on different branches to master
Github push only one branch issue
Still behind the origin after git pull
What does git remote mean when it says local refs are out of date
Git pull to overwrite conflict files only
git - how to set a remote branch out of a branch in upstream?
Create submodules from a already created bitbucket repo