Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Automating DevOps with GitLab CI/CD Pipelines

You're reading from  Automating DevOps with GitLab CI/CD Pipelines

Product type Book
Published in Feb 2023
Publisher Packt
ISBN-13 9781803233000
Pages 348 pages
Edition 1st Edition
Languages
Concepts
Authors (3):
Christopher Cowell Christopher Cowell
Profile icon Christopher Cowell
Nicholas Lotz Nicholas Lotz
Profile icon Nicholas Lotz
Chris Timberlake Chris Timberlake
Profile icon Chris Timberlake
View More author details

Table of Contents (18) Chapters

Preface 1. Part 1 Getting Started with DevOps, Git, and GitLab
2. Chapter 1: Understanding Life Before DevOps 3. Chapter 2: Practicing Basic Git Commands 4. Chapter 3: Understanding GitLab Components 5. Chapter 4: Understanding GitLab’s CI/CD Pipeline Structure 6. Part 2 Automating DevOps Stages with GitLab CI/CD Pipelines
7. Chapter 5: Installing and Configuring GitLab Runners 8. Chapter 6: Verifying Your Code 9. Chapter 7: Securing Your Code 10. Chapter 8: Packaging and Deploying Code 11. Part 3 Next Steps for Improving Your Applications with GitLab
12. Chapter 9: Enhancing the Speed and Maintainability of CI/CD Pipelines 13. Chapter 10: Extending the Reach of CI/CD Pipelines 14. Chapter 11: End-to-End Example 15. Chapter 12: Troubleshooting and the Road Ahead with GitLab 16. Index 17. Other Books You May Enjoy

Delivering your code to the right environment

Your code is written, verified, and secured. The only step left is to deploy it.

Deploying the code

The final task of our pipeline is to deploy the Hats for Cats code to the right environment. Normally, we’d define separate jobs to deploy code to a review environment, the pre-production environment, or the production environment. Then, we would use GitLab’s rules: and if: keywords to control which one of those three jobs should run, depending on which Git branch the pipeline was running on.

To keep things simple in this example, let’s just walk through how to deploy it to the production environment. We’ll imagine that we want this to happen whenever we run the pipeline on the production branch.

As you learned in Chapter 8, there are countless techniques you can use to deploy code. Which technique you choose depends largely on what sort of environment you’re deploying to: an AWS EC2 VM, a Kubernetes...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $19.99/month. Cancel anytime}