in vhdbuilder/release-notes/autonotes/main.go [187:221]
func getReleaseNotesWindows(sku, path string, fl *flags) error {
releaseNotesName := fmt.Sprintf("vhd-release-notes-%s", sku)
imageListName := fmt.Sprintf("vhd-image-list-%s", sku)
artifactsDirOut := filepath.Join(fl.path, path)
parentDirectory := filepath.Dir(artifactsDirOut)
fmt.Printf("\n")
fmt.Printf("Creating parent directory for sku'%s': '%s'\n", sku, parentDirectory)
if err := os.MkdirAll(parentDirectory, 0644); err != nil {
return fmt.Errorf("failed to create parent directory %s with error: %s", artifactsDirOut, err)
}
fmt.Printf("Creating directory for sku '%s': '%s'\n", sku, artifactsDirOut)
if err := os.MkdirAll(artifactsDirOut, 0644); err != nil {
return fmt.Errorf("failed to create directory %s with error: %s", artifactsDirOut, err)
}
fmt.Printf("downloading releaseNotes '%s' from windows build '%s'\n", releaseNotesName, fl.build)
cmd := exec.Command("az", "pipelines", "runs", "artifact", "download", "--run-id", fl.build, "--path", artifactsDirOut, "--artifact-name", releaseNotesName)
if stdout, err := cmd.CombinedOutput(); err != nil {
fmt.Printf("Failed downloading releaseNotes '%s' from windows build '%s'\n", releaseNotesName, fl.build)
return fmt.Errorf("failed to download az devops releaseNotes for sku %s, err: %s, output: %s", sku, err, string(stdout))
}
fmt.Printf("downloading imageList '%s' from build '%s'\n", imageListName, fl.build)
cmd = exec.Command("az", "pipelines", "runs", "artifact", "download", "--run-id", fl.build, "--path", artifactsDirOut, "--artifact-name", imageListName)
if stdout, err := cmd.CombinedOutput(); err != nil {
fmt.Printf("failed downloading imageList '%s' from windows build '%s'\n", imageListName, fl.build)
return fmt.Errorf("failed to download az devops imageList for sku %s, err: %s, output: %s", sku, err, string(stdout))
}
return nil
}