Let's try to use a really simplified and not necessarily correct real-world example:
I'm working for a company that develops Android apps. Currently we have to work on an app which is just a rather small project so just me and one other collegue work on the app.
Since we are top-notch developers we are of course writing tests and only want our code to reach the develop
branch when the app actually compiles and all our tests are green.
To automate this recurring task we use an automation/continuous server like Jenkins (or something else like Bamboo) and create a workflow which builds our project's code and runs our tests whenever we try to commit any code to the develop
branch.
Only if it builds successfully and all tests are green will our code be integrated into the develop
branch.
--> We are using Continuous Integration, yay!
Now, after some months have passed, we decide that our app is ready to be released to the users of the Play Store.
We take the code of our current (and hopefully thoroughly tested) version of our app from the develop
branch and copy it to a new branch named release
.
The release
branch is used in a second Jenkins workflow which for now does the same as our first one: It builds the code from this branch and runs the tests against it.
Then we need to add another step to the new Jenkins workflow. When our app's code was successfully build and all tests are green, we want the app to be automatically deployed/uploaded to the Play Store so the users can download and install it on their phones.
--> We are using Continuous Deployment, yay!