git


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...

Related Links

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

Categories

HOME
composer-php
refactoring
form-submit
less
sql-server-2005
ignite
owasp
get
access-token
external
directshow
rectangles
playframework-2.5
bigdata
zk
sourceforge
spring-boot-actuator
httpsession
sqlanywhere
tv
pfsense
mikrotik
sandbox
angular-openlayers
bing-api
asp.net-mvc-routing
layer
package-name
nestedscrollview
basic4android
rrd4j
leanft
powerdesigner
initializing
james
nsubstitute
youtube-analytics
angular2-http
sap-bw
smartassembly
fixture
lighttable
paypal-adaptive-payments
tableau-public
rt
spectral-density
mongodb-scala
simplehttpserver
data-transfer
gyp
cpio
local-variables
report-viewer2012
website-deployment
classname
customdialog
anonymity
polymer-designer-tool
iterm
cmfctoolbar
nameerror
tess-two
angularjs-ng-options
materialized-views
moovweb
bpopup
tap
coderunner
zenoss
avaloq-script
stacked-area-chart
stackato
tbb
bonsaijs
restkit-0.20
android-handlerthread
buttonclick
resourcedictionary
ubuntu-13.04
jvm-crash
payflowlink
jpreloader
xemacs
umbraco5
wind-river-workbench
windows-networking
fibonacci-heap
google-instant-previews
zend-navigation
microsoft.build
o3d

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile