GITLAB
GITLAB
& DELIVERY
DELIVER WHAT CUSTOMERS WANT, FASTER, WITH AN INTEGRATED CI/CD TOOL
$ $$
CI CD
$ $$
WHAT'S INSIDE?
CI/CD: NON-NEGOTIABLE FOR MODERN SOFTWARE DEVELOPMENT
»» Software development before CI/CD
»» How does Continuous Integration and Delivery work?
GETTING STARTED
»» Choosing a CI/CD solution
»» Adopting CI/CD
ABOUT GITLAB
CI/CD: NON-NEGOTIABLE FOR
MODERN SOFTWARE DEVELOPMENT
Today, whatever your business, customer expectations are largely the same: Continuous Delivery (CD) is the next step: it ensures that new code is always in a
they want a great product and efficient service. The days of annual releases, state that’s ready to be deployed, reducing your cycle time and creating a fast,
with a pre-defined feature set bundled onto compact discs and delivered to effective feedback loop between you and your customers. Together, CI/CD play
retailers, are far behind us. Delivering customer value at the pace required a critical role in making sure that new code addressing customer needs is fully
demands a refined software development lifecycle that saves time, effort, and functional and ready to be shipped, early and often.
cost wherever possible.
Continuous Integration (CI) – the practice that developers use to detect, Continuous Integration: The practice that developers use to detect,
locate, and fix errors quickly by integrating their code frequently into a shared locate, and fix errors quickly by integrating their code frequently into
a shared repository and running automated tests on it.
repository and running automated tests on it – is quickly becoming a non-
negotiable aspect of everyday work for development teams.
development process. From deciding on feature sets, to working on new code, Manual deployments Automated deployments
to going to market and gathering user feedback to influence the next iteration, Feedback gathered too late for next
Rapid feedback loop
CI/CD encourages working in a more continuous way beyond the technical release
With a Continuous Integration strategy, developers check their new code across multiple operating systems, multiple browsers, and in general do more
in frequently, triggering automated processes that occur on every commit work than is practical on a developer’s machine. If you wait until the end of
a developer makes. Most commonly, this includes running a build and then the development to find out a change fails on a specific operating system or
performing automated tests, giving you a team-wide view of the health of every browser, that can become expensive and could jeopardize the release.
commit and whether it builds and passes tests. Using CI in conjunction with
Git, you can take advantage of fast, lightweight branching to enable building
and testing changes on a staging or development branch before merging to
By leveraging CI you become
the master branch. If all goes well, you can go ahead and merge, and perform proactive rather than reactive,
another CI run on the master branch as an additional quality gate.
ultimately saving money.
A CI system can also offload a lot of work from the developer. They no longer
have to worry about building their changes with a variety of different operating
systems or other environments. The CI system can take care of all that, and
leverage its ability to integrate with elastic compute tools like Docker and
Kubernetes to take full advantage of the power of the cloud, without having
to run on a development machine. Best of all, all of this work is automated,
which frees up the developer to move onto other tasks while the build and tests
complete.
Continuous Delivery is an evolution of Continuous Integration: if your automated
build passed all its tests, why stop there? Continuous Delivery ensures that the
staging environment is always reflective of the latest changes, so it’s ready for
review and feedback by stakeholders right away, and is ready to be deployed at
the touch of a button.
Catching errors earlier in the cycle can prevent time-consuming and potentially
costly backtracking. Ensuring that new code is always ready for instant
deployment reduces bottlenecks in the run-up to a new release, so you can
deliver early and often. Delivering early and often facilitates a quick feedback
cycle between you and your users, boosting customer satisfaction and loyalty. Review Apps: A feature that automatically spins up a dynamic
environment for merge requests, so you can preview changes right
And with the introduction of review apps, previewing changes, sharing them away.
with stakeholders and gathering feedback is as simple as sending a link to click.
BENEFITS OF BUILT-IN CI/CD
Of course, the advantages of Continuous Integration and Continuous Delivery
are neither controversial nor new, and there have been a number of solutions
on the market for a while. These are usually bolted onto other tools, whether
they’re popular for on-premises (such as Jenkins) or rooted in the cloud (like
Travis or CircleCI). Many organizations find these sufficient for their needs, but
there has been growing interest in built-in CI/CD solutions1.
1
On Building Tools for Developers: Heroku CI. Ike DeLorenzo, Heroku.com
It’s more resource efficient
Adopting continuous integration and more CI/CD coupled with elastic compute resources using containers empowers
agile processes can result in up to 78% savings you to dynamically scale up or down easily, on demand, helping to save on
in development costs per program, according infrastructure costs. If the output of your build is a container image, you can take
to the HP LaserJet Firmware team.2 advantage of the consistency and repeatability of Dockerizing your builds by
pushing to the built-in registry and running CI from there.
It’s more time efficient It gives you more control and visibility
It’s not unusual for an organization to rely on a number of distinct tools to fulfil Having your CI/CD integrated into the repository management system gives
each stage of the cycle, but it’s not always the most efficient approach. A built- developers more control and visibility over their build pipeline, making it even
in CI/CD solution reduces administrative complexity, and allows developers easier to identify issues early and address them while costs are still low. This is in
to spend less time stringing together their tooling and troubleshooting when line with the DevOps concept of “shifting left3,” which moves processes such as
APIs change. Tighter integration between different stages of the development reviews and testing to earlier stages in the software development lifecycle. The
process facilitates the creation of cross-references between code, tests and other upshot is that using version control for build scripts and CI configuration
deployments while discussing them, making it easier to see the full context. gives you the peace of mind of being able to restore easily to an earlier version if
Reducing the need for context-switching can also speed up workflow – leaving a bug is introduced.
more time for the work that matters, like building new features.
2
The HP FutureSmart Case Study, Dr. Nicole Forsgren, Jez Humble, and Gene Kim, ContinuousDelivery.com 3
Shift-left quality: Getting started with DevOps metrics. TechBeacon.com
SCALING CI/CD WITH
CONTAINERS
Containers simplify the process of testing and deploying software4. They allow
you to package an application’s code and dependencies into a single, portable
“container” that can be easily moved across the development lifecycle.
4
Want Efficient CI and CD? Better start using containers. Chris Tozzi, TechTarget.com
What is a container? CI/CD with containers
A container is a method of operating system-based virtualization that allows Containers make it possible to build one version of an application that can
you to securely run an application and its dependencies independently without be easily deployed to multiple types of environments — whatever developers
impacting other containers or the operating system. and QA run is exactly what you see in testing, staging, and production. Code
can be shipped faster when packaged in a container because errors and bugs
Containers work much like a virtual machine except that, instead of packaging are caught earlier in the process. Whenever new changes are introduced into
your code with an operating system, containers are run as a Linux process the code, you simply update the container image and spin up a new container,
inside of the kernel. This means that each container only contains the code and versus needing to uninstall the older version and replace it with a new one.
dependencies needed to run that specific application, making them smaller and
faster to run. When applications are built as containers and run on an integrated continuous
integration server, developers can automatically test their code in a production-
like environment, closing the gap between development and operations.
When integrated with other development tools like GitLab, it’s possible to
automatically trigger a CI build every time a developer commits new code, run
VM VM
tests in parallel, and spin up and destroy ephemeral production environments to
App App see the changes live.
CONTAINER CONTAINER
App App Libs Libs Libs App App CI/CD coupled with containers has the potential to fully automate the build, test,
and deploy stages of the software development lifecycle, making it easier and
Libs Libs Libs OS OS Libs Libs App
faster for developers to review their code and ensure that it is production-ready.
OS Hypervisor OS
Container: a lightweight method of operating system-based
Bare Metal Virtualization Containers virtualization that allows you to securely run an application and its
dependencies independently without impacting other applications or
the operating system.
CONTAINERS RETAIN THE SAME REPEATABILITY FACTOR AS VIRTUAL MACHINES,
BUT ARE MUCH FASTER AND USE LESS RESOURCES TO RUN.
GETTING STARTED
CHOOSING A CI/CD SOLUTION
Hosting
Hosting is an important consideration when choosing any new tool. In the
past, you would have had no option but to install a separate CI server, but
now whether you prefer a SaaS solution or to host yourself, you have options. Built-In Continuous Integration
Integrations with third-party services are sometimes easier with a cloud-based “For a long time GitLab CI used to be a separately deployed web
service, but some organizations prefer the peace of mind that comes with application, the UIs were not integrated in any way and they felt like
everything being housed within their walls. separate products, as if they were not even made by the same company.
At one point we decided to integrate it, and literally within one or
Open source vs. commercial
two weeks we started seeing new possibilities of interlinking these
Using an open source solution has its advantages: it's free, you can see exactly
applications. We’d think, ‘Hey, wouldn’t it be neat if we added a button
what’s in the box, and make alterations if needed. Make sure you do your
to the latest status of this page?’ which previously is something we never
research before committing though: what if you need priority access to support?
would have thought about, because we really thought of the two as
If the vendor decides to abandon the product, can you manage without them?
separate products that need to talk over an established channel, instead
Are there any features specific to one product that would make things easier for
of just putting a link in everywhere where it would useful to have a link to
your team? Ask these questions first.
CI. So with a built-in solution, the integration you get is not just tighter,
Support for integrations it’s integrated in ways which other, siloed development teams, developing
Find out what tools your teams are already using and if the CI/CD solution you're separate products, would never think of.”
considering is supported. We’ve already mentioned the benefits of a built-in — DOUWE MAAN, GITLAB PLATFORM BACKEND LEAD
solution, and bringing all your tools under one product with one interface and
datastore is also useful for things like cycle analytics, which can help to reduce
the time between coming up with an idea and deploying it.
Features for visualizing the release process
One of the advantages of leveraging CI/CD is being able to see changes and new
additions from the moment they're created. Below are some of the features
ADOPTING CI/CD
you’ll want to look out for when choosing a CI/CD tool: If you are not currently using any form of CI/CD, it may be that your teams are
not routinely testing new code at all, in which case you face a significant culture
Review Apps change. Instead of simply deploying and hoping for the best, CI/CD means a
Review Apps automatically spin up dynamic environments for new code before new, more proactive approach to working, and can take some time for teams
it’s merged, so you can easily preview changes and share them with others just to adapt if they’re not used to writing and running tests. This may meet some
by sending a link. resistance up front, but the outcome of a more streamlined development cycle
with less downtime and disruption is ultimately worth the effort. If it’s less
Deploy Boards intimidating to do so, begin by adopting CI to start with and introduce CD later.
Deploy Boards allow you to watch a deploy roll out across pods and monitor the
health and deployment status of each environment, all in one place. This makes If you’re already using a CI/CD tool and are looking to switch to another, the
it easier to spot potential problems and stop or roll back with one click. initial migration can take a couple of days or a couple of months depending
on your migration strategy. To reduce complexity, a complete transition is
Canary Deployments recommended. However, for organizations with many teams and projects, you
Canary Deployment is another popular strategy for Continuous Delivery, can also start by migrating one team or project at a time.
minimizing the impact of any issues with a new version by deploying it to a small
portion of the fleet first and monitoring their usage and behavior closely. This A new tool may require slightly different processes and ways of working which
portion serves as the “canary in the coal mine,” alerting you to problems so that can mean a shift in mindset. For example, GitLab CI is more powerful if you
only a small percentage of users is affected before you rectify the error. parallelize your tests and think of them as various interdependent stages, rather
than a sequential process. Teams often treat testing as a linear process so it can
These are just a few of the features that can make a significant difference to your be a mindshift to see them rather as working simultaneously.
team's efficiency.
Have questions or need more information about getting started? We’ve got you
covered! Get in touch.
ABOUT GITLAB
Since its founding in 2014, GitLab has quickly become the leading self-hosted Ready to get started?
Git repository management tool used by software development teams ranging Get in touch to learn more about GitLab’s open source and integrated
from startups to global enterprise organizations. GitLab has since expanded CI/CD solution.
its product offering to deliver an integrated enterprise-grade source code
management system with built-in Continuous Integration and Continuous Contact Sales
Delivery tooling.
GitLab helps teams eliminate unnecessary steps from their workflow and focus
exclusively on building great software. Today, more than 100,000 organizations,
including NASA, CERN, Alibaba, SpaceX, O'Reilly, IBM and ING, trust GitLab
to bring their modern applications from idea to production, reliably and
repeatedly.
“If your team is looking for a way to breathe fresh life into a
legacy CI pipeline, I suggest taking a look at GitLab CI. It has
been a real game changer for our mobile team at Ticketmaster.”
— JEFF KELSEY, LEAD ANDROID ENGINEER AT TICKETMASTER
“HOW GITLAB CI SUPPORTED TICKETMASTER'S RAMP UP TO WEEKLY MOBILE RELEASES”