mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-15 22:36:46 +00:00
240 lines
11 KiB
JSON
240 lines
11 KiB
JSON
{
|
|
"variables": {
|
|
"commit_id": "{{env `COMMIT_ID`}}",
|
|
"client_id": "{{env `ARM_CLIENT_ID`}}",
|
|
"client_secret": "{{env `ARM_CLIENT_SECRET`}}",
|
|
"subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}",
|
|
"tenant_id": "{{env `ARM_TENANT_ID`}}",
|
|
"resource_group": "{{env `ARM_RESOURCE_GROUP`}}",
|
|
"storage_account": "{{env `ARM_STORAGE_ACCOUNT`}}",
|
|
"temp_resource_group_name": "{{env `TEMP_RESOURCE_GROUP_NAME`}}",
|
|
"location": "{{env `ARM_RESOURCE_LOCATION`}}",
|
|
"virtual_network_name": "{{env `VNET_NAME`}}",
|
|
"virtual_network_resource_group_name": "{{env `VNET_RESOURCE_GROUP`}}",
|
|
"virtual_network_subnet_name": "{{env `VNET_SUBNET`}}",
|
|
"private_virtual_network_with_public_ip": "{{env `PRIVATE_VIRTUAL_NETWORK_WITH_PUBLIC_IP`}}",
|
|
"image_folder": "/imagegeneration",
|
|
"commit_file": "/imagegeneration/commit.txt",
|
|
"metadata_file": "/imagegeneration/metadatafile",
|
|
"installer_script_folder": "/imagegeneration/installers",
|
|
"helper_script_folder": "/imagegeneration/helpers",
|
|
"vm_size": "Standard_DS2_v2",
|
|
"capture_name_prefix": "packer",
|
|
"image_version": "dev"
|
|
},
|
|
"builders": [
|
|
{
|
|
"type": "azure-arm",
|
|
"client_id": "{{user `client_id`}}",
|
|
"client_secret": "{{user `client_secret`}}",
|
|
"subscription_id": "{{user `subscription_id`}}",
|
|
"tenant_id": "{{user `tenant_id`}}",
|
|
|
|
"location": "{{user `location`}}",
|
|
"vm_size": "{{user `vm_size`}}",
|
|
"resource_group_name": "{{user `resource_group`}}",
|
|
"storage_account": "{{user `storage_account`}}",
|
|
"temp_resource_group_name": "{{user `temp_resource_group_name`}}",
|
|
"capture_container_name": "images",
|
|
"capture_name_prefix": "{{user `capture_name_prefix`}}",
|
|
"virtual_network_name": "{{user `virtual_network_name`}}",
|
|
"virtual_network_resource_group_name": "{{user `virtual_network_resource_group_name`}}",
|
|
"virtual_network_subnet_name": "{{user `virtual_network_subnet_name`}}",
|
|
"private_virtual_network_with_public_ip": "{{user `private_virtual_network_with_public_ip`}}",
|
|
"os_type": "Linux",
|
|
"image_publisher": "Canonical",
|
|
"image_offer": "UbuntuServer",
|
|
"image_sku": "18.04-LTS",
|
|
"os_disk_size_gb": "86"
|
|
}
|
|
],
|
|
"provisioners": [
|
|
{
|
|
"type": "shell",
|
|
"inline": [
|
|
"mkdir {{user `image_folder`}}",
|
|
"chmod 777 {{user `image_folder`}}",
|
|
"echo {{user `commit_id`}} > {{user `commit_file`}}",
|
|
"chmod +r {{user `commit_file`}}"
|
|
],
|
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
|
},
|
|
{
|
|
"type": "shell",
|
|
"scripts":[
|
|
"{{template_dir}}/scripts/base/repos.sh"
|
|
],
|
|
"environment_vars": [
|
|
"DEBIAN_FRONTEND=noninteractive"
|
|
],
|
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
|
},
|
|
{
|
|
"type": "shell",
|
|
"inline": [
|
|
"apt-get update",
|
|
"apt-get dist-upgrade -y",
|
|
"systemctl disable apt-daily.service",
|
|
"systemctl disable apt-daily.timer",
|
|
"systemctl disable apt-daily-upgrade.timer",
|
|
"systemctl disable apt-daily-upgrade.service",
|
|
"echo '* soft nofile 50000 \n* hard nofile 50000' >> /etc/security/limits.conf",
|
|
"echo 'session required pam_limits.so' >> /etc/pam.d/common-session",
|
|
"echo 'session required pam_limits.so' >> /etc/pam.d/common-session-noninteractive"
|
|
],
|
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
|
},
|
|
{
|
|
"type": "file",
|
|
"source": "{{template_dir}}/scripts/helpers",
|
|
"destination": "{{user `helper_script_folder`}}"
|
|
},
|
|
{
|
|
"type": "file",
|
|
"source": "{{template_dir}}/scripts/installers",
|
|
"destination": "{{user `installer_script_folder`}}"
|
|
},
|
|
{
|
|
"type": "shell",
|
|
"scripts":[
|
|
"{{template_dir}}/scripts/installers/1804/preparemetadata.sh"
|
|
],
|
|
"environment_vars": [
|
|
"IMAGE_VERSION={{user `image_version`}}",
|
|
"METADATA_FILE={{user `metadata_file`}}",
|
|
"HELPER_SCRIPTS={{user `helper_script_folder`}}"
|
|
],
|
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
|
},
|
|
{
|
|
"type": "shell",
|
|
"inline": [
|
|
"echo ImageVersion={{user `image_version`}} | tee -a /etc/environment"
|
|
],
|
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
|
},
|
|
{
|
|
"type": "shell",
|
|
"scripts": [
|
|
"{{template_dir}}/scripts/installers/7-zip.sh",
|
|
"{{template_dir}}/scripts/installers/ansible.sh",
|
|
"{{template_dir}}/scripts/installers/azcopy.sh",
|
|
"{{template_dir}}/scripts/installers/azure-cli.sh",
|
|
"{{template_dir}}/scripts/installers/azure-devops-cli.sh",
|
|
"{{template_dir}}/scripts/installers/1804/basic.sh",
|
|
"{{template_dir}}/scripts/installers/aws.sh",
|
|
"{{template_dir}}/scripts/installers/build-essential.sh",
|
|
"{{template_dir}}/scripts/installers/clang.sh",
|
|
"{{template_dir}}/scripts/installers/cmake.sh",
|
|
"{{template_dir}}/scripts/installers/docker-compose.sh",
|
|
"{{template_dir}}/scripts/installers/docker-moby.sh",
|
|
"{{template_dir}}/scripts/installers/docker.sh",
|
|
"{{template_dir}}/scripts/installers/1804/dotnetcore-sdk.sh",
|
|
"{{template_dir}}/scripts/installers/erlang.sh",
|
|
"{{template_dir}}/scripts/installers/firefox.sh",
|
|
"{{template_dir}}/scripts/installers/gcc.sh",
|
|
"{{template_dir}}/scripts/installers/git.sh",
|
|
"{{template_dir}}/scripts/installers/1804/go.sh",
|
|
"{{template_dir}}/scripts/installers/google-chrome.sh",
|
|
"{{template_dir}}/scripts/installers/google-cloud-sdk.sh",
|
|
"{{template_dir}}/scripts/installers/haskell.sh",
|
|
"{{template_dir}}/scripts/installers/heroku.sh",
|
|
"{{template_dir}}/scripts/installers/hhvm.sh",
|
|
"{{template_dir}}/scripts/installers/image-magick.sh",
|
|
"{{template_dir}}/scripts/installers/java-tools.sh",
|
|
"{{template_dir}}/scripts/installers/kind.sh",
|
|
"{{template_dir}}/scripts/installers/1804/kubernetes-tools.sh",
|
|
"{{template_dir}}/scripts/installers/leiningen.sh",
|
|
"{{template_dir}}/scripts/installers/1804/mercurial.sh",
|
|
"{{template_dir}}/scripts/installers/miniconda.sh",
|
|
"{{template_dir}}/scripts/installers/mono.sh",
|
|
"{{template_dir}}/scripts/installers/mysql.sh",
|
|
"{{template_dir}}/scripts/installers/nodejs.sh",
|
|
"{{template_dir}}/scripts/installers/phantomjs.sh",
|
|
"{{template_dir}}/scripts/installers/1804/php.sh",
|
|
"{{template_dir}}/scripts/installers/pollinate.sh",
|
|
"{{template_dir}}/scripts/installers/1804/powershellcore.sh",
|
|
"{{template_dir}}/scripts/installers/ruby.sh",
|
|
"{{template_dir}}/scripts/installers/rust.sh",
|
|
"{{template_dir}}/scripts/installers/sbt.sh",
|
|
"{{template_dir}}/scripts/installers/sphinx.sh",
|
|
"{{template_dir}}/scripts/installers/subversion.sh",
|
|
"{{template_dir}}/scripts/installers/terraform.sh",
|
|
"{{template_dir}}/scripts/installers/vcpkg.sh",
|
|
"{{template_dir}}/scripts/installers/zeit-now.sh"
|
|
],
|
|
"environment_vars": [
|
|
"METADATA_FILE={{user `metadata_file`}}",
|
|
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
|
|
"DEBIAN_FRONTEND=noninteractive"
|
|
],
|
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
|
},
|
|
{
|
|
"type": "shell",
|
|
"scripts":[
|
|
"{{template_dir}}/scripts/installers/1804/android.sh",
|
|
"{{template_dir}}/scripts/installers/1804/azpowershell.sh",
|
|
"{{template_dir}}/scripts/helpers/containercache.sh",
|
|
"{{template_dir}}/scripts/installers/1804/hosted-tool-cache.sh",
|
|
"{{template_dir}}/scripts/installers/python.sh",
|
|
"{{template_dir}}/scripts/installers/test-toolcache.sh"
|
|
],
|
|
"environment_vars": [
|
|
"METADATA_FILE={{user `metadata_file`}}",
|
|
"HELPER_SCRIPTS={{user `helper_script_folder`}}"
|
|
],
|
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
|
},
|
|
{
|
|
"type": "shell",
|
|
"scripts":[
|
|
"{{template_dir}}/scripts/installers/boost.sh"
|
|
],
|
|
"environment_vars": [
|
|
"METADATA_FILE={{user `metadata_file`}}",
|
|
"HELPER_SCRIPTS={{user `helper_script_folder`}}",
|
|
"BOOST_VERSIONS=1.69.0",
|
|
"BOOST_DEFAULT=1.69.0"
|
|
],
|
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
|
},
|
|
{
|
|
"type": "file",
|
|
"source": "{{user `metadata_file`}}",
|
|
"destination": "{{template_dir}}/Ubuntu1804-README.md",
|
|
"direction": "download"
|
|
},
|
|
{
|
|
"type": "shell",
|
|
"inline": [
|
|
"rm -rf {{user `helper_script_folder`}}",
|
|
"rm -rf {{user `installer_script_folder`}}",
|
|
"chmod 755 {{user `image_folder`}}"
|
|
],
|
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
|
},
|
|
{
|
|
"type": "file",
|
|
"source": "{{template_dir}}/config/ubuntu1804.conf",
|
|
"destination": "/tmp/"
|
|
},
|
|
{
|
|
"type": "shell",
|
|
"inline": [
|
|
"mkdir -p /etc/vsts",
|
|
"cp /tmp/ubuntu1804.conf /etc/vsts/machine_instance.conf"
|
|
],
|
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
|
},
|
|
{
|
|
"type": "shell",
|
|
"inline": [
|
|
"sleep 30",
|
|
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
|
|
],
|
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
|
}
|
|
]
|
|
}
|