In this challenge we will:
- Install a Jenkins from Helm Chart
- Build the images from GitHub repo.
- Push the images to Docker Hub.
- Execute YAML deployment files in the K8S cluster from the Jenkins pipeline.
-
fork git repo
https://github.com/torosent/stickerstore.git
-
Create a new "Freestyle Project"
- Fill in the GitHub URL (https://github.com//stickerstore) in the GitHub project tab and the git URL(https://github.com/torosent/stickerstore.git) in the "Source Code Management"
- Create a build step "Docker Build and Publish"
- Enter the repo name and tag
- Add your Docker Hub credentials by clicking on "Add" in "Registry Credentials
- Modify the "Build Context" in the "Advanced" section to the relevant service folder.
- Modify the "Dockerfile path" in the "Advanced" section to the relevant service folder dockerfile. For example: "Dockerfile"
- Add more "Build steps" for each service. You can test is by clicking "Build Now" and checking the Jenkins console for the result.
- Add "Build step" - > "Azure Container Service"
- Add "Azure Credentials" (Service Principal)
- Select your K8S container service.
- Add your K8S SSH private key
- Define the service YAML file. You can include multiple YAML files in the "Config Files" section
- Check the K8S cluster