Integrating Internal GIT with Cloud Manager Using Jenkins
Authors
Singaiah Chintalapudi: https://www.linkedin.com/in/singaiah-chintalapudi-ph-d-a4a053122
Rahul Chugh: https://www.linkedin.com/in/rahulchug
Overview
In this article, we’ll discuss about integrating on-premise GIT with the Cloud Manager using Jenkins. Below is a overview of the flow.
Different Ways to Sync
- Adobe I/O
- Jenkins
- Manually
- Using shell script
Since most of the organization use Jenkins for their CI/CD processed, we’ll use Jenkins to easily push the code from your on-premise GIT to Cloud Manager.
Prerequisites
- Jenkins
- GIT plugin installed on Jenkins
- Repository configured on Cloud Manager
Configuring Jenkins
- Let’s create a new Jenkins job and go to configuration.
- Go to Source Code Management and select “Git”
- Here we should configure couple of repositories i.e. one is source (on-premise repo) and the other one is destination (Cloud Manager repo). The Branch to build/Brand Specifier in the below screenshot represents the branch on your on-premise git repo.
Note: Once you configure the proper git urls and credentials, you would not see the connection errors. Name is a required field here and differentiates the two git repo’s. By-default when you checkout any git repo, the default repo ID is: origin. You can use any name you want as long as they are different.
4. Optional: You can modify “Build Triggers” to automatically push the code to Cloud Manager or configure SSL hooks to push the code to Cloud Manager automatically on push events to on-premise GIT repo.
Note: Step 4 is optional and you need to configure webhooks on your git repo to make push events to work on Jenkins job.
5. DO NOT configure anything on “Build Environment”.
6. DO NOT add anything in the“Build” step
7. Add a step in the “Post-build Actions”. Click on “Add post-build action” dropdown and select “Git publisher”
8. Git publisher will push the changes from on-premise git repo to Cloud Manager GIT repo. Here you need to configure the Cloud Manager branch where you want merge your on-premise changes. The “Target remote name” in the below screenshot should be same as repository name configure in Step 3.
Note: You can either Merge the code with Cloud Manager branch or do a force push.