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

Asked

Viewed 251 times

0

I am working with PHP and Mysql on Windows, my repository is in Gitlab. I wish to use Jenkins to run a job or pipeline when pushing to the repository.

The job should check the changed files in the commit and if there are changes in any file in the directory called bd_changes it should run the SQL that is in this modified file.

In short:

  • To run the SQL script I will create a Build of type "Run in windows command".

  • How do I identify if there have been changes to the bd_changes directory ?

  • How do I read the contents of this file ?

Note: I know it is possible to use Gitlab to perform the procedure and dismiss Jenkins, but I am studying the tool.

1 answer

0

I am working with PHP and Mysql on Windows, my repository is in Gitlab. I wish to use Jenkins to run a job or pipeline when pushing to the repository.

About the push changes from Gitlab to Jenkins, you can create a webhook. See this link:https://imasters.com.br/devsecops/gitlab-jenkins-uma-integracao-poderosa

To summarize: To run the SQL script I will create a Build of type "Run in windows command".

You can do the integration with Jenkins along with the Flyway or the Liquibase thus, you versiona the scripts in a more dynamic way.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.