Files
runner-images/images/linux/scripts/installers/preimagedata.sh
T

36 lines
1.2 KiB
Bash
Raw Normal View History

2020-10-07 13:49:40 +05:00
#!/bin/bash -e
2020-03-08 17:41:55 +03:00
imagedata_file=$IMAGEDATA_FILE
image_version=$IMAGE_VERSION
os_name=$(lsb_release -ds | sed "s/ /\\\n/g")
image_label="ubuntu-$(lsb_release -rs)"
github_url="https://github.com/actions/virtual-environments/blob"
+13
2020-05-26 18:45:48 +03:00
if [[ "$image_label" =~ "ubuntu-20" ]]; then
software_url="${github_url}/ubuntu20/${image_version}/images/linux/Ubuntu2004-README.md"
2021-03-18 09:42:04 +03:00
releaseUrl="https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F${image_version}"
+13
2020-05-26 18:45:48 +03:00
fi
2020-03-08 17:41:55 +03:00
if [[ "$image_label" =~ "ubuntu-18" ]]; then
software_url="${github_url}/ubuntu18/${image_version}/images/linux/Ubuntu1804-README.md"
2021-03-18 09:42:04 +03:00
releaseUrl="https://github.com/actions/virtual-environments/releases/tag/ubuntu18%2F${image_version}"
2020-03-08 17:41:55 +03:00
fi
if [[ "$image_label" =~ "ubuntu-16" ]]; then
software_url="${github_url}/ubuntu16/${image_version}/images/linux/Ubuntu1604-README.md"
2021-03-18 09:42:04 +03:00
releaseUrl="https://github.com/actions/virtual-environments/releases/tag/ubuntu16%2F${image_version}"
2020-03-08 17:41:55 +03:00
fi
cat <<EOF > $imagedata_file
[
{
"group": "Operating System",
"detail": "${os_name}"
},
{
"group": "Virtual Environment",
2021-02-25 14:22:57 +03:00
"detail": "Environment: ${image_label}\nVersion: ${image_version}\nIncluded Software: ${software_url}\nImage Release: ${releaseUrl}"
2020-03-08 17:41:55 +03:00
}
]
2020-10-07 13:49:40 +05:00
EOF