I have two Perl scripts along with a GIT hook script. There I check the GIT workflow. Here are the scripts that invoke the stack.
pre-push -> unpush-changes -> dependency tree
There is a for loop in unpush-changes perl script that will call the perl script dependency tree.
pre push
system("unpushed-changes");
my $errorMsg = $ENV{'GIT_FLOW_ERROR_MSG'}// '';
if($errorMsg eq "true"){
print "Error occured!";
}
unpush-changes.pl
for my $i (0 .. $#uniqueEffectedProjectsList) {
my $errorMsg = $ENV{'GIT_FLOW_ERROR_MSG'}// '';
if($errorMsg ne "true"){
my $r=system("dependency-tree $uniqueEffectedProjectsList[$i]");
}else{
exit 1;
}
}
dependency-tree.pl
if(system("mvn clean compile -DskipTests")==0){
print "successfully build";
return 1;
}else{
$ENV{'GIT_FLOW_ERROR_MSG'} = 'true';
print "Error occured";
return 0;
}
script, , ENV unpush- script. ENV - , true. , , , , . , . , , .