Skip to content

Instantly share code, notes, and snippets.

@usmanismail
Created October 20, 2015 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usmanismail/f704fb094ea10506a40e to your computer and use it in GitHub Desktop.
Save usmanismail/f704fb094ea10506a40e to your computer and use it in GitHub Desktop.
{
"variables": {
"app_name": null,
"env_name": null,
"lifecycle": null,
"subnet_id": null,
"source_ami": "ami-0d4cfd66",
"ssh_keypair_name": null,
"ssh_private_key_file": null,
"war_path": null,
"branch_name": null,
"security_group_id_1": null,
"security_group_id_2": null,
"iam_instance_profile": "XXXXXXXX",
"builder_instance":"c4.large",
"TargetWarFileName": null,
},
"builders": [
{
"type": "amazon-ebs",
"region": "us-east-1",
"source_ami": "{{user `source_ami`}}",
"instance_type": "{{user `builder_instance`}}",
"ssh_username": "ec2-user",
"ami_name": "{{user `app_name`}}-{{user `build_date`}}-{{user `env_name`}}",
"subnet_id": "{{user `subnet_id`}}",
"security_group_ids": [
"{{user `security_group_id_1`}}",
"{{user `security_group_id_2`}}"
],
"ssh_keypair_name": "{{user `ssh_keypair_name`}}",
"ssh_private_key_file": "{{user `ssh_private_key_file`}}",
"ssh_private_ip": "true",
"communicator": "ssh",
"ssh_pty": true,
"iam_instance_profile": "{{user `iam_instance_profile`}}",
"tags": {
"BranchName": "{{user `branch_name`}}",
}
}
],
"provisioners": [
{
"type": "file",
"source": "{{user `war_path`}}",
"destination": "/tmp/WAR_NAME.war"
},
{
"type": "shell",
"script": "script/tomcat_setup.sh",
"execute_command":"chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh {{ .Path }}",
"environment_vars": [
"TargetWarFileName={{user `target_war_name`}}",
"ENV_NAME={{user `env_name`}}"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment