Skip to content

Commit

Permalink
Fetch tcapp to the runner image
Browse files Browse the repository at this point in the history
  • Loading branch information
velioglu committed Sep 16, 2024
1 parent cb58bbd commit 053c24c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions images/ubuntu/scripts/ubicloud/install-tc-app.sh
Original file line number Diff line number Diff line change
@@ -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"
6 changes: 6 additions & 0 deletions images/ubuntu/templates/ubuntu-22.04.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'"
Expand Down

0 comments on commit 053c24c

Please sign in to comment.