kai tödter - jax devopshow to run the demo? install docker git clone cd docker edit the docker...
TRANSCRIPT
![Page 1: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/1.jpg)
Kai Tödter
![Page 2: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/2.jpg)
Who am I? Principal Key Expert
at Siemens Building Technologies
Web Technology Fan
Open Source Lover
E-mail: [email protected]
Twitter: twitter.com/kaitoedter
Blog: toedter.com/blog
4/10/2018 2 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License.
![Page 3: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/3.jpg)
Show Hands!
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 3
![Page 4: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/4.jpg)
Outline
Build Pipeline with Docker
Setting up
Jenkins
SonarQube
Artifactory
Terraform
AWS Deployment
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 4
![Page 5: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/5.jpg)
Demo (Local Docker)
https://192.168.99.100
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 5
![Page 6: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/6.jpg)
How to run the Demo? Install Docker
git clone https://github.com/toedter/cd-pipeline
cd docker
Edit the docker host in cd-pipeline.sh or .bat
When using Windows: Make sure *.sh files and plugins.txt have Unix line endings
Run cd-pipeline.sh or .bat
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 6
![Page 7: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/7.jpg)
DevOps CAMS
Culture
Automation
Measurement
Sharing
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 7
![Page 8: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/8.jpg)
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 8
Automation
![Page 9: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/9.jpg)
What can be automated Testing
Build Pipelines
Build Infrastructure
Deployments
Monitoring
Configuration
…
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 9
![Page 10: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/10.jpg)
Infrastructure as Code
Automation of infrastructure creation
Servers, OS, software, storage, networking, …
Stored in code repositories
Lots of tools available
SaltStack, Puppet, Chef, Terraform, Ansible, …
Infrastructure as Code is the approach “treating infrastructure like software”
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 10
![Page 11: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/11.jpg)
Creating a Build Pipeline
Jenkins
Continuous Integration
SonarQube
Internal Quality
Artifactory
Binary Artifact Repository
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 11
![Page 12: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/12.jpg)
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 12
![Page 13: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/13.jpg)
Docker
Docker images for
Jenkins, Sonarqube, Artifactory, nginx
Extra container for tools configuration
Docker Compose
for defining and running the multi-container pipeline tools
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 13
![Page 14: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/14.jpg)
Dockerfile (nginx) FROM nginx COPY nginx-selfsigned.crt /etc/ssl/ COPY nginx-selfsigned.key /etc/ssl/ COPY index.html /usr/share/nginx/html/ COPY *.png /usr/share/nginx/html/ COPY nginx.conf /etc/nginx
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 14
![Page 15: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/15.jpg)
Docker Compose version: '3.2' networks: cd-tools-network: driver: bridge services: sonarqubedb: image: postgres container_name: sonarqube-db environment: - POSTGRES_USER=sonar - POSTGRES_PASSWORD=sonar volumes: - /volumes/postgres/data:/var/lib/postgresql/data
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 15
![Page 16: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/16.jpg)
Docker Code Deep Dive
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 16
![Page 17: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/17.jpg)
Pipeline as Code
Jenkins => Jenkinsfile
TracisCI => .travis.yml
Gitlab CI => .gitlab-ci.yml
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 17
![Page 18: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/18.jpg)
Jenkinsfile pipeline { agent { docker { image 'java:openjdk-8' args '--network=docker_cd-tools-network' } } stages { stage('build + tests') { steps { sh './gradlew test' } } …
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 18
![Page 19: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/19.jpg)
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 19
Terraform
![Page 20: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/20.jpg)
Terraform
Write
Infrastructure as code
Plan
Preview changes before applying
Create
Always reproducible infrastructure
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 20
![Page 21: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/21.jpg)
Pipeline, Terraform and AWS
Create Security Groups
Configure SSH keys
Create EC2 instance
Provide scripts that are executed after creation
Output IP address
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 21
![Page 22: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/22.jpg)
Terraform Code Deep Dive
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 22
![Page 23: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/23.jpg)
Demo (AWS)
https://<ip address from terraform output>
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 23
![Page 24: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/24.jpg)
What’ Next? DNS entries for all tools
Let’s Encrypt Certificates
Backup/Restore
Monitoring with Prometheus and Grafana
Support of Nexus and Teamscale
AWS Spot instances
Single & Multi host deployments
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 24
![Page 25: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/25.jpg)
NextGen Pipeline Demo (AWS)
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 25
![Page 26: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/26.jpg)
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 26
Discussion
![Page 27: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/27.jpg)
Links
Github Repo: https://github.com/toedter/cd-pipeline
Terraform: https://www.terraform.io/
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 27
![Page 28: Kai Tödter - JAX DevOpsHow to run the Demo? Install Docker git clone cd docker Edit the docker host in cd-pipeline.sh or .bat](https://reader035.vdocuments.mx/reader035/viewer/2022062402/5ec5565f13b08355f20a9bc3/html5/thumbnails/28.jpg)
License This work is licensed under a Creative Commons
Attribution 4.0 International License. See http://creativecommons.org/licenses/by/4.0/
4/10/2018 © Kai Tödter, Licensed under a Creative Commons Attribution 4.0 International License. 28