Click here to load reader

Continuous Delivery with Docker and Jenkins Job Builder

  • View

  • Download

Embed Size (px)

Text of Continuous Delivery with Docker and Jenkins Job Builder

1. Continuous Delivery with Docker & Jenkins Job Builder Wouter Lagerweij @wouterla 2. Prepare! See the Readme.html in the main directory: copy contents of usb stick to harddrive open workshop-docker-jenkins dir type vagrant up type vagrant ssh type docker ps 3. The Goal Pipeline view at Persgroep Online Services 4. The Goal 5. Automate Everything Everything in version control Including infrastructure Build server and configuration Deployment scripts 6. We are going to... Automate creation of Jenkins Jobs Automate creation of deployment package (Docker container) Automate deployment of Docker container Automate creation of full Delivery Pipeline in Jenkins 7. Using Jenkins Jenkins Job Builder Docker Bash;-) 8. docker run $ docker run -d -v /home/vagrant/.m2:/root/.m2 -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 --name jenkins wouterla/docker-jenkins ports: -p : volumes: -v : -d: background --name: to find it by Image: /: 9. Docker stop docker stop docker stop docker rm docker ps 10. Work Start Jenkins container on port 8081 then Stop, and switch back to 8080 11. Running Jenkins Job Builder docker run wouterla/docker-jenkins-job-builder Needs access to jenkins! docker run --link jenkins:jenkins wouterla/docker-jenkins-job-builder link: : 12. Our pipeline 13. Jenkins Job Builder Jobs Projects Job Templates Variables 14. Variable types and scope project -> template defaults YAML references macros within and across files 15. Project / template 16. YAML references 17. Macros 18. Work Add a new step to the pipeline that runs the maven install goal 19. Docker build -t /: . (or -f) But today: $> ./ 20. Dockerfile 21. Work Complete the Dockerfile for demo app, and build it locally Hint: You can run the app with: java -jar jetty-runner.jar 22. Dockerfile 23. Docker push/pull login push pull 24. Work Add step to pipeline that builds the docker image for our demo app 25. Work Add test phase to pipeline Add step that deploys demo app on port 8081 26. Work Add production phase and environment running on port 8082 27. Work Add second pipeline, building workshop branch 28. Work Add smoketest step to test and production phase