[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

@@ -40,10 +40,10 @@ Here are a few things you can do that will increase the likelihood of your pull
### Windows
- Add a script that will install the tool and put the script in the `scripts/build` folder.
- Add a script that will install the tool and put the script in the `scripts/build` folder.
There are a bunch of helper functions that could simplify your code: `Choco-Install`, `Install-Binary`, `Install-VsixExtension`, `Start-DownloadWithRetry`, `Test-IsWin19`, `Test-IsWin22` (find the full list of helpers in [ImageHelpers.psm1](images/windows/scripts/helpers/ImageHelpers.psm1)).
- Add a script that will validate the tool installation and put the script in the `scripts/tests` folder.
We use [Pester v5](https://github.com/pester/pester) for validation scripts. If the tests for the tool are complex enough, create a separate `*.Tests.ps1`. Otherwise, use `Tools.Tests.ps1` for simple tests.
- Add a script that will validate the tool installation and put the script in the `scripts/tests` folder.
We use [Pester v5](https://github.com/pester/pester) for validation scripts. If the tests for the tool are complex enough, create a separate `*.Tests.ps1`. Otherwise, use `Tools.Tests.ps1` for simple tests.
Add `Invoke-PesterTests -TestFile <testFileName> [-TestName <describeName>]` at the end of the installation script to make sure that your tests will be run.
- Add changes to the software report generator `images/windows/scripts/docs-gen/SoftwareReport.Generator.ps1`. The software report generator is used to generate an image's README file, e.g. [Windows2019-Readme.md](images/windows/Windows2019-Readme.md) and uses [MarkdownPS](https://github.com/Sarafian/MarkdownPS).
@@ -53,7 +53,7 @@ Add `Invoke-PesterTests -TestFile <testFileName> [-TestName <describeName>]` at
Use existing scripts such as [github-cli.sh](images/ubuntu/scripts/build/github-cli.sh) as a starting point.
- Use [helpers](images/ubuntu/scripts/helpers/install.sh) to simplify installation process.
- Validation part should `exit 1` if any issue with installation.
- Add changes to the software report generator `images/ubuntu/scripts/docs-gen/SoftwareReport.Generator.ps1`. The software report generator is used to generate an image's README file, e.g. [Ubuntu2004-Readme.md](images/ubuntu/Ubuntu2004-README.md) and it uses [MarkdownPS](https://github.com/Sarafian/MarkdownPS).
- Add changes to the software report generator `images/ubuntu/scripts/docs-gen/Generate-SoftwareReport.ps1`. The software report generator is used to generate an image's README file, e.g. [Ubuntu2004-Readme.md](images/ubuntu/Ubuntu2004-README.md) and it uses [MarkdownPS](https://github.com/Sarafian/MarkdownPS).
### macOS

View File

@@ -50,7 +50,6 @@ packer build -var "client_id=$ClientId" `
-var "virtual_network_name=$VirtualNetworkName" `
-var "virtual_network_resource_group_name=$VirtualNetworkRG" `
-var "virtual_network_subnet_name=$VirtualNetworkSubnet" `
-var "run_validation_diskspace=$env:RUN_VALIDATION_FLAG" `
-color=false `
$TemplatePath `
| Where-Object {

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
}
}

View File

@@ -22,7 +22,6 @@
"managed_image_name": "packer-ubuntu20-dev",
"image_version": "dev",
"image_os": "ubuntu20",
"run_validation_diskspace": "false",
"dockerhub_login": "{{env `DOCKERHUB_LOGIN`}}",
"dockerhub_password": "{{env `DOCKERHUB_PASSWORD`}}"
},
@@ -66,15 +65,15 @@
},
{
"type": "shell",
"script": "{{template_dir}}/../scripts/build/apt-mock.sh",
"script": "{{template_dir}}/../scripts/build/configure-apt-mock.sh",
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"scripts": [
"{{template_dir}}/../scripts/build/repos.sh",
"{{template_dir}}/../scripts/build/apt-ubuntu-archive.sh",
"{{template_dir}}/../scripts/build/apt.sh"
"{{template_dir}}/../scripts/build/install-ms-repos.sh",
"{{template_dir}}/../scripts/build/configure-apt-sources.sh",
"{{template_dir}}/../scripts/build/configure-apt.sh"
],
"environment_vars": [
"DEBIAN_FRONTEND=noninteractive"
@@ -83,7 +82,7 @@
},
{
"type": "shell",
"script": "{{template_dir}}/../scripts/build/limits.sh",
"script": "{{template_dir}}/../scripts/build/configure-limits.sh",
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
@@ -126,7 +125,7 @@
{
"type": "shell",
"scripts": [
"{{template_dir}}/../scripts/build/preimagedata.sh"
"{{template_dir}}/../scripts/build/configure-image-data.sh"
],
"environment_vars": [
"IMAGE_VERSION={{user `image_version`}}",
@@ -149,7 +148,7 @@
{
"type": "shell",
"scripts": [
"{{template_dir}}/../scripts/build/apt-vital.sh"
"{{template_dir}}/../scripts/build/install-apt-vital.sh"
],
"environment_vars": [
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
@@ -161,8 +160,7 @@
{
"type": "shell",
"scripts": [
"{{template_dir}}/../scripts/build/complete-snap-setup.sh",
"{{template_dir}}/../scripts/build/powershellcore.sh"
"{{template_dir}}/../scripts/build/install-powershell.sh"
],
"environment_vars": [
"HELPER_SCRIPTS={{user `helper_script_folder`}}"
@@ -173,7 +171,7 @@
"type": "shell",
"scripts": [
"{{template_dir}}/../scripts/build/Install-PowerShellModules.ps1",
"{{template_dir}}/../scripts/build/Install-AzureModules.ps1"
"{{template_dir}}/../scripts/build/Install-PowerShellAzModules.ps1"
],
"environment_vars": [
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
@@ -184,70 +182,70 @@
{
"type": "shell",
"scripts": [
"{{template_dir}}/../scripts/build/action-archive-cache.sh",
"{{template_dir}}/../scripts/build/runner-package.sh",
"{{template_dir}}/../scripts/build/apt-common.sh",
"{{template_dir}}/../scripts/build/azcopy.sh",
"{{template_dir}}/../scripts/build/azure-cli.sh",
"{{template_dir}}/../scripts/build/azure-devops-cli.sh",
"{{template_dir}}/../scripts/build/bicep.sh",
"{{template_dir}}/../scripts/build/aliyun-cli.sh",
"{{template_dir}}/../scripts/build/apache.sh",
"{{template_dir}}/../scripts/build/aws.sh",
"{{template_dir}}/../scripts/build/clang.sh",
"{{template_dir}}/../scripts/build/swift.sh",
"{{template_dir}}/../scripts/build/cmake.sh",
"{{template_dir}}/../scripts/build/codeql-bundle.sh",
"{{template_dir}}/../scripts/build/containers.sh",
"{{template_dir}}/../scripts/build/dotnetcore-sdk.sh",
"{{template_dir}}/../scripts/build/erlang.sh",
"{{template_dir}}/../scripts/build/firefox.sh",
"{{template_dir}}/../scripts/build/microsoft-edge.sh",
"{{template_dir}}/../scripts/build/gcc.sh",
"{{template_dir}}/../scripts/build/gfortran.sh",
"{{template_dir}}/../scripts/build/git.sh",
"{{template_dir}}/../scripts/build/git-lfs.sh",
"{{template_dir}}/../scripts/build/github-cli.sh",
"{{template_dir}}/../scripts/build/google-chrome.sh",
"{{template_dir}}/../scripts/build/google-cloud-cli.sh",
"{{template_dir}}/../scripts/build/haskell.sh",
"{{template_dir}}/../scripts/build/heroku.sh",
"{{template_dir}}/../scripts/build/hhvm.sh",
"{{template_dir}}/../scripts/build/java-tools.sh",
"{{template_dir}}/../scripts/build/kubernetes-tools.sh",
"{{template_dir}}/../scripts/build/oc.sh",
"{{template_dir}}/../scripts/build/leiningen.sh",
"{{template_dir}}/../scripts/build/miniconda.sh",
"{{template_dir}}/../scripts/build/mono.sh",
"{{template_dir}}/../scripts/build/kotlin.sh",
"{{template_dir}}/../scripts/build/mysql.sh",
"{{template_dir}}/../scripts/build/mssql-cmd-tools.sh",
"{{template_dir}}/../scripts/build/sqlpackage.sh",
"{{template_dir}}/../scripts/build/nginx.sh",
"{{template_dir}}/../scripts/build/nvm.sh",
"{{template_dir}}/../scripts/build/nodejs.sh",
"{{template_dir}}/../scripts/build/bazel.sh",
"{{template_dir}}/../scripts/build/oras-cli.sh",
"{{template_dir}}/../scripts/build/phantomjs.sh",
"{{template_dir}}/../scripts/build/php.sh",
"{{template_dir}}/../scripts/build/postgresql.sh",
"{{template_dir}}/../scripts/build/pulumi.sh",
"{{template_dir}}/../scripts/build/ruby.sh",
"{{template_dir}}/../scripts/build/r.sh",
"{{template_dir}}/../scripts/build/rust.sh",
"{{template_dir}}/../scripts/build/julia.sh",
"{{template_dir}}/../scripts/build/sbt.sh",
"{{template_dir}}/../scripts/build/selenium.sh",
"{{template_dir}}/../scripts/build/terraform.sh",
"{{template_dir}}/../scripts/build/packer.sh",
"{{template_dir}}/../scripts/build/vcpkg.sh",
"{{template_dir}}/../scripts/build/dpkg-config.sh",
"{{template_dir}}/../scripts/build/mongodb.sh",
"{{template_dir}}/../scripts/build/yq.sh",
"{{template_dir}}/../scripts/build/android.sh",
"{{template_dir}}/../scripts/build/pypy.sh",
"{{template_dir}}/../scripts/build/python.sh",
"{{template_dir}}/../scripts/build/zstd.sh"
"{{template_dir}}/../scripts/build/install-actions-cache.sh",
"{{template_dir}}/../scripts/build/install-runner-package.sh",
"{{template_dir}}/../scripts/build/install-apt-common.sh",
"{{template_dir}}/../scripts/build/install-azcopy.sh",
"{{template_dir}}/../scripts/build/install-azure-cli.sh",
"{{template_dir}}/../scripts/build/install-azure-devops-cli.sh",
"{{template_dir}}/../scripts/build/install-bicep.sh",
"{{template_dir}}/../scripts/build/install-aliyun-cli.sh",
"{{template_dir}}/../scripts/build/install-apache.sh",
"{{template_dir}}/../scripts/build/install-aws-tools.sh",
"{{template_dir}}/../scripts/build/install-clang.sh",
"{{template_dir}}/../scripts/build/install-swift.sh",
"{{template_dir}}/../scripts/build/install-cmake.sh",
"{{template_dir}}/../scripts/build/install-codeql-bundle.sh",
"{{template_dir}}/../scripts/build/install-container-tools.sh",
"{{template_dir}}/../scripts/build/install-dotnetcore-sdk.sh",
"{{template_dir}}/../scripts/build/install-erlang.sh",
"{{template_dir}}/../scripts/build/install-firefox.sh",
"{{template_dir}}/../scripts/build/install-microsoft-edge.sh",
"{{template_dir}}/../scripts/build/install-gcc-compilers.sh",
"{{template_dir}}/../scripts/build/install-gfortran.sh",
"{{template_dir}}/../scripts/build/install-git.sh",
"{{template_dir}}/../scripts/build/install-git-lfs.sh",
"{{template_dir}}/../scripts/build/install-github-cli.sh",
"{{template_dir}}/../scripts/build/install-google-chrome.sh",
"{{template_dir}}/../scripts/build/install-google-cloud-cli.sh",
"{{template_dir}}/../scripts/build/install-haskell.sh",
"{{template_dir}}/../scripts/build/install-heroku.sh",
"{{template_dir}}/../scripts/build/install-hhvm.sh",
"{{template_dir}}/../scripts/build/install-java-tools.sh",
"{{template_dir}}/../scripts/build/install-kubernetes-tools.sh",
"{{template_dir}}/../scripts/build/install-oc-cli.sh",
"{{template_dir}}/../scripts/build/install-leiningen.sh",
"{{template_dir}}/../scripts/build/install-miniconda.sh",
"{{template_dir}}/../scripts/build/install-mono.sh",
"{{template_dir}}/../scripts/build/install-kotlin.sh",
"{{template_dir}}/../scripts/build/install-mysql.sh",
"{{template_dir}}/../scripts/build/install-mssql-tools.sh",
"{{template_dir}}/../scripts/build/install-sqlpackage.sh",
"{{template_dir}}/../scripts/build/install-nginx.sh",
"{{template_dir}}/../scripts/build/install-nvm.sh",
"{{template_dir}}/../scripts/build/install-nodejs.sh",
"{{template_dir}}/../scripts/build/install-bazel.sh",
"{{template_dir}}/../scripts/build/install-oras-cli.sh",
"{{template_dir}}/../scripts/build/install-phantomjs.sh",
"{{template_dir}}/../scripts/build/install-php.sh",
"{{template_dir}}/../scripts/build/install-postgresql.sh",
"{{template_dir}}/../scripts/build/install-pulumi.sh",
"{{template_dir}}/../scripts/build/install-ruby.sh",
"{{template_dir}}/../scripts/build/install-rlang.sh",
"{{template_dir}}/../scripts/build/install-rust.sh",
"{{template_dir}}/../scripts/build/install-julia.sh",
"{{template_dir}}/../scripts/build/install-sbt.sh",
"{{template_dir}}/../scripts/build/install-selenium.sh",
"{{template_dir}}/../scripts/build/install-terraform.sh",
"{{template_dir}}/../scripts/build/install-packer.sh",
"{{template_dir}}/../scripts/build/install-vcpkg.sh",
"{{template_dir}}/../scripts/build/configure-dpkg.sh",
"{{template_dir}}/../scripts/build/install-mongodb.sh",
"{{template_dir}}/../scripts/build/install-yq.sh",
"{{template_dir}}/../scripts/build/install-android-sdk.sh",
"{{template_dir}}/../scripts/build/install-pypy.sh",
"{{template_dir}}/../scripts/build/install-python.sh",
"{{template_dir}}/../scripts/build/install-zstd.sh"
],
"environment_vars": [
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
@@ -259,8 +257,8 @@
{
"type": "shell",
"scripts": [
"{{template_dir}}/../scripts/build/docker-compose.sh",
"{{template_dir}}/../scripts/build/docker.sh"
"{{template_dir}}/../scripts/build/install-docker-compose.sh",
"{{template_dir}}/../scripts/build/install-docker.sh"
],
"environment_vars": [
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
@@ -285,7 +283,7 @@
{
"type": "shell",
"scripts": [
"{{template_dir}}/../scripts/build/pipx-packages.sh"
"{{template_dir}}/../scripts/build/install-pipx-packages.sh"
],
"environment_vars": [
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
@@ -296,7 +294,7 @@
{
"type": "shell",
"scripts": [
"{{template_dir}}/../scripts/build/homebrew.sh"
"{{template_dir}}/../scripts/build/install-homebrew.sh"
],
"environment_vars": [
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
@@ -307,16 +305,22 @@
},
{
"type": "shell",
"script": "{{template_dir}}/../scripts/build/snap.sh",
"scripts": [
"{{template_dir}}/../scripts/build/configure-snap.sh"
],
"environment_vars": [
"HELPER_SCRIPTS={{user `helper_script_folder`}}"
],
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"expect_disconnect": true,
"scripts": [
"{{template_dir}}/../scripts/build/reboot.sh"
"inline": [
"echo 'Reboot VM'",
"sudo reboot"
],
"execute_command": "/bin/sh -c '{{ .Vars }} {{ .Path }}'"
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
@@ -327,18 +331,13 @@
],
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"script": "{{template_dir}}/../scripts/build/apt-mock-remove.sh",
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"max_retries": 3,
"start_retry_timeout": "2m",
"inline": [
"pwsh -Command Write-Host Running SoftwareReport.Generator.ps1 script",
"pwsh -File {{user `image_folder`}}/SoftwareReport/SoftwareReport.Generator.ps1 -OutputDirectory {{user `image_folder`}}",
"pwsh -Command Write-Host Running Generate-SoftwareReport.ps1 script",
"pwsh -File {{user `image_folder`}}/SoftwareReport/Generate-SoftwareReport.ps1 -OutputDirectory {{user `image_folder`}}",
"pwsh -Command Write-Host Running RunAll-Tests.ps1 script",
"pwsh -File {{user `image_folder`}}/tests/RunAll-Tests.ps1 -OutputDirectory {{user `image_folder`}}"
],
@@ -362,7 +361,7 @@
{
"type": "shell",
"scripts":[
"{{template_dir}}/../scripts/build/post-deployment.sh"
"{{template_dir}}/../scripts/build/configure-system.sh"
],
"environment_vars":[
"HELPER_SCRIPT_FOLDER={{user `helper_script_folder`}}",
@@ -371,15 +370,6 @@
],
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"scripts":[
"{{template_dir}}/../scripts/build/validate-disk-space.sh"
],
"environment_vars": [
"RUN_VALIDATION={{user `run_validation_diskspace`}}"
]
},
{
"type": "file",
"source": "{{template_dir}}/../assets/ubuntu2004.conf",

View File

@@ -103,11 +103,6 @@ variable "managed_image_resource_group_name" {
default = "${env("ARM_RESOURCE_GROUP")}"
}
variable "run_validation_diskspace" {
type = bool
default = false
}
variable "subscription_id" {
type = string
default = "${env("ARM_SUBSCRIPTION_ID")}"
@@ -185,22 +180,22 @@ build {
provisioner "shell" {
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
script = "${path.root}/../scripts/build/apt-mock.sh"
script = "${path.root}/../scripts/build/configure-apt-mock.sh"
}
provisioner "shell" {
environment_vars = ["DEBIAN_FRONTEND=noninteractive"]
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
scripts = [
"${path.root}/../scripts/build/repos.sh",
"${path.root}/../scripts/build/apt-ubuntu-archive.sh",
"${path.root}/../scripts/build/apt.sh"
"${path.root}/../scripts/build/install-ms-repos.sh",
"${path.root}/../scripts/build/configure-apt-sources.sh",
"${path.root}/../scripts/build/configure-apt.sh"
]
}
provisioner "shell" {
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
script = "${path.root}/../scripts/build/limits.sh"
script = "${path.root}/../scripts/build/configure-limits.sh"
}
provisioner "file" {
@@ -243,7 +238,7 @@ build {
provisioner "shell" {
environment_vars = ["IMAGE_VERSION=${var.image_version}", "IMAGEDATA_FILE=${var.imagedata_file}"]
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
scripts = ["${path.root}/../scripts/build/preimagedata.sh"]
scripts = ["${path.root}/../scripts/build/configure-image-data.sh"]
}
provisioner "shell" {
@@ -255,92 +250,92 @@ build {
provisioner "shell" {
environment_vars = ["DEBIAN_FRONTEND=noninteractive", "HELPER_SCRIPTS=${var.helper_script_folder}", "INSTALLER_SCRIPT_FOLDER=${var.installer_script_folder}"]
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
scripts = ["${path.root}/../scripts/build/apt-vital.sh"]
scripts = ["${path.root}/../scripts/build/install-apt-vital.sh"]
}
provisioner "shell" {
environment_vars = ["HELPER_SCRIPTS=${var.helper_script_folder}"]
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
scripts = ["${path.root}/../scripts/build/complete-snap-setup.sh", "${path.root}/../scripts/build/powershellcore.sh"]
scripts = ["${path.root}/../scripts/build/install-powershell.sh"]
}
provisioner "shell" {
environment_vars = ["HELPER_SCRIPTS=${var.helper_script_folder}", "INSTALLER_SCRIPT_FOLDER=${var.installer_script_folder}"]
execute_command = "sudo sh -c '{{ .Vars }} pwsh -f {{ .Path }}'"
scripts = ["${path.root}/../scripts/build/Install-PowerShellModules.ps1", "${path.root}/../scripts/build/Install-AzureModules.ps1"]
scripts = ["${path.root}/../scripts/build/Install-PowerShellModules.ps1", "${path.root}/../scripts/build/Install-PowerShellAzModules.ps1"]
}
provisioner "shell" {
environment_vars = ["HELPER_SCRIPTS=${var.helper_script_folder}", "INSTALLER_SCRIPT_FOLDER=${var.installer_script_folder}", "DEBIAN_FRONTEND=noninteractive"]
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
scripts = [
"${path.root}/../scripts/build/action-archive-cache.sh",
"${path.root}/../scripts/build/runner-package.sh",
"${path.root}/../scripts/build/apt-common.sh",
"${path.root}/../scripts/build/azcopy.sh",
"${path.root}/../scripts/build/azure-cli.sh",
"${path.root}/../scripts/build/azure-devops-cli.sh",
"${path.root}/../scripts/build/bicep.sh",
"${path.root}/../scripts/build/aliyun-cli.sh",
"${path.root}/../scripts/build/apache.sh",
"${path.root}/../scripts/build/aws.sh",
"${path.root}/../scripts/build/clang.sh",
"${path.root}/../scripts/build/swift.sh",
"${path.root}/../scripts/build/cmake.sh",
"${path.root}/../scripts/build/codeql-bundle.sh",
"${path.root}/../scripts/build/containers.sh",
"${path.root}/../scripts/build/dotnetcore-sdk.sh",
"${path.root}/../scripts/build/firefox.sh",
"${path.root}/../scripts/build/microsoft-edge.sh",
"${path.root}/../scripts/build/gcc.sh",
"${path.root}/../scripts/build/gfortran.sh",
"${path.root}/../scripts/build/git.sh",
"${path.root}/../scripts/build/git-lfs.sh",
"${path.root}/../scripts/build/github-cli.sh",
"${path.root}/../scripts/build/google-chrome.sh",
"${path.root}/../scripts/build/google-cloud-cli.sh",
"${path.root}/../scripts/build/haskell.sh",
"${path.root}/../scripts/build/heroku.sh",
"${path.root}/../scripts/build/java-tools.sh",
"${path.root}/../scripts/build/kubernetes-tools.sh",
"${path.root}/../scripts/build/oc.sh",
"${path.root}/../scripts/build/leiningen.sh",
"${path.root}/../scripts/build/miniconda.sh",
"${path.root}/../scripts/build/mono.sh",
"${path.root}/../scripts/build/kotlin.sh",
"${path.root}/../scripts/build/mysql.sh",
"${path.root}/../scripts/build/mssql-cmd-tools.sh",
"${path.root}/../scripts/build/sqlpackage.sh",
"${path.root}/../scripts/build/nginx.sh",
"${path.root}/../scripts/build/nvm.sh",
"${path.root}/../scripts/build/nodejs.sh",
"${path.root}/../scripts/build/bazel.sh",
"${path.root}/../scripts/build/oras-cli.sh",
"${path.root}/../scripts/build/php.sh",
"${path.root}/../scripts/build/postgresql.sh",
"${path.root}/../scripts/build/pulumi.sh",
"${path.root}/../scripts/build/ruby.sh",
"${path.root}/../scripts/build/r.sh",
"${path.root}/../scripts/build/rust.sh",
"${path.root}/../scripts/build/julia.sh",
"${path.root}/../scripts/build/sbt.sh",
"${path.root}/../scripts/build/selenium.sh",
"${path.root}/../scripts/build/terraform.sh",
"${path.root}/../scripts/build/packer.sh",
"${path.root}/../scripts/build/vcpkg.sh",
"${path.root}/../scripts/build/dpkg-config.sh",
"${path.root}/../scripts/build/yq.sh",
"${path.root}/../scripts/build/android.sh",
"${path.root}/../scripts/build/pypy.sh",
"${path.root}/../scripts/build/python.sh",
"${path.root}/../scripts/build/zstd.sh"
"${path.root}/../scripts/build/install-actions-cache.sh",
"${path.root}/../scripts/build/install-runner-package.sh",
"${path.root}/../scripts/build/install-apt-common.sh",
"${path.root}/../scripts/build/install-azcopy.sh",
"${path.root}/../scripts/build/install-azure-cli.sh",
"${path.root}/../scripts/build/install-azure-devops-cli.sh",
"${path.root}/../scripts/build/install-bicep.sh",
"${path.root}/../scripts/build/install-aliyun-cli.sh",
"${path.root}/../scripts/build/install-apache.sh",
"${path.root}/../scripts/build/install-aws-tools.sh",
"${path.root}/../scripts/build/install-clang.sh",
"${path.root}/../scripts/build/install-swift.sh",
"${path.root}/../scripts/build/install-cmake.sh",
"${path.root}/../scripts/build/install-codeql-bundle.sh",
"${path.root}/../scripts/build/install-container-tools.sh",
"${path.root}/../scripts/build/install-dotnetcore-sdk.sh",
"${path.root}/../scripts/build/install-firefox.sh",
"${path.root}/../scripts/build/install-microsoft-edge.sh",
"${path.root}/../scripts/build/install-gcc-compilers.sh",
"${path.root}/../scripts/build/install-gfortran.sh",
"${path.root}/../scripts/build/install-git.sh",
"${path.root}/../scripts/build/install-git-lfs.sh",
"${path.root}/../scripts/build/install-github-cli.sh",
"${path.root}/../scripts/build/install-google-chrome.sh",
"${path.root}/../scripts/build/install-google-cloud-cli.sh",
"${path.root}/../scripts/build/install-haskell.sh",
"${path.root}/../scripts/build/install-heroku.sh",
"${path.root}/../scripts/build/install-java-tools.sh",
"${path.root}/../scripts/build/install-kubernetes-tools.sh",
"${path.root}/../scripts/build/install-oc-cli.sh",
"${path.root}/../scripts/build/install-leiningen.sh",
"${path.root}/../scripts/build/install-miniconda.sh",
"${path.root}/../scripts/build/install-mono.sh",
"${path.root}/../scripts/build/install-kotlin.sh",
"${path.root}/../scripts/build/install-mysql.sh",
"${path.root}/../scripts/build/install-mssql-tools.sh",
"${path.root}/../scripts/build/install-sqlpackage.sh",
"${path.root}/../scripts/build/install-nginx.sh",
"${path.root}/../scripts/build/install-nvm.sh",
"${path.root}/../scripts/build/install-nodejs.sh",
"${path.root}/../scripts/build/install-bazel.sh",
"${path.root}/../scripts/build/install-oras-cli.sh",
"${path.root}/../scripts/build/install-php.sh",
"${path.root}/../scripts/build/install-postgresql.sh",
"${path.root}/../scripts/build/install-pulumi.sh",
"${path.root}/../scripts/build/install-ruby.sh",
"${path.root}/../scripts/build/install-rlang.sh",
"${path.root}/../scripts/build/install-rust.sh",
"${path.root}/../scripts/build/install-julia.sh",
"${path.root}/../scripts/build/install-sbt.sh",
"${path.root}/../scripts/build/install-selenium.sh",
"${path.root}/../scripts/build/install-terraform.sh",
"${path.root}/../scripts/build/install-packer.sh",
"${path.root}/../scripts/build/install-vcpkg.sh",
"${path.root}/../scripts/build/configure-dpkg.sh",
"${path.root}/../scripts/build/install-yq.sh",
"${path.root}/../scripts/build/install-android-sdk.sh",
"${path.root}/../scripts/build/install-pypy.sh",
"${path.root}/../scripts/build/install-python.sh",
"${path.root}/../scripts/build/install-zstd.sh"
]
}
provisioner "shell" {
environment_vars = ["HELPER_SCRIPTS=${var.helper_script_folder}", "INSTALLER_SCRIPT_FOLDER=${var.installer_script_folder}", "DOCKERHUB_LOGIN=${var.dockerhub_login}", "DOCKERHUB_PASSWORD=${var.dockerhub_password}"]
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
scripts = ["${path.root}/../scripts/build/docker-compose.sh", "${path.root}/../scripts/build/docker.sh"]
scripts = ["${path.root}/../scripts/build/install-docker-compose.sh", "${path.root}/../scripts/build/install-docker.sh"]
}
provisioner "shell" {
@@ -352,24 +347,25 @@ build {
provisioner "shell" {
environment_vars = ["HELPER_SCRIPTS=${var.helper_script_folder}", "INSTALLER_SCRIPT_FOLDER=${var.installer_script_folder}"]
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
scripts = ["${path.root}/../scripts/build/pipx-packages.sh"]
scripts = ["${path.root}/../scripts/build/install-pipx-packages.sh"]
}
provisioner "shell" {
environment_vars = ["HELPER_SCRIPTS=${var.helper_script_folder}", "DEBIAN_FRONTEND=noninteractive", "INSTALLER_SCRIPT_FOLDER=${var.installer_script_folder}"]
execute_command = "/bin/sh -c '{{ .Vars }} {{ .Path }}'"
scripts = ["${path.root}/../scripts/build/homebrew.sh"]
scripts = ["${path.root}/../scripts/build/install-homebrew.sh"]
}
provisioner "shell" {
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
script = "${path.root}/../scripts/build/snap.sh"
environment_vars = ["HELPER_SCRIPTS=${var.helper_script_folder}"]
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
scripts = ["${path.root}/../scripts/build/configure-snap.sh"]
}
provisioner "shell" {
execute_command = "/bin/sh -c '{{ .Vars }} {{ .Path }}'"
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
expect_disconnect = true
scripts = ["${path.root}/../scripts/build/reboot.sh"]
inline = ["echo 'Reboot VM'", "sudo reboot"]
}
provisioner "shell" {
@@ -379,14 +375,9 @@ build {
start_retry_timeout = "10m"
}
provisioner "shell" {
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
script = "${path.root}/../scripts/build/apt-mock-remove.sh"
}
provisioner "shell" {
environment_vars = ["IMAGE_VERSION=${var.image_version}", "INSTALLER_SCRIPT_FOLDER=${var.installer_script_folder}"]
inline = ["pwsh -File ${var.image_folder}/SoftwareReport/SoftwareReport.Generator.ps1 -OutputDirectory ${var.image_folder}", "pwsh -File ${var.image_folder}/tests/RunAll-Tests.ps1 -OutputDirectory ${var.image_folder}"]
inline = ["pwsh -File ${var.image_folder}/SoftwareReport/Generate-SoftwareReport.ps1 -OutputDirectory ${var.image_folder}", "pwsh -File ${var.image_folder}/tests/RunAll-Tests.ps1 -OutputDirectory ${var.image_folder}"]
}
provisioner "file" {
@@ -404,12 +395,7 @@ build {
provisioner "shell" {
environment_vars = ["HELPER_SCRIPT_FOLDER=${var.helper_script_folder}", "INSTALLER_SCRIPT_FOLDER=${var.installer_script_folder}", "IMAGE_FOLDER=${var.image_folder}"]
execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"
scripts = ["${path.root}/../scripts/build/post-deployment.sh"]
}
provisioner "shell" {
environment_vars = ["RUN_VALIDATION=${var.run_validation_diskspace}"]
scripts = ["${path.root}/../scripts/build/validate-disk-space.sh"]
scripts = ["${path.root}/../scripts/build/configure-system.sh"]
}
provisioner "file" {

Some files were not shown because too many files have changed in this diff Show More