how to identify .java files whenever developer push changes in git repo(through hooks)

StackOverflow https://stackoverflow.com/questions/12890087

  •  07-07-2021
  •  | 
  •  

Domanda

.git directory hooks directory is there in that post commit file i have to write script for to identify whether the developer pushes any .java file in to git repo.if atleast one java file is there the build should start.i already wrote script to do automate build in post commit hook(curl http my jenkins project path). suppose developers push only property files no need to build

È stato utile?

Soluzione

The simplest solution is a script to detect the file extension of new files pushed:
See "Want Git post receive hook to detect certain file types".

You could try and reuse what GitHub is using to detect language in what they receive:

Linguist:

This is what GitLab is doing... in a post-receive hook!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top