2019-12-13 09:48:00 -05:00
#!/bin/bash
################################################################################
## File: cmake.sh
## Desc: Installs Mono
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS /document.sh
LSB_CODENAME = $( lsb_release -cs)
# Test to see if the software in question is already installed, if not install it
# wget "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" -O out && sudo apt-key add out && rm out
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable- $LSB_CODENAME main" | tee /etc/apt/sources.list.d/mono-official-stable.list
apt-get update
2020-08-28 08:25:01 +01:00
apt-get install -y --no-install-recommends apt-transport-https mono-complete nuget
2019-12-13 09:48:00 -05:00
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v mono; then
echo "mono was not installed"
exit 1
fi
2020-08-28 08:25:01 +01:00
if ! command -v nuget; then
echo "nuget was not installed"
exit 1
fi
2019-12-13 09:48:00 -05:00
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "Mono ( $( mono --version | head -n 1) )"
2020-08-28 08:25:01 +01:00
DocumentInstalledItem "NuGet ( $( nuget | tail -n +1 | head -n 1) )" # Pipe to tail before piping to head because NuGet prints an ugly error if you close its stream before it's done writing.