Continuous
Integration
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.
So what does that mean?
It means that we should be merging feature
branches into the main branch (master), regularly.
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.
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
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
Best Practices
→ Maintain a code repository
Best Practices
→ Maintain a code repository
→ Automate the build
Best Practices
→ Maintain a code repository
→ Automate the build
→ Make the build self-testing
Best Practices
→ Maintain a code repository
→ Automate the build
→ Make the build self-testing
→ Everyone commits to the baseline every day
Best Practices (cont)
→ Every commit to the baseline should be built
Best Practices (cont)
→ Every commit to the baseline should be built
→ Keep the build fast
Best Practices (cont)
→ Every commit to the baseline should be built
→ Keep the build fast
→ Test in a clone of the production environment
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
Best Practices (cont)
→ Everyone can see the results of the latest build
Best Practices (cont)
→ Everyone can see the results of the latest build
→ Automate deployment
Continuous
Delivery
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.
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.
What are
some best
practices?
CODE ALL OF THE THINGS!
All of the scripts to build, test, and deploy the app
should be contained in the project itself.
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
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
Build it
If your app requires building before it can be tested,
you should create a build script that does that
automatically.
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.
Deployment
Deployments need to be automated
This means we need to have a scripted way of
deploying to the different environments
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
Continuous
Integration
It's for
everyone

Continuous Integration - What even is it?

  • 1.
  • 2.
    What is it? Continuousintegration (CI) is the practice, in software engineering, of merging all developer working copies to a shared mainline several times a day.
  • 3.
    So what doesthat mean? It means that we should be merging feature branches into the main branch (master), regularly.
  • 4.
    Why is itimportant? 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.
  • 5.
    How does itwork? 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
  • 6.
    What else doesit 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
  • 7.
    Best Practices → Maintaina code repository
  • 8.
    Best Practices → Maintaina code repository → Automate the build
  • 9.
    Best Practices → Maintaina code repository → Automate the build → Make the build self-testing
  • 10.
    Best Practices → Maintaina code repository → Automate the build → Make the build self-testing → Everyone commits to the baseline every day
  • 11.
    Best Practices (cont) →Every commit to the baseline should be built
  • 12.
    Best Practices (cont) →Every commit to the baseline should be built → Keep the build fast
  • 13.
    Best Practices (cont) →Every commit to the baseline should be built → Keep the build fast → Test in a clone of the production environment
  • 14.
    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
  • 15.
    Best Practices (cont) →Everyone can see the results of the latest build
  • 16.
    Best Practices (cont) →Everyone can see the results of the latest build → Automate deployment
  • 17.
  • 18.
    What is it? Continuousdelivery (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.
  • 19.
    What does thatmean? 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.
  • 20.
  • 21.
    CODE ALL OFTHE THINGS! All of the scripts to build, test, and deploy the app should be contained in the project itself.
  • 22.
    Separate scripts We shouldaim 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
  • 23.
    README!! The README fileshould 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
  • 24.
    Build it If yourapp requires building before it can be tested, you should create a build script that does that automatically.
  • 25.
    Test suite Every projectshould 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.
  • 26.
    Deployment Deployments need tobe automated This means we need to have a scripted way of deploying to the different environments
  • 27.
    Recap Time → Mergeregularly into common mainline → Run tests every commit → Automate everything → Keep it fast → Test in a clone of production → Script all of the things
  • 28.
  • 29.