redash/setup/packer.json
Arik Fraimovich 935dc38360
Update setup files: (#2908)
* Remove use of newgrp
* Updated packer configuration
2018-10-08 09:41:15 +03:00

66 lines
1.5 KiB
JSON

{
"variables": {
"redash_version": "",
"image_version": ""
},
"builders": [
{
"name": "redash-us-east-1",
"type": "amazon-ebs",
"region": "us-east-1",
"source_ami": "ami-0ac019f4fcb7cb7e6",
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "redash-{{user `image_version`}}-us-east-1"
},
{
"type": "googlecompute",
"project_id": "redash-bird-123",
"source_image_family": "ubuntu-1804-lts",
"zone": "us-central1-a",
"ssh_username": "arik"
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sleep 30"
]
},
{
"type": "shell",
"script": "setup.sh",
"execute_command": "{{ .Vars }} sudo -E -S bash '{{ .Path }}'",
"environment_vars": ["REDASH_VERSION={{user `redash_version`}}"]
},
{
"type": "shell",
"inline": "sudo rm /root/.ssh/authorized_keys || true"
},
{
"type": "shell",
"inline": "sudo rm /home/ubuntu/.ssh/authorized_keys || true"
},
{
"type": "file",
"source": "generate_key.sh",
"destination": "/tmp/rc.local"
},
{
"type": "shell",
"inline": ["sudo mv /tmp/rc.local /etc/rc.local", "sudo chown root /etc/rc.local", "sudo chmod 755 /etc/rc.local"]
}
],
"post-processors": [
{
"type": "googlecompute-export",
"only": ["googlecompute"],
"paths": [
"gs://redash-images/redash.{{user `redash_version`}}.tar.gz"
],
"keep_input_artifact": true
}
]
}