From e21529e2a2a8c21a8444b4ab8cbee944b864fcc6 Mon Sep 17 00:00:00 2001 From: "shamrao shinde, sumedh" Date: Fri, 6 Dec 2024 10:27:43 +0000 Subject: [PATCH] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ac0020e..84df0f6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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: 'apollo/pom.xml' goals: 'install -DskipTests' @@ -67,6 +68,13 @@ 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: apollo/manifests # artifact: manifests @@ -96,22 +104,16 @@ stages: displayName: 'Set Short Commit SHA' - script: | - echo $(shortCommitSha) - echo "Updating imageName in deployment.yaml" - displayName: 'Update ImageName in YAML file' + echo "########################################################################" + 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-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) \ No newline at end of file