Skip to content

Commit

Permalink
[ADD] bind volume support #7
Browse files Browse the repository at this point in the history
  • Loading branch information
anak10thn committed Jan 4, 2017
1 parent 028ffd4 commit 1072336
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,22 @@ module.exports = {
name.forEach((val,k)=>{
var v = data[val];
/* Add volume type */
// NFS
if(v.type == "nfs"){
if(!v.address || !v.source || !v.target){
console.log("NFS data not valid!");
console.log("NFS volume is'n valid!");
process.exit(0);
}
volumes[name[k]] = "type=volume,volume-opt=o=addr="+v.address+",volume-opt=device=:"+v.source+",volume-opt=type=nfs,source="+name[k]+",target="+v.target;
}
// bind
if(v.type == "bind"){
if(!v.source || !v.target){
console.log("BIND volume is'n valid!");
process.exit(0);
}
volumes[name[k]] = "type=bind,src="+v.source+",dst="+v.target;
}
});
},
stack : (stack,services)=>{
Expand Down

0 comments on commit 1072336

Please sign in to comment.