[ubuntu] Rename build scripts (#8866)

* [ubuntu] Rename build scripts

* [ubuntu] Change reboot to inline shell

* [ubuntu] Move disk space validation to pester tests

* [ubuntu] Rename helper and tests files

* [ubuntu] Changes to cleanup, post-deployment and r scripts
This commit is contained in:
Shamil Mubarakshin
2023-11-22 21:49:23 +01:00
committed by GitHub
parent 410fd620be
commit 1bd9214f41
101 changed files with 422 additions and 483 deletions

View File

@@ -4,7 +4,7 @@
## Desc: Configure toolset
################################################################################
Import-Module "$env:HELPER_SCRIPTS/Tests.Helpers.psm1" -DisableNameChecking
Import-Module "$env:HELPER_SCRIPTS/../tests/Helpers.psm1" -DisableNameChecking
function Get-ToolsetToolFullPath
{

View File

@@ -1,7 +1,12 @@
################################################################################
## File: Install-PowerShellAzModules.ps1
## Desc: Install Az modules for PowerShell
################################################################################
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
Import-Module "$env:HELPER_SCRIPTS/Tests.Helpers.psm1" -DisableNameChecking
Import-Module "$env:HELPER_SCRIPTS/../tests/Helpers.psm1" -DisableNameChecking
# Get modules content from toolset
$modules = (Get-ToolsetContent).azureModules

View File

@@ -1,7 +1,12 @@
################################################################################
## File: Install-PowerShellModules.ps1
## Desc: Install modules for PowerShell
################################################################################
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
Import-Module "$env:HELPER_SCRIPTS/Tests.Helpers.psm1" -DisableNameChecking
Import-Module "$env:HELPER_SCRIPTS/../tests/Helpers.psm1" -DisableNameChecking
# Specifies the installation policy
Set-PSRepository -InstallationPolicy Trusted -Name PSGallery

View File

@@ -1,7 +0,0 @@
#!/bin/bash -e
prefix=/usr/local/bin
for tool in apt apt-get apt-fast apt-key;do
sudo rm -f $prefix/$tool
done

View File

@@ -1,4 +1,8 @@
#!/bin/bash -e
################################################################################
## File: cleanup.sh
## Desc: Perform cleanup
################################################################################
# before cleanup
before=$(df / -Pm | awk 'NR==2{print $4}')
@@ -31,4 +35,11 @@ after=$(df / -Pm | awk 'NR==2{print $4}')
echo "Delta : $(($after-$before)) MB"
# delete symlink for tests running
rm -f /usr/local/bin/invoke_tests
rm -f /usr/local/bin/invoke_tests
# remove apt mock
prefix=/usr/local/bin
for tool in apt apt-get apt-fast apt-key;do
sudo rm -f $prefix/$tool
done

View File

@@ -1,12 +0,0 @@
#!/bin/bash -e
################################################################################
## File: snap-environment.sh
## Desc: Update /etc/environment to include /snap/bin in PATH
## because /etc/profile.d is ignored by `--norc` shell launch option
################################################################################
# Source the helpers
source $HELPER_SCRIPTS/etc-environment.sh
# Update /etc/environemnt
prependEtcEnvironmentPath "/snap/bin"

View File

@@ -1,6 +1,9 @@
#!/bin/bash -e
# A temporary workaround for https://github.com/Azure/azure-linux-extensions/issues/1238
################################################################################
## File: configure-apt-mock.sh
## Desc: A temporary workaround for https://github.com/Azure/azure-linux-extensions/issues/1238.
## Cleaned up during configure-cleanup.sh.
################################################################################
prefix=/usr/local/bin

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: apt-ubuntu-archive.sh
## Desc: Script for configuring apt sources. https://manpages.ubuntu.com/manpages/jammy/en/man1/apt-transport-mirror.1.html
## File: configure-apt-sources.sh
## Desc: Configure apt sources with failover from Azure to Ubuntu archives.
################################################################################
touch /etc/apt/apt-mirrors.txt
@@ -12,4 +12,4 @@ printf "http://security.ubuntu.com/ubuntu/\tpriority:3\n" | tee -a /etc/apt/apt-
sed -i 's/http:\/\/azure.archive.ubuntu.com\/ubuntu\//mirror+file:\/etc\/apt\/apt-mirrors.txt/' /etc/apt/sources.list
cp -f /etc/apt/sources.list /etc/cloud/templates/sources.list.ubuntu.tmpl
cp -f /etc/apt/sources.list /etc/cloud/templates/sources.list.ubuntu.tmpl

View File

@@ -1,4 +1,8 @@
#!/bin/bash -e
################################################################################
## File: configure-apt.sh
## Desc: Configure apt, install jq and apt-fast packages.
################################################################################
# Stop and disable apt-daily upgrade services;
systemctl stop apt-daily.timer

View File

@@ -1,4 +1,8 @@
#!/bin/bash -e
################################################################################
## File: configure-dpkg.sh
## Desc: Configure dpkg
################################################################################
# This is the anti-frontend. It never interacts with you at all,
# and makes the default answers be used for all questions. It

View File

@@ -1,4 +1,8 @@
#!/bin/bash -e
################################################################################
## File: configure-environment.sh
## Desc: Configure system and environment
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/os.sh

View File

@@ -1,4 +1,8 @@
#!/bin/bash -e
################################################################################
## File: configure-image-data.sh
## Desc: Create a file with image data and documentation links
################################################################################
imagedata_file=$IMAGEDATA_FILE
image_version=$IMAGE_VERSION

View File

@@ -1,4 +1,8 @@
#!/bin/bash -e
################################################################################
## File: configure-limits.sh
## Desc: Configure limits
################################################################################
echo 'session required pam_limits.so' >> /etc/pam.d/common-session
echo 'session required pam_limits.so' >> /etc/pam.d/common-session-noninteractive

View File

@@ -1,4 +1,15 @@
#!/bin/bash -e
################################################################################
## File: configure-snap.sh
## Desc: Configure snap
################################################################################
source $HELPER_SCRIPTS/etc-environment.sh
# Update /etc/environment to include /snap/bin in PATH
# because /etc/profile.d is ignored by `--norc` shell launch option
prependEtcEnvironmentPath "/snap/bin"
# Put snapd auto refresh on hold
# as it may generate too much traffic on Canonical's snap server

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: post-deployment.sh
## Desc: Post deployment actions
## File: configure-system.sh
## Desc: Post deployment system configuration actions
################################################################################
mv -f /imagegeneration/post-generation /opt
@@ -20,7 +20,7 @@ ENVPATH=${ENVPATH%"\""}
echo "PATH=$ENVPATH" | sudo tee -a /etc/environment
echo "Updated /etc/environment: $(cat /etc/environment)"
# Clean yarn and npm cache
# Сlean yarn and npm cache
if yarn --version > /dev/null
then
yarn cache clean

View File

@@ -1,23 +0,0 @@
#!/bin/bash -e
################################################################################
## File: example.sh
## Desc: This is an example script that can be copied to add a new software
## installer to the image
################################################################################
# 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 [ -z $EXAMPLE_VAR ]; then
$EXAMPLE_VAR=1.0.0
else
echo "Example variable already set to $EXAMPLE_VAR"
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"
if [ -z $EXAMPLE_VAR ]; then
echo "EXAMPLE_VAR variable was not set as expected"
exit 1
else
echo "EXAMPLE_VAR was set properly"
fi

View File

@@ -1,8 +1,7 @@
#!/bin/bash -e
################################################################################
## File: action-archive-cache.sh
## Desc: Download latest release from https://github.com/actions/action-verions
## and un-tar to /opt/actionarchivecache
## File: install-actions-cache.sh
## Desc: Download latest release from https://github.com/actions/action-versions
## Maintainer: #actions-runtime and @TingluoHuang
################################################################################

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: aliyun-cli.sh
## Desc: Installs Alibaba Cloud CLI
## File: install-aliyun-cli.sh
## Desc: Install Alibaba Cloud CLI
## Supply chain security: Alibaba Cloud CLI - checksum validation
################################################################################

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: android.sh
## Desc: Installs Android SDK
## File: install-android-sdk.sh
## Desc: Install Android SDK and tools
################################################################################
# Source the helpers for use with the script

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: apache.sh
## Desc: Installs Apache HTTP Server
## File: install-apache.sh
## Desc: Install Apache HTTP Server
################################################################################
# Install Apache

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: apt-common.sh
## Desc: Installs basic command line utilities and dev packages
## File: install-apt-common.sh
## Desc: Install basic command line utilities and dev packages
################################################################################
source $HELPER_SCRIPTS/install.sh
@@ -12,4 +12,4 @@ for package in $common_packages $cmd_packages; do
apt-get install -y --no-install-recommends $package
done
invoke_tests "Apt"
invoke_tests "Apt"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: apt-vital.sh
## Desc: Installs vital command line utilities
## File: install-apt-vital.sh
## Desc: Install vital command line utilities
################################################################################
source $HELPER_SCRIPTS/install.sh

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: aws.sh
## Desc: Installs the AWS CLI, Session Manager plugin for the AWS CLI, and AWS SAM CLI
## File: install-aws-tools.sh
## Desc: Install the AWS CLI, Session Manager plugin for the AWS CLI, and AWS SAM CLI
## Supply chain security: AWS SAM CLI - checksum validation
################################################################################

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: azcopy.sh
## Desc: Installs AzCopy
## File: install-azcopy.sh
## Desc: Install AzCopy
################################################################################
source $HELPER_SCRIPTS/install.sh
@@ -14,4 +14,4 @@ chmod +x /usr/local/bin/azcopy
# Create azcopy 10 alias for backward compatibility
ln -sf /usr/local/bin/azcopy /usr/local/bin/azcopy10
invoke_tests "Tools" "azcopy"
invoke_tests "Tools" "azcopy"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: azure-cli.sh
## Desc: Installed Azure CLI (az)
## File: install-azure-cli.sh
## Desc: Install Azure CLI (az)
################################################################################
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: azure-devops-cli.sh
## Desc: Installed Azure DevOps CLI (az devops)
## File: install-azure-devops-cli.sh
## Desc: Install Azure DevOps CLI (az devops)
################################################################################
# AZURE_EXTENSION_DIR shell variable defines where modules are installed
@@ -12,4 +12,4 @@ echo "AZURE_EXTENSION_DIR=$AZURE_EXTENSION_DIR" | tee -a /etc/environment
# install azure devops Cli extension
az extension add -n azure-devops
invoke_tests "CLI.Tools" "Azure DevOps CLI"
invoke_tests "CLI.Tools" "Azure DevOps CLI"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: bazel.sh
## Desc: Installs Bazel and Bazelisk (A user-friendly launcher for Bazel)
## File: install-bazel.sh
## Desc: Install Bazel and Bazelisk (A user-friendly launcher for Bazel)
################################################################################
source $HELPER_SCRIPTS/install.sh

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: bicep.sh
## Desc: Installs bicep cli
## File: install-bicep.sh
## Desc: Install bicep cli
################################################################################
source $HELPER_SCRIPTS/install.sh
@@ -13,4 +13,4 @@ chmod +x ./bicep.bin
# Add bicep to PATH (requires admin)
sudo mv ./bicep.bin /usr/local/bin/bicep
invoke_tests "Tools" "Bicep"
invoke_tests "Tools" "Bicep"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: clang.sh
## Desc: Installs Clang compiler
## File: install-clang.sh
## Desc: Install Clang compiler
################################################################################
# Source the helpers for use with the script

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: cmake.sh
## Desc: Installs CMake
## File: install-cmake.sh
## Desc: Install CMake
## Supply chain security: CMake - checksum validation
################################################################################

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: codeql-bundle.sh
## Desc: Install the CodeQL CLI Bundle to the toolcache.
## File: install-codeql-bundle.sh
## Desc: Install CodeQL CLI Bundle to the toolcache.
################################################################################
source $HELPER_SCRIPTS/install.sh

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: containers.sh
## Desc: Installs container tools: podman, buildah and skopeo onto the image
## File: install-container-tools.sh
## Desc: Install container tools: podman, buildah and skopeo onto the image
################################################################################
source $HELPER_SCRIPTS/os.sh

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: docker-compose.sh
## Desc: Installs Docker Compose v1
## File: install-docker-compose.sh
## Desc: Install Docker Compose v1
## Supply chain security: Docker Compose v1 - checksum validation
################################################################################

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: docker.sh
## Desc: Installs docker onto the image
## File: install-docker.sh
## Desc: Install docker onto the image
## Supply chain security: Docker Compose v2, amazon-ecr-credential-helper - checksum validation
################################################################################

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: dotnetcore-sdk.sh
## Desc: Installs .NET Core SDK
## File: install-dotnetcore-sdk.sh
## Desc: Install .NET Core SDK
################################################################################
source $HELPER_SCRIPTS/etc-environment.sh

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: erlang.sh
## Desc: Installs erlang
## File: install-erlang.sh
## Desc: Install erlang and rebar3
################################################################################
# Source the helpers for use with the script

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: firefox.sh
## Desc: Installs Firefox
## File: install-firefox.sh
## Desc: Install Firefox
################################################################################
# Source the helpers for use with the script

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: gcc.sh
## Desc: Installs GNU C++
## File: install-gcc-compilers.sh
## Desc: Install GNU C++ compilers
################################################################################
# Source the helpers for use with the script
@@ -25,4 +25,4 @@ for version in ${versions[*]}; do
InstallGcc $version
done
invoke_tests "Tools" "gcc"
invoke_tests "Tools" "gcc"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: gfortran.sh
## Desc: Installs GNU Fortran
## File: install-gfortran.sh
## Desc: Install GNU Fortran
################################################################################
source $HELPER_SCRIPTS/install.sh
source $HELPER_SCRIPTS/os.sh
@@ -24,4 +24,4 @@ do
InstallFortran $version
done
invoke_tests "Tools" "gfortran"
invoke_tests "Tools" "gfortran"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: git-lfs.sh
## Desc: Installs Git-lfs
## File: install-git-lfs.sh
## Desc: Install Git-lfs
################################################################################
# Source the helpers for use with the script

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: git.sh
## Desc: Installs Git
## File: install-git.sh
## Desc: Install Git and Git-FTP
################################################################################
# Source the helpers for use with the script

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: github-cli.sh
## Desc: Installs GitHub CLI
## File: install-github-cli.sh
## Desc: Install GitHub CLI
## Must be run as non-root user after homebrew
## Supply chain security: GitHub CLI - checksum validation
################################################################################

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: google-chrome.sh
## Desc: Installs google-chrome, chromedriver and chromium
## File: install-google-chrome.sh
## Desc: Install google-chrome, chromedriver and chromium
################################################################################
# Source the helpers for use with the script
@@ -83,4 +83,4 @@ ln -s $CHROMIUM_BIN /usr/bin/chromium
ln -s $CHROMIUM_BIN /usr/bin/chromium-browser
invoke_tests "Browsers" "Chrome"
invoke_tests "Browsers" "Chromium"
invoke_tests "Browsers" "Chromium"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: google-cloud-cli.sh
## Desc: Installs the Google Cloud CLI
## File: install-google-cloud-cli.sh
## Desc: Install the Google Cloud CLI
################################################################################
REPO_URL="https://packages.cloud.google.com/apt"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: haskell.sh
## Desc: Installs Haskell
## File: install-haskell.sh
## Desc: Install Haskell, GHCup, Cabal and Stack
################################################################################
# Source the helpers for use with the script

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: heroku.sh
## Desc: This script installs Heroku CLI. Based on instructions found here: https://devcenter.heroku.com/articles/heroku-cli
## File: install-heroku.sh
## Desc: Install Heroku CLI. Based on instructions found here: https://devcenter.heroku.com/articles/heroku-cli
################################################################################
## Install Heroku CLI

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: hhvm.sh
## Desc: Installs hhvm
## File: install-hhvm.sh
## Desc: Install HHVM
################################################################################
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: homebrew.sh
## Desc: Installs the Homebrew on Linux
## File: install-homebrew.sh
## Desc: Install Homebrew on Linux
## Caveat: Brew MUST NOT be used to install any tool during the image build to avoid dependencies, which may come along with the tool
################################################################################

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: java-tools.sh
## Desc: Installs Java and related tooling (Ant, Gradle, Maven)
## File: install-java-tools.sh
## Desc: Install Java and related tooling (Ant, Gradle, Maven)
################################################################################
source $HELPER_SCRIPTS/install.sh

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: julia.sh
## Desc: Installs Julia, and adds Julia to the path
## File: install-julia.sh
## Desc: Install Julia and add to the path
################################################################################
# Source the helpers for use with the script

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: kotlin.sh
## Desc: Installs Kotlin
## File: install-kotlin.sh
## Desc: Install Kotlin
## Supply chain security: Kotlin - checksum validation
################################################################################

View File

@@ -1,6 +1,6 @@
#!/bin/bash -e
################################################################################
## File: kubernetes-tools.sh
## File: install-kubernetes-tools.sh
## Desc: Installs kubectl, helm, kustomize
## Supply chain security: KIND, minikube - checksum validation
################################################################################

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: leiningen.sh
## Desc: Installs Leiningen
## File: install-leiningen.sh
## Desc: Install Leiningen
################################################################################
LEIN_BIN=/usr/local/bin/lein
@@ -16,4 +16,4 @@ LEIN_JAR=$(find $LEIN_HOME -name "leiningen-*-standalone.jar")
echo "LEIN_JAR=$LEIN_JAR" | tee -a /etc/environment
echo "LEIN_HOME=$LEIN_HOME" | tee -a /etc/environment
invoke_tests "Tools" "Leiningen"
invoke_tests "Tools" "Leiningen"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: microsoft-edge.sh
## Desc: Installs Microsoft Edge
## File: install-microsoft-edge.sh
## Desc: Install Microsoft Edge and WebDriver
################################################################################
source $HELPER_SCRIPTS/install.sh

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: miniconda.sh
## Desc: Installs miniconda
## File: install-miniconda.sh
## Desc: Install miniconda
################################################################################
# Install Miniconda
@@ -15,4 +15,4 @@ echo "CONDA=$CONDA" | tee -a /etc/environment
ln -s $CONDA/bin/conda /usr/bin/conda
invoke_tests "Tools" "Conda"
invoke_tests "Tools" "Conda"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: mongodb.sh
## Desc: Installs Mongo DB
## File: install-mongodb.sh
## Desc: Install Mongo DB
################################################################################
# Source the helpers

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: mono.sh
## Desc: Installs Mono
## File: install-mono.sh
## Desc: Install Mono
################################################################################
source $HELPER_SCRIPTS/os.sh

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: repos.sh
## Desc: Installs official Microsoft package repos for the distribution
## File: install-ms-repos.sh
## Desc: Install official Microsoft package repos for the distribution
################################################################################
LSB_RELEASE=$(lsb_release -rs)

View File

@@ -1,6 +1,6 @@
#!/bin/bash -e
################################################################################
## File: mssql-cmd-tools.sh
## File: install-mssql-tools.sh
## Desc: Install MS SQL Server client tools (https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-setup-tools?view=sql-server-2017)
################################################################################
@@ -11,4 +11,4 @@ apt-get install -y mssql-tools unixodbc-dev
apt-get -f install
ln -s /opt/mssql-tools/bin/* /usr/local/bin/
invoke_tests "Tools" "MSSQLCommandLineTools"
invoke_tests "Tools" "MSSQLCommandLineTools"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: mysql.sh
## Desc: Installs MySQL Client
## File: install-mysql.sh
## Desc: Install MySQL Client
################################################################################
source $HELPER_SCRIPTS/os.sh

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: nginx.sh
## Desc: Installs Nginx
## File: install-nginx.sh
## Desc: Install Nginx
################################################################################
# Install Nginx

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: nodejs.sh
## Desc: Installs Node.js LTS and related tooling (Gulp, Grunt)
## File: install-nodejs.sh
## Desc: Install Node.js LTS and related tooling (Gulp, Grunt)
################################################################################
# Source the helpers for use with the script

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: nvm.sh
## Desc: Installs Nvm
## File: install-nvm.sh
## Desc: Install Nvm
################################################################################
export NVM_DIR="/etc/skel/.nvm"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: oc.sh
## Desc: Installs the OC CLI
## File: install-oc-cli.sh
## Desc: Install the OC CLI
################################################################################
source $HELPER_SCRIPTS/install.sh
@@ -12,4 +12,4 @@ PACKAGE_TAR_NAME="oc.tar.gz"
download_with_retries $DOWNLOAD_URL "/tmp" $PACKAGE_TAR_NAME
tar xzf "/tmp/$PACKAGE_TAR_NAME" -C "/usr/local/bin" oc
invoke_tests "CLI.Tools" "OC CLI"
invoke_tests "CLI.Tools" "OC CLI"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: oras-cli.sh
## Desc: Installs ORAS CLI
## File: install-oras-cli.sh
## Desc: Install ORAS CLI
## Supply chain security: ORAS CLI - checksum validation
################################################################################

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: packer.sh
## Desc: Installs packer
## File: install-packer.sh
## Desc: Install packer
################################################################################
source $HELPER_SCRIPTS/install.sh
@@ -13,4 +13,4 @@ download_with_retries "${URL}" "/tmp" "${ZIP_NAME}"
unzip -qq "/tmp/${ZIP_NAME}" -d /usr/local/bin
rm -f "/tmp/${ZIP_NAME}"
invoke_tests "Tools" "Packer"
invoke_tests "Tools" "Packer"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: phantomjs.sh
## Desc: Installs PhantomJS
## File: install-phantomjs.sh
## Desc: Install PhantomJS
################################################################################
# Source the helpers for use with the script

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: php.sh
## Desc: Installs php
## File: install-php.sh
## Desc: Install php
################################################################################
# Source the helpers for use with the script

View File

@@ -1,6 +1,6 @@
#!/bin/bash -e
################################################################################
## File: pipx-packages.sh
## File: install-pipx-packages.sh
## Desc: Install tools via pipx
################################################################################
source $HELPER_SCRIPTS/install.sh
@@ -28,4 +28,4 @@ for package in $pipx_packages; do
done
invoke_tests "Common" "PipxPackages"
invoke_tests "Common" "PipxPackages"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: postgresql.sh
## Desc: Installs PostgreSQL
## File: install-postgresql.sh
## Desc: Install PostgreSQL
################################################################################
# Source the helpers

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: powershellcore.sh
## Desc: Installs powershellcore
## File: install-powershell.sh
## Desc: Install PowerShell Core
################################################################################
source $HELPER_SCRIPTS/install.sh

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: pulumi.sh
## Desc: Installs Pulumi
## File: install-pulumi.sh
## Desc: Install Pulumi
## Supply chain security: Pulumi - checksum validation
################################################################################

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: pypy.sh
## Desc: Installs PyPy
## File: install-pypy.sh
## Desc: Install PyPy
################################################################################
source $HELPER_SCRIPTS/install.sh

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: python.sh
## Desc: Installs Python 2/3
## File: install-python.sh
## Desc: Install Python 3
################################################################################
set -e

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: r.sh
## Desc: Installs R
## File: install-rlang.sh
## Desc: Install R
################################################################################
# Source the helpers for use with the script
@@ -19,4 +19,4 @@ apt-get install r-base
rm /etc/apt/sources.list.d/rlang.list
rm /usr/share/keyrings/rlang.gpg
invoke_tests "Tools" "R"
invoke_tests "Tools" "R"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: ruby.sh
## Desc: Installs Ruby requirements and ruby gems
## File: install-ruby.sh
## Desc: Install Ruby requirements and ruby gems
################################################################################
source $HELPER_SCRIPTS/os.sh
@@ -54,4 +54,4 @@ for TOOLSET_VERSION in ${TOOLSET_VERSIONS[@]}; do
fi
done
invoke_tests "Tools" "Ruby"
invoke_tests "Tools" "Ruby"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: runner-package.sh
## Desc: Downloads and Installs runner package
## File: install-runner-package.sh
## Desc: Download and Install runner package
################################################################################
# Source the helpers for use with the script

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: rust.sh
## Desc: Installs Rust
## File: install-rust.sh
## Desc: Install Rust
################################################################################
# Source the helpers for use with the script

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: sbt.sh
## Desc: Installs sbt
## File: install-sbt.sh
## Desc: Install sbt
################################################################################
source $HELPER_SCRIPTS/install.sh
@@ -12,4 +12,4 @@ download_with_retries "$downloadUrl" "/tmp" "sbt.tgz"
tar zxf /tmp/sbt.tgz -C /usr/share
ln -s /usr/share/sbt/bin/sbt /usr/bin/sbt
invoke_tests "Tools" "Sbt"
invoke_tests "Tools" "Sbt"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: selenium.sh
## Desc: Installs selenium server
## File: install-selenium.sh
## Desc: Install selenium server
################################################################################
# Source the helpers for use with the script
@@ -15,7 +15,7 @@ SELENIUM_JAR_NAME="$SELENIUM_BINARY_NAME.jar"
SELENIUM_DOWNLOAD_URL=$(get_github_package_download_url "SeleniumHQ/selenium" "contains(\"${SELENIUM_BINARY_NAME}-${SELENIUM_MAJOR_VERSION}\") and endswith(\".jar\")")
download_with_retries $SELENIUM_DOWNLOAD_URL $SELENIUM_JAR_PATH $SELENIUM_JAR_NAME
# Create an epmty file to retrive selenium version
# Create an epmty file to retrive selenium version
SELENIUM_FULL_VERSION=$(echo $SELENIUM_DOWNLOAD_URL | awk -F"${SELENIUM_BINARY_NAME}-|.jar" '{print $2}')
touch "$SELENIUM_JAR_PATH/$SELENIUM_BINARY_NAME-$SELENIUM_FULL_VERSION"

View File

@@ -1,6 +1,6 @@
#!/bin/bash -e
################################################################################
## File: sqlpackage.sh
## File: install-sqlpackage.sh
## Desc: Install SqlPackage CLI to DacFx (https://docs.microsoft.com/sql/tools/sqlpackage/sqlpackage-download#get-sqlpackage-net-core-for-linux)
################################################################################

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: swift.sh
## Desc: Installs Swift
## File: install-swift.sh
## Desc: Install Swift
################################################################################
# Source the helpers for use with the script

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: terraform.sh
## Desc: Installs terraform
## File: install-terraform.sh
## Desc: Install terraform
################################################################################
source $HELPER_SCRIPTS/install.sh
@@ -13,4 +13,4 @@ download_with_retries "${URL}" "/tmp" "${ZIP_NAME}"
unzip -qq "/tmp/${ZIP_NAME}" -d /usr/local/bin
rm -f "/tmp/${ZIP_NAME}"
invoke_tests "Tools" "Terraform"
invoke_tests "Tools" "Terraform"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: vcpkg.sh
## Desc: Installs vcpkg
## File: install-vcpkg.sh
## Desc: Install vcpkg
################################################################################
# Set env variable for vcpkg
@@ -24,4 +24,4 @@ ln -sf $VCPKG_INSTALLATION_ROOT/vcpkg /usr/local/bin
rm -rf /root/.vcpkg $HOME/.vcpkg
invoke_tests "Tools" "Vcpkg"
invoke_tests "Tools" "Vcpkg"

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: yq.sh
## Desc: Installs YQ
## File: install-yq.sh
## Desc: Install YQ
## Supply chain security: YQ - checksum validation
################################################################################

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: zstd.sh
## Desc: Installs zstd
## File: install-zstd.sh
## Desc: Install zstd
## Supply chain security: zstd - checksum validation
################################################################################

View File

@@ -1,8 +0,0 @@
#!/bin/bash -e
################################################################################
## File: reboot.sh
## Desc: Reboot VM
################################################################################
echo "Reboot VM"
sudo reboot

View File

@@ -1,11 +0,0 @@
#!/bin/bash -e
################################################################################
## File: sphinx.sh
## Desc: Installs Sphinx
################################################################################
# Install Sphinx
apt-get install -y sphinxsearch
invoke_tests "Tools" "Sphinx"

View File

@@ -1,20 +0,0 @@
#!/bin/bash -e
################################################################################
## File: validate-disk-space.sh
## Desc: Validate free disk space
################################################################################
availableSpaceMB=$(df / -hm | sed 1d | awk '{ print $4}')
minimumFreeSpaceMB=15000
echo "Available disk space: $availableSpaceMB MB"
if [ $RUN_VALIDATION != "true" ]; then
echo "Skipping validation disk space..."
exit 0
fi
if [ $availableSpaceMB -le $minimumFreeSpaceMB ]; then
echo "Not enough disk space on the image (minimum available space: $minimumFreeSpaceMB MB)"
exit 1
fi

View File

@@ -15,7 +15,7 @@ Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Browsers.psm1") -DisableN
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.CachedTools.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Common.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Databases.psm1") -DisableNameChecking
Import-Module "$PSScriptRoot/../helpers/SoftwareReport.Helpers.psm1" -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Helpers.psm1") -DisableNameChecking
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1" -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Java.psm1") -DisableNameChecking
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Rust.psm1") -DisableNameChecking

View File

@@ -4,5 +4,5 @@
## Desc: Helper function for invoking tests
################################################################################
pwsh -Command "Import-Module '$HELPER_SCRIPTS/Tests.Helpers.psm1' -DisableNameChecking
pwsh -Command "Import-Module '$HELPER_SCRIPTS/../tests/Helpers.psm1' -DisableNameChecking
Invoke-PesterTests -TestFile \"$1\" -TestName \"$2\""

View File

@@ -1,7 +1,7 @@
#!/bin/bash -e
################################################################################
## File: install-helpers.sh
## Desc: Helper functions for installing tools
## File: os.sh
## Desc: Helper functions for OS releases
################################################################################
function isUbuntu20
@@ -17,4 +17,4 @@ function isUbuntu22
function getOSVersionLabel
{
lsb_release -cs
}
}

View File

@@ -1,3 +1,3 @@
Import-Module "$PSScriptRoot/../helpers/Tests.Helpers.psm1" -DisableNameChecking
Import-Module "$PSScriptRoot/Helpers.psm1" -DisableNameChecking
Invoke-PesterTests "*"
Invoke-PesterTests "*"

View File

@@ -0,0 +1,6 @@
Describe "Disk free space" {
It "Image has more than 15GB free space" {
$freeSpace = (Get-PSDrive "/").Free
$freeSpace | Should -BeGreaterOrEqual 15GB
}
}