continuous integration - what even is it?
TRANSCRIPT
![Page 1: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/1.jpg)
Continuous Integration
![Page 2: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/2.jpg)
What is it?
Continuous integration (CI) is the practice, in software engineering, of merging all developer
working copies to a shared mainline several times a day.
![Page 3: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/3.jpg)
So what does that mean?
It means that we should be merging feature branches into the main branch (master), regularly.
![Page 4: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/4.jpg)
Why is it important?
The main aim of CI is to prevent us from entering Integration Hell, caused by large unwieldy branches with so many merge conflicts, that it's unclear as to
the working state of the app.
![Page 5: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/5.jpg)
How does it work?
The concept of CI was intended to be used with automated unit tests, written through the practices
of Test Driven Development. Initially, this was just done on the developers local
machine before merging. In recent times however, we tend to utilise build
servers to run these suites for us after every commit
![Page 6: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/6.jpg)
What else does it do?
In addition to unit tests, CI practices now include myriad things such as updating documentation,
static analysis, measure and profile performance, and facilitate manual QA processes.
It also leads us into the practice of Continuous Delivery
![Page 7: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/7.jpg)
Best Practices
→ Maintain a code repository
![Page 8: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/8.jpg)
Best Practices
→ Maintain a code repository→ Automate the build
![Page 9: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/9.jpg)
Best Practices
→ Maintain a code repository→ Automate the build
→ Make the build self-testing
![Page 10: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/10.jpg)
Best Practices
→ Maintain a code repository→ Automate the build
→ Make the build self-testing→ Everyone commits to the baseline every day
![Page 11: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/11.jpg)
Best Practices (cont)
→ Every commit to the baseline should be built
![Page 12: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/12.jpg)
Best Practices (cont)
→ Every commit to the baseline should be built→ Keep the build fast
![Page 13: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/13.jpg)
Best Practices (cont)
→ Every commit to the baseline should be built→ Keep the build fast
→ Test in a clone of the production environment
![Page 14: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/14.jpg)
Best Practices (cont)
→ Every commit to the baseline should be built→ Keep the build fast
→ Test in a clone of the production environment→ Make it easy to get the latest deliverables
![Page 15: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/15.jpg)
Best Practices (cont)
→ Everyone can see the results of the latest build
![Page 16: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/16.jpg)
Best Practices (cont)
→ Everyone can see the results of the latest build→ Automate deployment
![Page 17: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/17.jpg)
Continuous Delivery
![Page 18: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/18.jpg)
What is it?
Continuous delivery (CD) is a software engineering approach in which teams produce software in short
cycles, ensuring that the software can be reliably released at any time.
It aims at building, testing, and releasing software faster and more frequently.
![Page 19: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/19.jpg)
What does that mean?
Every commit to the mainline (master) should be deployable and releaseable to the customers.
It also means we should deploy as soon as that code is merged.
![Page 20: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/20.jpg)
What are some best practices?
![Page 21: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/21.jpg)
CODE ALL OF THE THINGS!All of the scripts to build, test, and deploy the app
should be contained in the project itself.
![Page 22: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/22.jpg)
Separate scripts
We should aim to have a bootstrap script in every project, that sets the machine up with all the
dependencies required to run the app.For example, bundle install, npm install, bower
install, etc
![Page 23: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/23.jpg)
README!!
The README file should list any large dependencies that need to be installed before running the
bootstrap script, and also how to install them!Things like, ruby version, node version, database
server, etc
![Page 24: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/24.jpg)
Build it
If your app requires building before it can be tested, you should create a build script that does that
automatically.
![Page 25: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/25.jpg)
Test suite
Every project should have a test suite, and a way of running that suite.
Create a test script that runs any dependencies for your suite, and then runs the suite itself.
![Page 26: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/26.jpg)
Deployment
Deployments need to be automatedThis means we need to have a scripted way of
deploying to the different environments
![Page 27: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/27.jpg)
Recap Time
→ Merge regularly into common mainline→ Run tests every commit→ Automate everything
→ Keep it fast→ Test in a clone of production
→ Script all of the things
![Page 28: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/28.jpg)
Continuous Integration
![Page 29: Continuous Integration - What even is it?](https://reader031.vdocuments.us/reader031/viewer/2022030309/58f159c91a28aba0478b456f/html5/thumbnails/29.jpg)
It's for everyone