github and jenkins integration

Hi,

I am looking for an example like below, how to resolve it. Could you guide me please? Or add a video here with instructions?

​Example:-

Phase1:

I have a ruby script which does the following three scenarios and loops in & out based on its findings.
A) if the source code version is same in both environments, chef do nothing. 
B) if the source code version same (1.1.0) chef version not matched (but exists) (1.1.1,1.1.0) ,check current  version and older versions and do nothing. 
C) if the source code versions both are mismatch then chef (ruby script) do the update to which ever version is current. 

Phase2: (how can I accomplish below phase2??) – please respond ASAP. 

need to come up with a new build job from Jenkins, so it starts integrating with the ruby script above in following steps:

  1. Build a new jenkins job and that job will trigger the above ruby script and the script again will parse the env.json variables (dev);  How can I accomplish this??
  2. For parsing environment variable, I need to make the env.json file available for Jenkins; How can I accomplish this??
  3. #1 and #2 should be tied to the release branch in Git. How can I accomplish this?
  4. When do I want to run Jenkins build job, automatically? when there is a merge request to release branch in git (after #3 is complete).  How can I accomplish this?

This post was moved to a different board that fits your topic of discussion a bit better. This means you’ll get better engagement on your post, and it keeps our Community organized so users can more easily find information. As you’ll notice, your Topic is now in the Project Development Help and Advice board. No action is needed on your part; you can continue the conversation as normal here.

Let me know if you have any other questions or if I can help with anything else.