From b7c69ef560089ddee2c51edf001df115c5eaec4c Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Tue, 28 Jul 2020 10:18:33 +0000 Subject: [PATCH] Add announcements to software documentation (#1285) * Add Windows announcements * Minor fix * Add Ubuntu announcements * Minor fix * Add announcements to win16 template * Cleanup announcement files * Rename announcements files --- images/linux/announcements.md | 0 images/linux/scripts/installers/preparemetadata.sh | 4 ++++ images/linux/ubuntu1604.json | 5 +++++ images/linux/ubuntu1804.json | 5 +++++ images/linux/ubuntu2004.json | 5 +++++ images/win/Windows2016-Azure.json | 5 +++++ images/win/Windows2019-Azure.json | 5 +++++ images/win/announcements.md | 0 .../win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 | 4 ++++ 9 files changed, 33 insertions(+) create mode 100644 images/linux/announcements.md create mode 100644 images/win/announcements.md diff --git a/images/linux/announcements.md b/images/linux/announcements.md new file mode 100644 index 00000000..e69de29b diff --git a/images/linux/scripts/installers/preparemetadata.sh b/images/linux/scripts/installers/preparemetadata.sh index a26e1096..3feee857 100644 --- a/images/linux/scripts/installers/preparemetadata.sh +++ b/images/linux/scripts/installers/preparemetadata.sh @@ -8,6 +8,10 @@ source $HELPER_SCRIPTS/document.sh WriteItem "" + +Announcements=$(cat $HELPER_SCRIPTS/announcements.md) +WriteItem $Announcements + AddTitle "$(lsb_release -ds)" WriteItem "The following software is installed on machines with the $IMAGE_VERSION update." WriteItem "***" diff --git a/images/linux/ubuntu1604.json b/images/linux/ubuntu1604.json index ae036bdf..c1bc2660 100644 --- a/images/linux/ubuntu1604.json +++ b/images/linux/ubuntu1604.json @@ -86,6 +86,11 @@ "source": "{{template_dir}}/scripts/helpers", "destination": "{{user `helper_script_folder`}}" }, + { + "type": "file", + "source": "{{template_dir}}/announcements.md", + "destination": "{{user `helper_script_folder`}}/announcements.md" + }, { "type": "file", "source": "{{template_dir}}/scripts/installers", diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index 9302e5cb..7b743516 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -89,6 +89,11 @@ "source": "{{template_dir}}/scripts/helpers", "destination": "{{user `helper_script_folder`}}" }, + { + "type": "file", + "source": "{{template_dir}}/announcements.md", + "destination": "{{user `helper_script_folder`}}/announcements.md" + }, { "type": "file", "source": "{{template_dir}}/scripts/installers", diff --git a/images/linux/ubuntu2004.json b/images/linux/ubuntu2004.json index 73ef44df..b83236a1 100644 --- a/images/linux/ubuntu2004.json +++ b/images/linux/ubuntu2004.json @@ -91,6 +91,11 @@ "source": "{{template_dir}}/scripts/helpers", "destination": "{{user `helper_script_folder`}}" }, + { + "type": "file", + "source": "{{template_dir}}/announcements.md", + "destination": "{{user `helper_script_folder`}}/announcements.md" + }, { "type": "file", "source": "{{template_dir}}/scripts/installers", diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 0b2bcae2..922e1204 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -84,6 +84,11 @@ "source": "{{ template_dir }}/scripts/SoftwareReport", "destination": "{{user `image_folder`}}" }, + { + "type": "file", + "source": "{{ template_dir }}/announcements.md", + "destination": "{{user `image_folder`}}/SoftwareReport/announcements.md" + }, { "type": "file", "source": "{{ template_dir }}/scripts/Tests", diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index 700280b1..431d1af2 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -84,6 +84,11 @@ "source": "{{ template_dir }}/scripts/SoftwareReport", "destination": "{{user `image_folder`}}" }, + { + "type": "file", + "source": "{{ template_dir }}/announcements.md", + "destination": "{{user `image_folder`}}/SoftwareReport/announcements.md" + }, { "type": "file", "source": "{{ template_dir }}/scripts/Tests", diff --git a/images/win/announcements.md b/images/win/announcements.md new file mode 100644 index 00000000..e69de29b diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 771bb3b7..49f15be6 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -10,6 +10,10 @@ Import-Module (Join-Path $PSScriptRoot "SoftwareReport.VisualStudio.psm1") -Disa $markdown = "" +$Announcements = Get-Content -Path $(Join-Path $PSScriptRoot "announcements.md") -Raw +$markdown += $Announcements +$markdown += New-MDNewLine + $OSName = Get-OSName $markdown += New-MDHeader "$OSName" -Level 1