From eb294f6c4a4d8d5182908e91c6683b93d50ef74d Mon Sep 17 00:00:00 2001 From: "shamrao shinde, sumedh" Date: Fri, 6 Dec 2024 11:24:29 +0000 Subject: [PATCH] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 05e14b6..3d4275c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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() \ No newline at end of file + $(azurecontainerRegistry)/$(imageName):$(shortCommitSha) \ No newline at end of file