Jenkins Post Build Deployment

I use Jenkins CI in my project, I can successfully build the project, and I have no problem deploying it in the container after each successful build. Now I have a condition that the deployment in the container should happen only if the release properties file is changed. If there are no changes in the release properties file, the project should be built, but the deployment should not occur.

Since I am new to Jenkins, I try to use all the options, I am sure that someone must have been in a similar situation, please share your thoughts or ideas. If I find something, I will post it.

Appreciate your help on this.

+4
source share
2 answers

If it is not answered yet!

This can be easily done using the Script Trigger plugin. This allows you to run the Shell / Script package and build based on the exit code of this Script.

You can track the last modified date of the properties file, and if it changes, you can continue and build if there is no assembly until the change occurs.

Hope this helps (if at all required now;)

+1
source

You must install the " Post-Build Script Plug-in " in your Jenkins. The previous answer mentioned a plugin that is no longer available.

Then you can add build steps such as shell script execution

view screenshot script

You can also publish a Docker container, etc.

0
source

All Articles