Hands-On Auto DevOps with GitLab CI
- 3.5 hours on-demand video
- 1 downloadable resource
- Full lifetime access
- Access on mobile and TV
- Certificate of Completion
Get your team access to 4,000+ top Udemy courses anytime, anywhere.Try Udemy for Business
- Automate your application builds, tests, and deployments through a simple configuration of GitLab CI.
- Build confidence in your software by integrating test and quality checking into your development process.
- Deploy your application automatically to virtualized and containerized cloud environments so your software is always up-to-date
- Integrate monitoring so you can be sure your application is working well in production
- Create your own automated build infrastructure fully under your control.
DevOps requires the ability to automatically build, test, and deploy code. GitLab CI integrates directly into GitLab to perform continuous integration.
Describe DevOps and Continuous Integration
Describe GitLab CI
Demonstrate building, testing, and deploying an application using GitLab CI
To deploy our application, we need a reliable environment that supports updates with zero downtime. GitLab CI integrates well with Kubernetes to provide this environment.
Understand Docker and Kubernetes and how they work together
Use GitLab CI to create a Kubernetes cluster in Google Kubernetes Engine
Link the Kubernetes cluster to GitLab CI to deploy applications
GitLab CI provides sophisticated application build and deployment without requiring us to create any build configuration at all.
Enable Auto DevOps in GitLab CI
Push our code to create and run an Auto DevOps pipeline
Demonstrate how our Auto DevOps pipeline deploys our application to Kubernetes
To build Docker images inside our GitLab CI Docker executor, we need to configure and use a Docker-in-Docker setup.
Define a Docker daemon as an extra service for our GitLab CI build
Use built-in variables to define the name and version ID of our Docker image
Build the Docker image and push to GitLab Container Registry
To organize our build, test, and deployment configuration, we need to know how to place jobs into stages.
See the default build stages
Declare custom build stages and ordering
Assign a job to a stage
To speed up our build pipeline while still maintaining a high-quality test infrastructure, we need to know how to run multiple jobs in parallel.
Create multiple jobs in a single stage
Observe jobs running in parallel
Create multiple identical job instances and run them in parallel
Downloading dependencies has the potential to slow down our build. If we use caching, it can speed things up.
Configure our build to cache downloaded dependencies
Configure our build to cache only certain directories
Create separate caches for separate builds and separate branches
Artifacts can be used to pass data between jobs in different stages. This makes it easier to divide our build up into multiple jobs.
Create a build pipeline with multiple stages and artifacts defined
Customize which jobs receive which artifacts
Observe how artifacts are provided in default and customized cases
To deploy our application to Kubernetes, we need to pass Kubernetes configuration and authentication to our deployment job.
Associate a Kubernetes cluster with the environments in our project
Use passed through Kubernetes credentials
Deploy our application from our GitLab CI deployment job
To review changes to our application before we deploy them to production, we need to be able to run multiple versions of our application in the same Kubernetes cluster.
Configure dynamic environments for non-production deployments
Use a unique naming convention for our Kubernetes resources
Create a feature branch change and use GitLab CI Review Apps to test it
Integration tests have external service dependencies like databases that we need to have available during the build.
Declare a database service in our test job
Pass environment variables to our database service
Configure a service alias and use it to access the database from our test
Some security testing can only be accomplished when our application is deployed. We can use GitLab Review Apps to perform dynamic security scanning.
Add a security scanning job for feature branches
Create a feature branch and merge request
Use the security scan detailed report and summary
To monitor our application, we need it to continually produce metrics that can be collected by a monitoring application.
Add a Prometheus client library to our Node.js application
Configure a metrics endpoint that reports current data
Run our application and see the raw metrics from the endpoint
Prometheus is a popular monitoring application that integrates well with Kubernetes. GitLab can install it into our Kubernetes cluster automatically.
Configure our application’s service for scraping by Prometheus
Deploy our application and observe its metrics in the Prometheus dashboard
See application metrics from Prometheus right in our GitLab project website
To have proper control over our custom CI infrastructure, we need deployment automation so we can create CI infrastructure automatically.
Provision virtual machines in AWS using Ansible
Install and configure GitLab Runner automatically using Ansible
Use our new runner to run a build in our GitLab CI project
To support many projects and builds in our custom CI infrastructure, we need a way to scale runners up or down automatically.
Use Ansible to provision a Docker Machine runner
Configure our Docker Machine runner with AWS credentials
Run a build and observe our build environment scale to execute it
To fully move to custom CI infrastructure, we need to run our own instance of GitLab Server.
Install and configure GitLab Server using Ansible
Configure Ansible variables to allow a dedicated runner to attach to our GitLab server
Install and configure GitLab Runner using Ansible and see it in our private GitLab server
- Basic familiarity with version control in Git will help
Developing modern software requires an automated pipeline that builds, tests, and deploys your application, complete with its required infrastructure. GitLab is a Git-based version control server, available at gitlab .com or as a private server. GitLab CI provides automated builds and deployments right from within GitLab. With GitLab CI, it is easy to add build and deployment automation that triggers on every code change, helping you build high-quality, reliable software and deploy it to production at speed. This course will give you a hands-on tutorial on GitLab CI. You will use GitLab CI to create a DevOps pipeline to automatically build, test, and deploy software to virtual machines and container environments.
You will explore the features of GitLab CI, including using runners to execute build jobs, creating multi-stage builds, and deploying to virtualized and containerized environments. You will see how easy it is to get started with GitLab CI by deploying your own runners in cloud environments or on your own servers, using Docker and Kubernetes or ordinary scripting.
By the end of this course, you'll be ready to use GitLab CI for your own applications to automate your build and deployment pipelines.
About the Author
Alan Hohn is a Lockheed Martin Fellow who specializes in DevOps, microservice architecture, and agile. He is experienced at deploying and configuring GitLab CI and in helping teams take advantage of its ability to automate application builds, tests, and deployments. He has extensive experience teaching technical topics and loves to combine examples and explanation to make any technology clearer.