Skip to content

Instantly share code, notes, and snippets.

@itayw
Created July 27, 2014 13:49
Show Gist options
  • Save itayw/210f09264faf20eb6374 to your computer and use it in GitHub Desktop.
Save itayw/210f09264faf20eb6374 to your computer and use it in GitHub Desktop.
var app = {
"name": "Create Application [" + boxname + "]",
"status": "pending",
"steps": [
{
"name": "Step 1: Create VM [" + boxname + "]",
"recipe": "vm/gce_addinstance",
"args": {
"id": boxname,
"name": boxname,
"datacenter": "europe-west1-b",
"image": "ubuntu-1404-joola-box-072-20140727-3",
"flavor": "g1-small"
}
},
{
"name": "Step 2: Wait for SSH [" + boxname + "]",
"recipe": "vm/waitforssh",
"args": {
"ip": "!{external_ip}",
"timeout": "180000"
}
},
{
"name": "Step 3: Prepare VM System [" + boxname + "]",
"recipe": "vm/sysprep",
"args": {
"ip": "!{external_ip}"
}
},
{
"name": "Step 4: Bootstrap VM [" + boxname + "]",
"recipe": "chef/bootstrap",
"args": {
"id": "!{id}",
"name": "!{name}",
"role": "joola-application",
"internal_ip": "!{internal_ip}",
"external_ip": "!{external_ip}",
"port": "12344"
}
},
{
"name": "Step 5: Tag VM [" + boxname + "]",
"recipe": "chef/tag",
"args": {
"id": "!{id}",
"name": "!{name}",
"type": "!{role}",
"internal_ip": "!{internal_ip}",
"external_ip": "!{external_ip}"
}
},
{
"name": "Step 6: Register VM with Router [" + boxname + "]",
"recipe": "router/register",
"args": {
"ip": "!{external_ip}",
"qdn": "!{name}.app.joo.la"
}
},
/*{
"name": "Step 7: Start joola [" + boxname + "]",
"recipe": "joola/start",
"args": {
"ip": "!{external_ip}"
}
},*/
{
"name": "Step 7: Configure VM as joola app [" + boxname + "]",
"recipe": "joola/configure",
"args": {
"engine": "https://!{qdn}",
"APIToken": "apitoken-demo",
"master": masterAPI,
"reader": readerAPI,
"writer": writerAPI
}
},
/*{
"name": "Step 8: NPM UPDATE [" + boxname + "]",
"recipe": "joola/update_sdk",
"args": {
"ip": "!{external_ip}"
}
},*/
{
"name": "Step 8: Restart joola [" + boxname + "]",
"recipe": "joola/restart",
"args": {
"ip": "!{external_ip}"
}
},
{
"name": "Step 9: Notification [" + boxname + "]",
"recipe": "notify/email",
"args": {
"email": "[email protected],[email protected]",
"subject": "[NEW APP] Successfuly created " + boxname,
"text": "A new application was created by: " + user.username
}
}
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment