How to use Jenkins to see which files were modified in the commit?

0

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.

    
asked by anonymous 12.09.2018 / 23:10

1 answer

0
  

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.

About push changes from Gitlab to Jenkins, you can create a webhook. See this link: link

  

In short:   To execute the SQL script I will create a build of type "Run in the windows command".

You can integrate with Jenkins along with Flyway or Liquibase , so you can version your scripts in a more dynamic way.

    
20.09.2018 / 18:02