diff --git a/images/ubuntu/scripts/ubicloud/install-tc-app.sh b/images/ubuntu/scripts/ubicloud/install-tc-app.sh new file mode 100644 index 0000000000000..a12908dc140f7 --- /dev/null +++ b/images/ubuntu/scripts/ubicloud/install-tc-app.sh @@ -0,0 +1,19 @@ +#!/bin/bash -e +################################################################################ +## File: install-tc-app.sh +## Desc: Download and Install tcapp +################################################################################ + +# Source the helpers for use with the script +source $HELPER_SCRIPTS/os.sh +source $HELPER_SCRIPTS/install.sh + +download_url=$(resolve_github_release_asset_url "velioglu/exec_repo" 'test("tcapp-linux-'"$(get_arch "x64" "arm64")"'-[0-9]+\\.[0-9]{3}\\.[0-9]+\\.tar\\.gz$")' "latest") +archive_name="${download_url##*/}" +archive_path=$(download_with_retry "$download_url") + +mkdir -p /usr/local/share/tcapp +tar xzf "$archive_path" -C /usr/local/share/tcapp + +mkdir -p /opt/tcapp-cache +mv "$archive_path" "/opt/tcapp-cache/$archive_name" diff --git a/images/ubuntu/templates/ubuntu-22.04.pkr.hcl b/images/ubuntu/templates/ubuntu-22.04.pkr.hcl index 725da653b992f..8e04636cfc155 100644 --- a/images/ubuntu/templates/ubuntu-22.04.pkr.hcl +++ b/images/ubuntu/templates/ubuntu-22.04.pkr.hcl @@ -433,6 +433,12 @@ build { scripts = ["${path.root}/../scripts/ubicloud/setup-runner-user.sh"] } + 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/ubicloud/install-tc-app.sh"] + } + // Update OpenSSH (https://ubuntu.com/security/CVE-2024-6387) provisioner "shell" { execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'"