Skip to content

Commit

Permalink
Fixed heroku#129 according to the @friism's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jgkim committed May 10, 2016
1 parent add0357 commit 99bb365
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions commands/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,21 @@ function createDockerCompose(procfile, addons, mountDir) {
}

function addonToService(addon) {
return {
image: ADDONS[addon].image
};
var service = {}

// fallback for backward compatibility
if ((typeof ADDONS[addon].image) === 'string') {
service.image = ADDONS[addon].image;
} else {
service.image = ADDONS[addon].image.name;

// All the other properties except `image` are optional.
if ('env' in ADDONS[addon].image) {
service.environment = ADDONS[addon].image.env;
}
}

return service;
}
}

Expand Down

0 comments on commit 99bb365

Please sign in to comment.