Using Pull Requests For Release Gating

45 minutes
  • 5 Learning Objectives

About this Hands-on Lab

A part of developing your GitOps skillset, this lab introduces the student to GitHub Actions Workflow and challenges the student to build and push a container to Docker Hub. The application container may then be deployed to Kubernetes Clusters through Flux and the Deployment YAML required.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Fork the linuxacademycontent/gitops Repo in GitHub

Use your personal account to fork the course repo into your own GitHub Account.

Create a Docker Hub Folder to Receive the Pushed Container Images

Set up a folder for the container images in Docker Hub.

Enable Actions WorkFlows In The Forked Repository

Go the to Actions tab and enable workflows.

NOTE: You will also need to add a secret to the repo for the Docker Hub Password. Use Settings and Secrets to add the password so the docker login in the workflow will push the image to your dockerhub registry.

Edit the Workflow to Push Your Container Images to Your Docker Hub Registry

Edit the workflow provided with your Docker Hub information.

1) You must add a DOCKERPW secret to your repo with the docker hub password for your dockerhub account.
This is done in GitHub under Settings->Secrets

2) You will need to edit the actions workflow to replace the [your docerhub userneme] clause with your actual dockerhub username.

This configure the actions workflow to push the container image to your docker hub registery.

You can test this on a push, command by just changing the python program a bit and watching the actions workflow run.

Once you have the workflow running, you can then edit the workflow to run for a pull request instead of a push.

Change the event that fires the workflow from push to pull_request.

Change The Python Application And Open A Pull Request

Create a feature branch. Change the Python application, then commit the change. Then create a pull request and merge the change in. Examine the workflow actions run afterward and verify the container was pushed to the Docker Hub Registry.

Additional Resources

The student will need their own GitHub and Docker Hub Account to complete this lab.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?