diff --git a/images/linux/scripts/installers/7-zip.sh b/images/linux/scripts/installers/7-zip.sh index 357bd905b..44e0b2843 100644 --- a/images/linux/scripts/installers/7-zip.sh +++ b/images/linux/scripts/installers/7-zip.sh @@ -4,7 +4,6 @@ ## Desc: Installs 7-zip ################################################################################ - # Install 7-Zip apt-get update -y apt-get install -y p7zip p7zip-full p7zip-rar diff --git a/images/linux/scripts/installers/aliyun-cli.sh b/images/linux/scripts/installers/aliyun-cli.sh index e322e6874..251834ec6 100644 --- a/images/linux/scripts/installers/aliyun-cli.sh +++ b/images/linux/scripts/installers/aliyun-cli.sh @@ -4,7 +4,6 @@ ## Desc: Installs Alibaba Cloud CLI ################################################################################ - # Install Alibaba Cloud CLI URL=$(curl -s https://api.github.com/repos/aliyun/aliyun-cli/releases/latest | jq -r '.assets[].browser_download_url | select(contains("aliyun-cli-linux"))') wget -P /tmp $URL diff --git a/images/linux/scripts/installers/aws-sam-cli.sh b/images/linux/scripts/installers/aws-sam-cli.sh index d134f3099..b6947ce2a 100644 --- a/images/linux/scripts/installers/aws-sam-cli.sh +++ b/images/linux/scripts/installers/aws-sam-cli.sh @@ -5,7 +5,6 @@ ## Requires Python >=3.6, must be run as non-root user after toolset installation ################################################################################ - # Download latest aws sam cli sources TarballUrl=$(curl -s https://api.github.com/repos/aws/aws-sam-cli/releases/latest | jq -r '.tarball_url') TarballPath="/tmp/aws-sam-cli.tar.gz" diff --git a/images/linux/scripts/installers/azcopy.sh b/images/linux/scripts/installers/azcopy.sh index 0e6ccd533..58dfdf658 100644 --- a/images/linux/scripts/installers/azcopy.sh +++ b/images/linux/scripts/installers/azcopy.sh @@ -4,7 +4,6 @@ ## Desc: Installs AzCopy ################################################################################ - # Install AzCopy7 wget -O azcopy.tar.gz https://aka.ms/downloadazcopylinux64 tar -xf azcopy.tar.gz diff --git a/images/linux/scripts/installers/azure-cli.sh b/images/linux/scripts/installers/azure-cli.sh index c666eff5b..bd321ee15 100644 --- a/images/linux/scripts/installers/azure-cli.sh +++ b/images/linux/scripts/installers/azure-cli.sh @@ -4,7 +4,6 @@ ## Desc: Installed Azure CLI (az) ################################################################################ - # Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash diff --git a/images/linux/scripts/installers/azure-devops-cli.sh b/images/linux/scripts/installers/azure-devops-cli.sh index a4dd672f5..b7a3f5295 100644 --- a/images/linux/scripts/installers/azure-devops-cli.sh +++ b/images/linux/scripts/installers/azure-devops-cli.sh @@ -4,7 +4,6 @@ ## Desc: Installed Azure DevOps CLI (az devops) ################################################################################ - # AZURE_EXTENSION_DIR shell variable defines where modules are installed # https://docs.microsoft.com/en-us/cli/azure/azure-cli-extensions-overview export AZURE_EXTENSION_DIR=/opt/az/azcliextensions diff --git a/images/linux/scripts/installers/bazel.sh b/images/linux/scripts/installers/bazel.sh index 4cba7bed7..4158861c8 100644 --- a/images/linux/scripts/installers/bazel.sh +++ b/images/linux/scripts/installers/bazel.sh @@ -4,7 +4,6 @@ ## Desc: Installs Bazel and Bazelisk (A user-friendly launcher for Bazel) ################################################################################ - # Install bazel curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add - echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list diff --git a/images/linux/scripts/installers/cmake.sh b/images/linux/scripts/installers/cmake.sh index 7b2e86c0b..7be3b52a0 100644 --- a/images/linux/scripts/installers/cmake.sh +++ b/images/linux/scripts/installers/cmake.sh @@ -4,7 +4,6 @@ ## Desc: Installs CMake ################################################################################ - # Test to see if the software in question is already installed, if not install it echo "Checking to see if the installer script has already been run" if command -v cmake; then diff --git a/images/linux/scripts/installers/containers.sh b/images/linux/scripts/installers/containers.sh index d13a3f349..ea18f32ff 100644 --- a/images/linux/scripts/installers/containers.sh +++ b/images/linux/scripts/installers/containers.sh @@ -4,6 +4,8 @@ ## Desc: Installs container tools: podman, buildah and skopeo onto the image ################################################################################ +source $HELPER_SCRIPTS/os.sh + # Install podman, buildah, scopeo container's tools install_packages=(podman buildah skopeo) source /etc/os-release @@ -15,11 +17,6 @@ apt-get -qq -y install ${install_packages[@]} mkdir -p /etc/containers echo -e "[registries.search]\nregistries = ['docker.io', 'quay.io']" | tee /etc/containers/registries.conf -# Check that tools are installed properly -echo "Testing to make sure that script performed as expected, and basic scenarios work" -for cmd in ${install_packages[@]}; do - if ! command -v $cmd; then - echo "$cmd was not installed" - exit 1 - fi -done +if isUbuntu18 || isUbuntu20 ; then + invoke_tests "Tools" "Containers" +fi \ No newline at end of file diff --git a/images/linux/scripts/installers/docker-compose.sh b/images/linux/scripts/installers/docker-compose.sh index 1ae8225e7..5a407cdd2 100644 --- a/images/linux/scripts/installers/docker-compose.sh +++ b/images/linux/scripts/installers/docker-compose.sh @@ -4,7 +4,6 @@ ## Desc: Installs Docker Compose ################################################################################ - # Install latest docker-compose from releases URL=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.assets[].browser_download_url | select(contains("docker-compose-Linux-x86_64"))' | head -1) curl -L $URL -o /usr/local/bin/docker-compose diff --git a/images/linux/scripts/installers/erlang.sh b/images/linux/scripts/installers/erlang.sh index c3f60856f..458f7fa00 100644 --- a/images/linux/scripts/installers/erlang.sh +++ b/images/linux/scripts/installers/erlang.sh @@ -4,7 +4,6 @@ ## Desc: Installs erlang ################################################################################ - source_list=/etc/apt/sources.list.d/eslerlang.list # Install Erlang diff --git a/images/linux/scripts/installers/github-cli.sh b/images/linux/scripts/installers/github-cli.sh index 02eef665c..baa614bcc 100644 --- a/images/linux/scripts/installers/github-cli.sh +++ b/images/linux/scripts/installers/github-cli.sh @@ -5,7 +5,6 @@ ## Must be run as non-root user after homebrew ################################################################################ - # Install GitHub CLI url=$(curl -s https://api.github.com/repos/cli/cli/releases/latest | jq -r '.assets[].browser_download_url|select(contains("linux") and contains("amd64") and contains(".deb"))') wget $url diff --git a/images/linux/scripts/installers/google-chrome.sh b/images/linux/scripts/installers/google-chrome.sh index 6d1170551..37a4af56f 100644 --- a/images/linux/scripts/installers/google-chrome.sh +++ b/images/linux/scripts/installers/google-chrome.sh @@ -4,7 +4,6 @@ ## Desc: Installs google-chrome and chromedriver ################################################################################ - LSB_RELEASE=$(lsb_release -rs) wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - diff --git a/images/linux/scripts/installers/google-cloud-sdk.sh b/images/linux/scripts/installers/google-cloud-sdk.sh index 6c8390edc..c0ea469a2 100644 --- a/images/linux/scripts/installers/google-cloud-sdk.sh +++ b/images/linux/scripts/installers/google-cloud-sdk.sh @@ -4,7 +4,6 @@ ## Desc: Installs the Google Cloud SDK ################################################################################ - # Install the Google Cloud SDK echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - diff --git a/images/linux/scripts/installers/heroku.sh b/images/linux/scripts/installers/heroku.sh index e720e0f8f..2c8862092 100644 --- a/images/linux/scripts/installers/heroku.sh +++ b/images/linux/scripts/installers/heroku.sh @@ -4,7 +4,6 @@ ## Desc: Installs Heroku CLI ################################################################################ - # Install Heroku CLI curl https://cli-assets.heroku.com/install-ubuntu.sh | sh diff --git a/images/linux/scripts/installers/hhvm.sh b/images/linux/scripts/installers/hhvm.sh index 27e3aab14..988233102 100644 --- a/images/linux/scripts/installers/hhvm.sh +++ b/images/linux/scripts/installers/hhvm.sh @@ -4,7 +4,6 @@ ## Desc: Installs hhvm ################################################################################ - apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94 add-apt-repository https://dl.hhvm.com/ubuntu apt-get update diff --git a/images/linux/scripts/installers/julia.sh b/images/linux/scripts/installers/julia.sh index c947ce7b3..5ac91dda7 100644 --- a/images/linux/scripts/installers/julia.sh +++ b/images/linux/scripts/installers/julia.sh @@ -4,7 +4,6 @@ ## Desc: Installs Julia, and adds Julia to the path ################################################################################ - # This function fetches the latest Julia release from the GitHub API # Based on https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c function GetLatestJuliaRelease () { diff --git a/images/linux/scripts/installers/kubernetes-tools.sh b/images/linux/scripts/installers/kubernetes-tools.sh index 0a3a8d789..6bafaab5f 100644 --- a/images/linux/scripts/installers/kubernetes-tools.sh +++ b/images/linux/scripts/installers/kubernetes-tools.sh @@ -4,7 +4,6 @@ ## Desc: Installs kubectl, helm, kustomize ################################################################################ - # Install KIND URL=$(curl -s https://api.github.com/repos/kubernetes-sigs/kind/releases/latest | jq -r '.assets[].browser_download_url | select(contains("kind-linux-amd64"))') curl -L -o /usr/local/bin/kind $URL diff --git a/images/linux/scripts/installers/leiningen.sh b/images/linux/scripts/installers/leiningen.sh index 87a5059a9..045ada42d 100644 --- a/images/linux/scripts/installers/leiningen.sh +++ b/images/linux/scripts/installers/leiningen.sh @@ -4,7 +4,6 @@ ## Desc: Installs Leiningen ################################################################################ - LEIN_BIN=/usr/local/bin/lein curl -s https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > $LEIN_BIN chmod 0755 $LEIN_BIN diff --git a/images/linux/scripts/installers/mercurial.sh b/images/linux/scripts/installers/mercurial.sh index 9024803f7..e785dba0b 100644 --- a/images/linux/scripts/installers/mercurial.sh +++ b/images/linux/scripts/installers/mercurial.sh @@ -4,7 +4,6 @@ ## Desc: Installs Mercurial ################################################################################ - # Source the helpers for use with the script source $HELPER_SCRIPTS/os.sh diff --git a/images/linux/scripts/installers/miniconda.sh b/images/linux/scripts/installers/miniconda.sh index 7a3c3c99d..02a370b2c 100644 --- a/images/linux/scripts/installers/miniconda.sh +++ b/images/linux/scripts/installers/miniconda.sh @@ -4,7 +4,6 @@ ## Desc: Installs miniconda ################################################################################ - # Install Miniconda curl -sL https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh \ && chmod +x miniconda.sh \ diff --git a/images/linux/scripts/installers/mono.sh b/images/linux/scripts/installers/mono.sh index 5e1dc48d4..4025c1c33 100644 --- a/images/linux/scripts/installers/mono.sh +++ b/images/linux/scripts/installers/mono.sh @@ -4,7 +4,6 @@ ## Desc: Installs Mono ################################################################################ - LSB_CODENAME=$(lsb_release -cs) # Test to see if the software in question is already installed, if not install it diff --git a/images/linux/scripts/installers/mssql-cmd-tools.sh b/images/linux/scripts/installers/mssql-cmd-tools.sh index 25a864672..092023e9c 100644 --- a/images/linux/scripts/installers/mssql-cmd-tools.sh +++ b/images/linux/scripts/installers/mssql-cmd-tools.sh @@ -4,7 +4,6 @@ ## Desc: Install MS SQL Server client tools (https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools?view=sql-server-2017) ################################################################################ - export ACCEPT_EULA=Y apt-get update diff --git a/images/linux/scripts/installers/netlify.sh b/images/linux/scripts/installers/netlify.sh index d939b2709..609a6a2e5 100644 --- a/images/linux/scripts/installers/netlify.sh +++ b/images/linux/scripts/installers/netlify.sh @@ -4,7 +4,6 @@ ## Desc: Installs the Netlify CLI ################################################################################ - # Install the Netlify CLI npm i -g netlify-cli diff --git a/images/linux/scripts/installers/nodejs.sh b/images/linux/scripts/installers/nodejs.sh index e0bb6981c..be1b60ecb 100644 --- a/images/linux/scripts/installers/nodejs.sh +++ b/images/linux/scripts/installers/nodejs.sh @@ -20,11 +20,4 @@ apt-get update # Install yarn apt-get install -y --no-install-recommends yarn -# Run tests to determine that the software installed as expected -echo "Testing to make sure that script performed as expected, and basic scenarios work" -for cmd in node grunt gulp webpack parcel yarn newman; do - if ! command -v $cmd; then - echo "$cmd was not installed" - exit 1 - fi -done +invoke_tests "Tools" "Node.js" diff --git a/images/linux/scripts/installers/nvm.sh b/images/linux/scripts/installers/nvm.sh index b0d995138..36b5e7916 100644 --- a/images/linux/scripts/installers/nvm.sh +++ b/images/linux/scripts/installers/nvm.sh @@ -12,10 +12,7 @@ echo 'export NVM_DIR=$HOME/.nvm' | tee -a /etc/skel/.bash_profile echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | tee -a /etc/skel/.bash_profile [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" -if ! command -v nvm; then - echo "nvm was not installed" - exit 1 -fi +invoke_tests "Tools" "nvm" # set system node.js as default one nvm alias default system diff --git a/images/linux/scripts/installers/packer.sh b/images/linux/scripts/installers/packer.sh index b4ab06bf1..6cf7d0eef 100644 --- a/images/linux/scripts/installers/packer.sh +++ b/images/linux/scripts/installers/packer.sh @@ -4,7 +4,6 @@ ## Desc: Installs packer ################################################################################ - # Install Packer PACKER_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/packer | jq -r .current_version) curl -LO "https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip" diff --git a/images/linux/scripts/installers/phantomjs.sh b/images/linux/scripts/installers/phantomjs.sh index c9764413e..5eb4b291d 100644 --- a/images/linux/scripts/installers/phantomjs.sh +++ b/images/linux/scripts/installers/phantomjs.sh @@ -4,7 +4,6 @@ ## Desc: Installs PhantomJS ################################################################################ - # Install PhantomJS apt-get install -y chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev PHANTOM_JS=phantomjs-2.1.1-linux-x86_64 diff --git a/images/linux/scripts/installers/pipx-packages.sh b/images/linux/scripts/installers/pipx-packages.sh index a44a887d3..447c29390 100644 --- a/images/linux/scripts/installers/pipx-packages.sh +++ b/images/linux/scripts/installers/pipx-packages.sh @@ -4,7 +4,6 @@ ## Desc: Install tools via pipx ################################################################################ - export PATH="$PATH:/opt/pipx_bin" toolset="$INSTALLER_SCRIPT_FOLDER/toolset.json" diff --git a/images/linux/scripts/installers/pollinate.sh b/images/linux/scripts/installers/pollinate.sh index 29699faca..d74f9263f 100644 --- a/images/linux/scripts/installers/pollinate.sh +++ b/images/linux/scripts/installers/pollinate.sh @@ -4,7 +4,6 @@ ## Desc: Installs Pollinate ################################################################################ - # Install Pollinate apt-get install -y --no-install-recommends pollinate diff --git a/images/linux/scripts/installers/powershellcore.sh b/images/linux/scripts/installers/powershellcore.sh index a827f4a8e..fa319c40c 100644 --- a/images/linux/scripts/installers/powershellcore.sh +++ b/images/linux/scripts/installers/powershellcore.sh @@ -5,11 +5,4 @@ ################################################################################ # Install Powershell -apt-get install -y powershell - -# 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 pwsh; then - echo "pwsh was not installed" - exit 1 -fi +apt-get install -y powershell \ No newline at end of file diff --git a/images/linux/scripts/installers/python.sh b/images/linux/scripts/installers/python.sh index 8993e1d3a..b794ea870 100644 --- a/images/linux/scripts/installers/python.sh +++ b/images/linux/scripts/installers/python.sh @@ -40,11 +40,4 @@ if isUbuntu18 || isUbuntu20 ; then fi fi -# Run tests to determine that the software installed as expected -echo "Testing to make sure that script performed as expected, and basic scenarios work" -for cmd in python pip python3 pip3; do - if ! command -v $cmd; then - echo "$cmd was not installed or not found on PATH" - exit 1 - fi -done +invoke_tests "Tools" "Python" diff --git a/images/linux/scripts/installers/rndgenerator.sh b/images/linux/scripts/installers/rndgenerator.sh index 63a5d06ad..9a3dbf75e 100644 --- a/images/linux/scripts/installers/rndgenerator.sh +++ b/images/linux/scripts/installers/rndgenerator.sh @@ -4,7 +4,6 @@ ## Desc: Install random number generator ################################################################################ - # Install haveged apt-get -y install haveged diff --git a/images/linux/scripts/installers/sbt.sh b/images/linux/scripts/installers/sbt.sh index 9cb4b65f4..dd04f72a5 100644 --- a/images/linux/scripts/installers/sbt.sh +++ b/images/linux/scripts/installers/sbt.sh @@ -4,7 +4,6 @@ ## Desc: Installs sbt ################################################################################ - # Install sbt # https://www.scala-sbt.org/1.x/docs/Installing-sbt-on-Linux.html echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list diff --git a/images/linux/scripts/installers/selenium.sh b/images/linux/scripts/installers/selenium.sh index 4ce3fa24f..55d436a53 100644 --- a/images/linux/scripts/installers/selenium.sh +++ b/images/linux/scripts/installers/selenium.sh @@ -4,7 +4,6 @@ ## Desc: Installs selenium server ################################################################################ - # Determine latest selenium standalone server version SELENIUM_LATEST_VERSION_URL=https://api.github.com/repos/SeleniumHQ/selenium/releases/latest SELENIUM_VERSION=$(curl $SELENIUM_LATEST_VERSION_URL | jq '.name' | tr -d '"' | cut -d ' ' -f 2) diff --git a/images/linux/scripts/installers/subversion.sh b/images/linux/scripts/installers/subversion.sh index 5156b5306..0a781acdf 100644 --- a/images/linux/scripts/installers/subversion.sh +++ b/images/linux/scripts/installers/subversion.sh @@ -4,7 +4,6 @@ ## Desc: Installs Subversion client ################################################################################ - # Install Subversion apt-get install -y --no-install-recommends subversion diff --git a/images/linux/scripts/installers/swig.sh b/images/linux/scripts/installers/swig.sh index 893720fa5..219ec3ad3 100644 --- a/images/linux/scripts/installers/swig.sh +++ b/images/linux/scripts/installers/swig.sh @@ -1,6 +1,5 @@ #!/bin/bash -e - # Install Swig sudo apt-get install -y swig diff --git a/images/linux/scripts/installers/terraform.sh b/images/linux/scripts/installers/terraform.sh index febf3baa1..f84474e63 100644 --- a/images/linux/scripts/installers/terraform.sh +++ b/images/linux/scripts/installers/terraform.sh @@ -4,7 +4,6 @@ ## Desc: Installs terraform ################################################################################ - # Install Terraform TERRAFORM_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r .current_version) curl -LO "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" diff --git a/images/linux/scripts/installers/vercel.sh b/images/linux/scripts/installers/vercel.sh index a4f0a8c94..595b89b3a 100644 --- a/images/linux/scripts/installers/vercel.sh +++ b/images/linux/scripts/installers/vercel.sh @@ -4,7 +4,6 @@ ## Desc: Installs the Vercel CLI ################################################################################ - # Install the Vercel CLI npm i -g vercel diff --git a/images/linux/scripts/tests/Tools.Tests.ps1 b/images/linux/scripts/tests/Tools.Tests.ps1 index e29d8458e..ae9b27527 100644 --- a/images/linux/scripts/tests/Tools.Tests.ps1 +++ b/images/linux/scripts/tests/Tools.Tests.ps1 @@ -83,16 +83,6 @@ Describe "Docker-compose" { } } -Describe "PowerShell Core" { - It "pwsh" { - "pwsh --version" | Should -ReturnZeroExitCode - } - - It "Execute 2+2 command" { - pwsh -Command "2+2" | Should -BeExactly 4 - } -} - Describe "Ansible" { It "Ansible" { "ansible --version" | Should -ReturnZeroExitCode @@ -344,3 +334,45 @@ Describe "Haveged" { "systemctl status haveged | grep 'active (running)'" | Should -ReturnZeroExitCode } } + +Describe "Containers" -Skip:(Test-IsUbuntu16) { + $testCases = @("podman", "buildah", "skopeo") | ForEach-Object { @{ContainerCommand = $_} } + + It "" -TestCases $testCases { + param ( + [string] $ContainerCommand + ) + + "$ContainerCommand -v" | Should -ReturnZeroExitCode + } +} + +Describe "Node.js" { + $testCases = @("node", "grunt", "gulp", "webpack", "parcel", "yarn", "newman") | ForEach-Object { @{NodeCommand = $_} } + + It "" -TestCases $testCases { + param ( + [string] $NodeCommand + ) + + "$NodeCommand --version" | Should -ReturnZeroExitCode + } +} + +Describe "nvm" { + It "nvm" { + "source /etc/skel/.nvm/nvm.sh && nvm --version" | Should -ReturnZeroExitCode + } +} + +Describe "Python" { + $testCases = @("python", "pip", "python3", "pip3") | ForEach-Object { @{PythonCommand = $_} } + + It "" -TestCases $testCases { + param ( + [string] $PythonCommand + ) + + "$PythonCommand --version" | Should -ReturnZeroExitCode + } +} \ No newline at end of file