2019-12-13 09:48:00 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
################################################################################
|
|
|
|
|
## File: basic.sh
|
|
|
|
|
## Desc: Installs basic command line utilities and dev packages
|
|
|
|
|
################################################################################
|
|
|
|
|
|
2020-09-08 14:40:56 +03:00
|
|
|
set -e
|
2019-12-13 09:48:00 -05:00
|
|
|
# Source the helpers for use with the script
|
|
|
|
|
source $HELPER_SCRIPTS/document.sh
|
2020-07-09 21:22:33 +03:00
|
|
|
|
2020-09-08 19:09:31 +03:00
|
|
|
toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json"
|
|
|
|
|
common_packages=$(jq -r ".apt.common_packages[]" $toolset)
|
|
|
|
|
cmd_packages=$(jq -r ".apt.cmd_packages[]" $toolset)
|
2020-06-17 11:43:03 +00:00
|
|
|
for package in $common_packages $cmd_packages; do
|
|
|
|
|
echo "Install $package"
|
|
|
|
|
apt-get install -y --no-install-recommends $package
|
|
|
|
|
done
|
2020-05-06 08:51:47 +03:00
|
|
|
|
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"
|
2020-06-17 11:43:03 +00:00
|
|
|
for cmd in $cmd_packages; do
|
2019-12-13 09:48:00 -05:00
|
|
|
if ! command -v $cmd; then
|
|
|
|
|
echo "$cmd was not installed"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# Document what was added to the image
|
|
|
|
|
echo "Lastly, documenting what we added to the metadata file"
|
2020-06-17 11:43:03 +00:00
|
|
|
DocumentInstalledItem "Basic packages:"
|
|
|
|
|
for package in $common_packages $cmd_packages; do
|
|
|
|
|
DocumentInstalledItemIndent $package
|
|
|
|
|
done
|