skip to Main Content

I have a Black Duck scan which is not working as advertised.
I contacted the Synposys people and they requested I enable diagnostics mode for the scan task and I provide the genrated zip file tothem for analysis.
But… the scan pipeline runs on VS 2022 Agent pool. What this means is that everything is deleted at the end of the pipeline run.
So, to get the actual file and move it to a safe location before the Docker container is destroyed and all data lost, I added a Publish Artifact task that would get the file and make a backup.
Only problem is, the name of the file contains a Timestamp.
For example:
detect-run-2023-12-14-05-24-41-962.zip -> yyyy-MM-dd-hh-mm-ss-SSS
In order to fix this, I was advised to set the Artifact name of the Publish Artifact task to <detect*.zip>
But this will make the task throw exception:
##[error]Artifact name is not valid: detect*.zip. It cannot contain ”, /’, "’, ‘:’, ‘<‘, ‘>’, ‘|’, ‘*’, and ‘?’
Is it even possible to get that generated file name from some pipeline variable ?
Any reply is appreciated
Thank you

2

Answers


  1. Chosen as BEST ANSWER

    My bad, the artifact name was the name of the resulting archive. The path to the file was set in the "File or directory path" textbox. After changing the "Artifact name" to something like "Log files" it works perfectly.


  2. I don’t have Black Duck, so I can’t test your issue.
    However, I think the following solution might be good for your problem.

    You can try to upload the relevant file(s) to a blob storage in the last step with an Azure CLI step.

    Something like this:

    $today = Get-Date -Format "yyyyMMdd"
    az storage blob upload-batch --destination $containerName/$today --account-name $storageAccountName --source '$(System.DefaultWorkingDirectory)/your/path/to/file(s)' --pattern '*.zip'
    

    When I use terraform, I save the tfplan file in a similar way to a blob before the agent destroys itself.

    Before the agent destroys itself, you can do almost everything in the agent filesystem with powershell, bash etc.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search