How does continuous integration relate to continuous delivery / deployment? Here is a quote from the current content of continuous-integration:


  ... process of merging developer's working code copies to a shared codebase frequently to prevent or minimize integration problems.


OK, I get that. But then there is also continuous-delivery and  continuous-deployment, and that's where I continuously get a bit lost:


How does continuous integration relate to continuous delivery and/or continuous deployment, assuming that somewhere along the line(s) via integration you end up delivering in a target environment where everything will be deployed.
What's the difference between continuous delivery and continuous deployment?


Back in the days, before DevOps was called DevOps, we used terminology which might possibly help to understand these new DevOps terms, such as:


promote to (or demote from) some pre-prod target, optionally combined with some type of regeneration process (compiles, binds, etc) to package all related components together in executable-like things. That's what should be similar/close to continuous integration, or not?
distribute to some target environment, using something like FTP (if standard copies cannot bridge the gap), but do not yet activate it in the target. That's what should be similar/close to continuous delivery, or not?
install (or activate) in some target environment, combined with things like binds, stop/start operations, etc. That's what should be similar/close to continuous deployment, or not?
Continuous delivery and continuous deployment both take continuous integration one step further, by adding a 'deployment to production' step to the process.
The difference between continuous delivery and deployment is that for delivery this step is done manually and for deployment is it automatic. 



Difference between Continuous Integration, Continuous Delivery and Continuous Deployment. Picture copied from codeproject.com

Whether you do continuous delivery or continuous deployment is very much an implementation choice. If you do continuous deployment, changes in code will be deployed automatically after the acceptance tests are passed. This may or may not be desirable for your product. With continuous delivery, people can make a choice whether a particular code change  is deployed or not (and possibly where exactly it is deployed). 

Since the difference between continuous delivery and deployment is small and many people are unaware of the exact difference, the two terms are sometimes used interchangeably.