Update azure-pipelines.yml for Azure Pipelines

This commit is contained in:
shamrao shinde, sumedh
2024-12-06 12:05:51 +00:00
parent a6b42c7ac7
commit 0a0b08b0bb

View File

@@ -34,16 +34,17 @@ stages:
- script: |
echo "Building the first repository..."
pwd
ls -lrth
displayName: 'list files'
- task: Maven@3
- task: Maven@4
inputs:
mavenPomFile: 'olympus-common/pom.xml'
goals: 'install'
displayName: 'Build olympus-common'
- task: Maven@3
- task: Maven@4
inputs:
mavenPomFile: 'hermione/pom.xml'
goals: 'install -DskipTests'
@@ -68,8 +69,15 @@ stages:
docker images
displayName: 'List docker images'
- upload: hermione/manifests
artifact: manifests
- script: |
echo "Removing Docker images to clean up..."
docker rmi $(docker images -q)
displayName: 'Clean up Docker Images'
continueOnError: true
condition: always()
#- upload: hermione/manifests
# artifact: manifests
- stage: Deploy
displayName: Deploy stage
@@ -88,6 +96,7 @@ stages:
runOnce:
deploy:
steps:
- checkout: self
- script: |
echo "##vso[task.setvariable variable=shortCommitSha]$(echo $(Build.SourceVersion) | cut -c1-8)"
displayName: 'Set Short Commit SHA'
@@ -97,18 +106,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/hermione-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)