I'm working with PHP and Mysql on Windows, my repository is in GitLab. I want to use Jenkins to run a job or pipeline when performing a push to the repository.
The job should check the changed files in the commit and if there are any changes to a file in the directory called bd_changes it should execute the SQL that is in this modified file.
In short:
-
To run the SQL script I will create a "Run in windows command" build.
-
How do I identify if there were any changes to files in the bd_changes directory?
-
How do I read the contents of this file?
Note: I know that it is possible to use GitLab to perform the procedure and dispense with Jenkins, but I am studying the tool.