# Create a folder for all Repos we are going to create
mkdir azure-devops-aks-demo-repos
cd azure-devops-aks-demo-repos
# Create a Directory for Repo
mkdir azure-devops-github-acr-aks-app1
cd azure-devops-github-acr-aks-app1
Copy all files from Giti-Repository-files folder to our new repo folder azure-devops-github-acr-aks-app1
# Initialize Git Repo
cd azure-devops-github-acr-aks-app1
git init
# Do local Commit
echo "# Azure DevOps App1 Demo with AKS, Github and ACR" >> README.md
git add .
git commit -am "V1 Base Commit"
# Link Github Remote Repository
git remote add origin https://github.com/stacksimplify/azure-devops-github-acr-aks-app1.git
# Push to Remote Repository
git push --set-upstream origin master
# Go to Github Repo - Refresh and check files appeared in githbu repo
https://github.com/stacksimplify/azure-devops-github-acr-aks-app1
Step-10: Make changes to index.html and push changes to git repo - V2 Commit¶
# Pull changes related to pipeline to local repo
git pull
ls -lrt
# Make changes to index.html
index.html file - change version v2
# Push changes
git add .
git commit -am "V2 Commit for index.html"
git push
- Verify Build logs - Verify ACR Image
Step-12: Add Namespace for Docker Images stored in ACR¶
Go to Pipeline -> 01-Docker-Build-and-Push-to-ACR -> Edit
Step-13: Make changes to index.html and push changes to git repo - V3 Commit¶
# Pull changes related to pipeline to local repo
git pull
ls -lrt
# Make changes to index.html
index.html file - change version v3
# Push changes
git add .
git commit -am "V3 Commit for index.html"
git push
# Docker# Build and push an image to Azure Container Registry# https://docs.microsoft.com/azure/devops/pipelines/languages/dockertrigger:-masterresources:-repo:selfvariables:# Container registry service connection established during pipeline creationdockerRegistryServiceConnection:'6a8843fd-7313-48e2-9381-3f9ef59ce82d'## Review Service ConnectionsimageRepository:'app1/app1nginx'containerRegistry:'aksdevopsacr.azurecr.io'dockerfilePath:'$(Build.SourcesDirectory)/Dockerfile'tag:'$(Build.BuildId)'# Agent VM image namevmImageName:'ubuntu-latest'stages:-stage:BuilddisplayName:Build and push stagejobs:-job:BuilddisplayName:Buildpool:vmImage:$(vmImageName)steps:-task:Docker@2displayName:Build and push an image to container registryinputs:command:buildAndPushrepository:$(imageRepository)dockerfile:$(dockerfilePath)containerRegistry:$(dockerRegistryServiceConnection)tags:|$(tag)