11const yaml = require ( 'js-yaml' ) ;
22const fs = require ( 'fs' ) ;
33
4- const secrets = require ( './secrets' ) ;
5- const volumes = require ( './volumes' ) ;
6- const configs = require ( './configs' ) ;
7- const networks = require ( './networks' ) ;
8- const services = require ( './services' ) ;
4+ const secrets = require ( './lib/ secrets' ) ;
5+ const volumes = require ( './lib/ volumes' ) ;
6+ const configs = require ( './lib/ configs' ) ;
7+ const networks = require ( './lib/ networks' ) ;
8+ const services = require ( './lib/ services' ) ;
99
1010class Compose {
1111 constructor ( dockerode ) {
1212 this . docker = dockerode ;
1313 }
1414
15- async compose ( file , projectName ) {
15+ async up ( file , projectName ) {
1616 var self = this ;
1717 var output = { } ;
1818 if ( projectName === undefined ) {
@@ -21,11 +21,11 @@ class Compose {
2121 self . projectName = projectName ;
2222 try {
2323 self . recipe = yaml . load ( fs . readFileSync ( file , 'utf8' ) ) ;
24- output . secrets = await secrets ( self . docker , self . projectName , self . recipe ) ;
25- output . volumes = await volumes ( self . docker , self . projectName , self . recipe ) ;
26- output . configs = await configs ( self . docker , self . projectName , self . recipe ) ;
27- output . networks = await networks ( self . docker , self . projectName , self . recipe ) ;
28- output . services = await services ( self . docker , self . projectName , self . recipe ) ;
24+ output . secrets = await secrets ( self . docker , self . projectName , self . recipe , output ) ;
25+ output . volumes = await volumes ( self . docker , self . projectName , self . recipe , output ) ;
26+ output . configs = await configs ( self . docker , self . projectName , self . recipe , output ) ;
27+ output . networks = await networks ( self . docker , self . projectName , self . recipe , output ) ;
28+ output . services = await services ( self . docker , self . projectName , self . recipe , output ) ;
2929 return output ;
3030 } catch ( e ) {
3131 throw e ;
0 commit comments