From 1e7984b74c48ff6b88250684957eeba76fb2bbde Mon Sep 17 00:00:00 2001 From: "venkeyboda07@gmail.com" Date: Fri, 7 Feb 2025 10:37:41 +0530 Subject: [PATCH] added variables --- azure-pipelines.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 529d865df..844661e5a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,6 +3,10 @@ pool: Default pr: - develop +variables: + dockerImagerepo: 'venkeyboda/spc' + dockerImagetag: '$(Build.BuildId)' + stages: - stage: CI jobs: @@ -32,15 +36,15 @@ stages: inputs: command: 'build' Dockerfile: './Dockerfile' - repository: venkeyboda/spring-petclinic + repository: $(dockerImagerepo) tags: | - '$(Build.BuildId)' + $(dockerImagetag) - task: CmdLine@2 displayName: 'scannig image ' inputs: script: | - trivy image $('venkeyboda/spring-petclinic'):'$(Build.BuildId)' -o trivy-report.xml + trivy image $(dockerImagerepo):$(dockerImagetag) -o trivy-report.xml - task: PublishPipelineArtifact@1 displayName: 'Publish Trivy Report' @@ -52,7 +56,8 @@ stages: displayName: 'pushing the docker image' inputs: command: 'push' - containerRegistry: 'docker hub' - repository: venkeyboda/spring-petclinic + containerRegistry: 'DOCKER_HUB' + repository: $(dockerImagerepo) tags: | - '$(Build.BuildId)' \ No newline at end of file + $(dockerImagetag) + \ No newline at end of file