Create Jenkins CI Project - jamongx/twitter-clone GitHub Wiki

  1. Dashboard -> New Item -> Name: Twitter_Clone_User_Service_CI_Job -> Maven Project

  2. Dashboard -> Twitter_Clone_User_Service_CI_Job -> Configure

  3. General -> Description -> Build code with help of maven and create an image on ansible and push it onto dockerhub

  4. Source Code Management -> Git -> Repositories -> Repository URL -> https://github.com/jamongx/hello-world.git

  5. Source Code Management -> Git -> Branches to build -> */main

  6. Build Triggers -> [V] Build whenever a SNAPSHOT dependency is built

  7. Build -> Root POM -> pom.xml

  8. Build -> Goals and options -> clean install

  9. Post Steps -> Run regardless of build result

  10. Send files or execute commands over SSH -> SSH Server Name: ansible-server

  11. Transfer Set Source files -> target/*.jar

  12. Remove prefix -> target

  13. Remote directory -> //opt//docker

  14. Exec command -> ansible-playbook /opt/docker/build_image_user_service.yml;

  15. Post-build Actions -> Build other projects -> Projects to build -> Twitter_Clone_User_Service_CD_Job -> Trigger only if build is stable