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")
|
2022-05-19 23:47:48 +04:00
|
|
|
os_version=$(lsb_release -rs)
|
|
|
|
|
image_label="ubuntu-${os_version}"
|
|
|
|
|
version_major=${os_version/.*/}
|
|
|
|
|
version_wo_dot=${os_version/./}
|
2020-03-08 17:41:55 +03:00
|
|
|
github_url="https://github.com/actions/virtual-environments/blob"
|
|
|
|
|
|
2022-05-19 23:47:48 +04:00
|
|
|
software_url="${github_url}/ubuntu${version_major}/${image_version}/images/linux/Ubuntu${version_wo_dot}-Readme.md"
|
|
|
|
|
releaseUrl="https://github.com/actions/virtual-environments/releases/tag/ubuntu${version_major}%2F${image_version}"
|
2020-03-08 17:41:55 +03:00
|
|
|
|
|
|
|
|
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
|