From 957a0b91cc1969e9400ffdefedf117d7baa420cd Mon Sep 17 00:00:00 2001 From: acarriedev Date: Wed, 19 Apr 2023 16:05:46 +0100 Subject: [PATCH 1/3] APM-4219 Sort by latest to bring back artifact by time --- azure/components/set-facts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure/components/set-facts.yml b/azure/components/set-facts.yml index af13de45f..9434b8d20 100644 --- a/azure/components/set-facts.yml +++ b/azure/components/set-facts.yml @@ -21,7 +21,7 @@ steps: set -euo pipefail echo "!!! If you get an error here, it is because '${{ parameters.service_name }}' is not the source alias name of the artifact" ls -R $(Pipeline.Workspace) - export SERVICE_ARTIFACT_NAME=`ls $(Pipeline.Workspace)/s/${{ parameters.service_name }}` + export SERVICE_ARTIFACT_NAME=`ls -t $(Pipeline.Workspace)/s/${{ parameters.service_name }}` echo "##vso[task.setvariable variable=SERVICE_ARTIFACT_NAME]$SERVICE_ARTIFACT_NAME" echo "Set Artifact Name of: $SERVICE_ARTIFACT_NAME" displayName: 'Set SERVICE_ARTIFACT_NAME' From 91680861a191459b90035ae8064cd3a24f09a366 Mon Sep 17 00:00:00 2001 From: acarriedev Date: Wed, 19 Apr 2023 16:17:45 +0100 Subject: [PATCH 2/3] APM-4219 Leave comment for reasoning --- azure/components/set-facts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure/components/set-facts.yml b/azure/components/set-facts.yml index 9434b8d20..4ba09c466 100644 --- a/azure/components/set-facts.yml +++ b/azure/components/set-facts.yml @@ -19,7 +19,7 @@ parameters: steps: - bash: | set -euo pipefail - echo "!!! If you get an error here, it is because '${{ parameters.service_name }}' is not the source alias name of the artifact" + echo "!!! ls picks the latest file for the artifact. If you get an error here, it is because '${{ parameters.service_name }}' is not the source alias name of the artifact" ls -R $(Pipeline.Workspace) export SERVICE_ARTIFACT_NAME=`ls -t $(Pipeline.Workspace)/s/${{ parameters.service_name }}` echo "##vso[task.setvariable variable=SERVICE_ARTIFACT_NAME]$SERVICE_ARTIFACT_NAME" From 0beb74c10c7328889ee6fd58ef2e27d399113348 Mon Sep 17 00:00:00 2001 From: acarriedev Date: Wed, 19 Apr 2023 16:18:56 +0100 Subject: [PATCH 3/3] APM-4219 Improve wording --- azure/components/set-facts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure/components/set-facts.yml b/azure/components/set-facts.yml index 4ba09c466..b85aec827 100644 --- a/azure/components/set-facts.yml +++ b/azure/components/set-facts.yml @@ -19,7 +19,7 @@ parameters: steps: - bash: | set -euo pipefail - echo "!!! ls picks the latest file for the artifact. If you get an error here, it is because '${{ parameters.service_name }}' is not the source alias name of the artifact" + echo "!!! Using ls -t will set the latest file for the artifact. If you get an error here, it is because '${{ parameters.service_name }}' is not the source alias name of the artifact" ls -R $(Pipeline.Workspace) export SERVICE_ARTIFACT_NAME=`ls -t $(Pipeline.Workspace)/s/${{ parameters.service_name }}` echo "##vso[task.setvariable variable=SERVICE_ARTIFACT_NAME]$SERVICE_ARTIFACT_NAME"