Update azure-pipelines.yml for Azure Pipelines

This commit is contained in:
shamrao shinde, sumedh
2024-12-06 11:24:29 +00:00
parent 086e139da6
commit eb294f6c4a

View File

@@ -58,9 +58,16 @@ stages:
echo "Listing the docker images..."
docker images
displayName: 'List docker images'
- script: |
echo "Removing Docker images to clean up..."
docker rmi $(docker images -q)
displayName: 'Clean up Docker Images'
continueOnError: true
condition: always()
- upload: manifests
artifact: manifests
#- upload: manifests
# artifact: manifests
- stage: Deploy
displayName: Deploy stage
@@ -79,6 +86,8 @@ stages:
runOnce:
deploy:
steps:
- checkout: self # Check out the pipeline repository (optional)
- script: |
echo "##vso[task.setvariable variable=shortCommitSha]$(echo $(Build.SourceVersion) | cut -c1-8)"
displayName: 'Set Short Commit SHA'
@@ -88,18 +97,12 @@ stages:
echo "Short Commit SHA: $(shortCommitSha)"
displayName: 'Echo short commit SHA'
- task: KubernetesManifest@0
- task: KubernetesManifest@1
displayName: Deploy to Kubernetes cluster
inputs:
action: deploy
namespace: olympus
manifests: |
$(Pipeline.Workspace)/manifests/apollo-fe-deployment.yaml
containers: |
$(azurecontainerRegistry)/$(imageName):$(shortCommitSha)
- script: |
echo "Removing Docker images to clean up..."
docker rmi $(docker images -q)
displayName: 'Clean up Docker Images'
continueOnError: true
condition: always()
$(azurecontainerRegistry)/$(imageName):$(shortCommitSha)