Skip to content

Commit

Permalink
properly loop
Browse files Browse the repository at this point in the history
  • Loading branch information
AlisonB319 committed Nov 8, 2024
1 parent e33937b commit a6c3cf5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .pipelines/.vsts-vhd-builder-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1342,13 +1342,15 @@ stages:
directory_contents=$(ls -l $(Pipeline.Workspace)/)
echo "$directory_contents"
for dir in "$(Pipeline.Workspace)"/*; do
for dir in $(Pipeline.Workspace)/*; do
if [ -d "$dir" ]; then
echo "Processing directory: $dir"
# Check if the directory name is not a publishing-info directory
if [[ $(basename "$dir") != publishing-info-* ]]; then
echo "Directory $(basename "$dir") is not a publishing-info directory"
# Check if the vhd-publishing-info.json file exists in this directory
if [ -f "$dir/vhd-publishing-info.json" ]; then
echo "Found vhd-publishing-info.json in $dir"
cp "$dir/vhd-publishing-info.json" "$(Pipeline.Workspace)/consolidated-artifacts/vhd-publishing-info-$(basename "$dir").json"
Expand Down
13 changes: 13 additions & 0 deletions vulnerability-reporting-vms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ For the purpose of this project, the pipeline will use the vhd-publishing-info.j
2. Loops throught the artifacts and copies vhd_publishing_info.json files into a new folder
3. Calls our vulnerability-reporting-vms code using the folder of vhd-publishing-info.json files.

The downloaded file looks like this in ADO

```
/mnt/vss/_work/1/azurelinuxv2-gen1:
bcc-tools-installation.log
image-bom.json
release-notes.txt
vhd-publishing-info.json
```

where `/mnt/vss/_work/1/` is `$(Pipeline.Workspace)`


The `Create_Vulnerability_Reporting_VMs` step should be disabled in *[TEST All VHDs] AKS Linux VHD Build - Msft Tenant* and enabled in *AKS Linux VHD Build - Weekly Release Only*

## Testing
Expand Down

0 comments on commit a6c3cf5

Please sign in to comment.