Issue
I want to create a CI/CD pipeline using Jenkins where whenever someone commits on master branch, two things happen on a specific "server" (EC2).
- First, git pull to sync with latest change
- Run a specific shell script present on server
Can you kindly point me in the right direction? I understand that git sync can be done with Jenkins plugin for git, but how can I run the second script "Using Jenkins flow"?
Solution
One way to do it is to add the EC2 machine where you are running the script via SSH. To this install the SSH Plugin
Then follow the steps as given here
After this you can execute the scripts by creating a new pipeline. Either a free style or multibranch pipeline. Refer the article here
Answered By - pratikvasa