diff --git a/dist/controllers/mainController.js b/dist/controllers/mainController.js index fcd8c5c..52ae378 100644 --- a/dist/controllers/mainController.js +++ b/dist/controllers/mainController.js @@ -32,7 +32,6 @@ class MainController { 'strip': '', 'syncImages': false, 'rsyncInstalled': false, - 'elasticSearchUsed': false, 'import': 'no', 'currentFolderIsShopware': false, }, diff --git a/dist/controllers/mainController.js.map b/dist/controllers/mainController.js.map index a20a68e..c6bbf07 100644 --- a/dist/controllers/mainController.js.map +++ b/dist/controllers/mainController.js.map @@ -1 +1 @@ -{"version":3,"file":"mainController.js","sourceRoot":"","sources":["../../src/controllers/mainController.ts"],"names":[],"mappings":";;;AAAA,aAAa;AACb,uFAAmD;AACnD,uCAAgC;AAChC,sFAAsD;AACtD,+CAAwB;AACxB,mDAA4B;AAC5B,mCAA+B;AAC/B,4EAA2C;AAC3C,gEAA+B;AAC/B,kBAAQ,CAAC,cAAc,CAAC,aAAa,EAAE,OAAO,CAAC,yCAAyC,CAAC,CAAC,CAAC;AAG3F,MAAM,cAAc;IAkDhB;QAjDO,WAAM,GAAG;YACZ,cAAc,EAAE;gBACZ,gBAAgB,EAAE,uBAAU,CAAC,GAAG,CAAC,WAAW;gBAC5C,eAAe,EAAE,uBAAU,CAAC,GAAG,CAAC,UAAU;gBAC1C,6BAA6B,EAAE,uBAAU,CAAC,OAAO,CAAC,gBAAgB;aACrE;YACD,iBAAiB,EAAE;gBACf,iBAAiB,EAAE,EAAE;gBACrB,cAAc,EAAE,EAAE;gBAClB,cAAc,EAAE,EAAE;aACrB;YACD,UAAU,EAAE;gBACR,eAAe,EAAE,EAAE;gBACnB,mBAAmB,EAAE,EAAE;gBACvB,kBAAkB,EAAE,EAAE;gBACtB,kBAAkB,EAAE,EAAE;gBACtB,OAAO,EAAE,EAAE;gBACX,YAAY,EAAE,KAAK;gBACnB,gBAAgB,EAAE,KAAK;gBACvB,mBAAmB,EAAE,KAAK;gBAC1B,QAAQ,EAAE,IAAI;gBACd,yBAAyB,EAAE,KAAK;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AAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;QAC7G,CAAC,CAAA,CAAA;QApBG,IAAI,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE,CAAC;IAClC,CAAC;CAoBJ;AAED,kBAAe,cAAc,CAAA"} \ No newline at end of file +{"version":3,"file":"mainController.js","sourceRoot":"","sources":["../../src/controllers/mainController.ts"],"names":[],"mappings":";;;AAAA,aAAa;AACb,uFAAmD;AACnD,uCAAgC;AAChC,sFAAsD;AACtD,+CAAwB;AACxB,mDAA4B;AAC5B,mCAA+B;AAC/B,4EAA2C;AAC3C,gEAA+B;AAC/B,kBAAQ,CAAC,cAAc,CAAC,aAAa,EAAE,OAAO,CAAC,yCAAyC,CAAC,CAAC,CAAC;AAG3F,MAAM,cAAc;IAiDhB;QAhDO,WAAM,GAAG;YACZ,cAAc,EAAE;gBACZ,gBAAgB,EAAE,uBAAU,CAAC,GAAG,CAAC,WAAW;gBAC5C,eAAe,EAAE,uBAAU,CAAC,GAAG,CAAC,UAAU;gBAC1C,6BAA6B,EAAE,uBAAU,CAAC,OAAO,CAAC,gBAAgB;aACrE;YACD,iBAAiB,EAAE;gBACf,iBAAiB,EAAE,EAAE;gBACrB,cAAc,EAAE,EAAE;gBAClB,cAAc,EAAE,EAAE;aACrB;YACD,UAAU,EAAE;gBACR,eAAe,EAAE,EAAE;gBACnB,mBAAmB,EAAE,EAAE;gBACvB,kBAAkB,EAAE,EAAE;gBACtB,kBAAkB,EAAE,EAAE;gBACtB,OAAO,EAAE,EAAE;gBACX,YAAY,EAAE,KAAK;gBACnB,gBAAgB,EAAE,KAAK;gBACvB,QAAQ,EAAE,IAAI;gBACd,yBAAyB,EAAE,KAAK;aACnC;YACD,WAAW,EAAE;gBACT,UAAU,EAAE,EAAE;gBACd,UAAU,EAAE,EAAE;gBACd,MAAM,EAAE,EAAE;gBACV,MAAM,EAAE,EAAE;gBACV,UAAU,EAAE,EAAE;gBACd,WAAW,E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;CAoBJ;AAED,kBAAe,cAAc,CAAA"} \ No newline at end of file diff --git a/dist/questions/configurationQuestions.js b/dist/questions/configurationQuestions.js index 91a1b64..c02b2b8 100644 --- a/dist/questions/configurationQuestions.js +++ b/dist/questions/configurationQuestions.js @@ -17,6 +17,8 @@ class ConfigurationQuestions { config.settings.strip = answers.strip; // Set import setting for Shopware config.settings.import = answers.import; + // Set image import setting for Shopware + config.settings.syncImages = answers.syncImages; // Change location of database download depending on answer if (config.settings.import == 'yes') { config.customConfig.localDatabaseFolderLocation = config.settings.currentFolder; @@ -50,6 +52,18 @@ class ConfigurationQuestions { return false; }, }); + if (config.settings.rsyncInstalled) { + this.questionsOne.push({ + type: 'list', + name: 'syncImages', + default: 'yes', + message: 'Synchronize images from public/media?', + choices: ['yes', 'no'], + validate: (input) => { + return false; + }, + }); + } } }); } diff --git a/dist/questions/configurationQuestions.js.map b/dist/questions/configurationQuestions.js.map index 8a7d68b..1e45c63 100644 --- a/dist/questions/configurationQuestions.js.map +++ b/dist/questions/configurationQuestions.js.map @@ -1 +1 @@ -{"version":3,"file":"configurationQuestions.js","sourceRoot":"","sources":["../../src/questions/configurationQuestions.ts"],"names":[],"mappings":";;;AAAA,qCAAgC;AAChC,gEAA+B;AAE/B,MAAM,sBAAsB;IAA5B;QACY,iBAAY,GAAG,EAAE,CAAC;QAClB,iBAAY,GAAG,EAAE,CAAC;QAE1B,cAAS,GAAG,CAAO,MAAW,EAAE,EAAE;YAC9B,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;YAEhC,qBAAqB;YACrB,MAAM,kBAAQ;iBACT,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;iBACzB,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;gBACd,uBAAuB;gBACvB,MAAM,CAAC,QAAQ,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;gBAEtC,kCAAkC;gBAClC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;gBAEvC,2DAA2D;gBAC3D,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,IAAI,KAAK,EAAE;oBACjC,MAAM,CAAC,YAAY,CAAC,2BAA2B,GAAG,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC;iBACnF;YACL,CAAC,CAAC;iBACD,KAAK,CAAC,CAAC,GAAsB,EAAE,EAAE;gBAC9B,eAAK,CAAC,yBAAyB,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;YACjD,CAAC,CAAC,CAAC;QACX,CAAC,CAAA,CAAA;QAED,gBAAgB;QAChB,iBAAY,GAAG,CAAO,MAAW,EAAE,EAAE;YACjC,IAAI,CAAC,YAAY,CAAC,IAAI,CAClB;gBACI,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,UAAU;gBACnB,OAAO,EAAE,iEAAiE;gBAC1E,OAAO,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC;gBAC7B,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE;oBACxB,OAAO,KAAK,KAAK,EAAE,CAAA;gBACvB,CAAC;aACJ,CACJ,CAAC;YAEF,mDAAmD;YACnD,IAAI,MAAM,CAAC,QAAQ,CAAC,uBAAuB,EAAE;gBACzC,IAAI,CAAC,YAAY,CAAC,IAAI,CAClB;oBACI,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE,2BAA2B;oBACpC,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;oBACtB,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE;wBACxB,OAAO,KAAK,CAAC;oBACjB,CAAC;iBACJ,CACJ,CAAC;aACL;QACL,CAAC,CAAA,CAAA;IACL,CAAC;CAAA;AAED,kBAAe,sBAAsB,CAAA"} \ No newline at end of file +{"version":3,"file":"configurationQuestions.js","sourceRoot":"","sources":["../../src/questions/configurationQuestions.ts"],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Aa,EAAE,EAAE;oBACxB,OAAO,KAAK,KAAK,EAAE,CAAA;gBACvB,CAAC;aACJ,CACJ,CAAC;YAEF,mDAAmD;YACnD,IAAI,MAAM,CAAC,QAAQ,CAAC,uBAAuB,EAAE;gBACzC,IAAI,CAAC,YAAY,CAAC,IAAI,CAClB;oBACI,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,KAAK;oBACd,OAAO,EAAE,2BAA2B;oBACpC,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;oBACtB,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE;wBACxB,OAAO,KAAK,CAAC;oBACjB,CAAC;iBACJ,CACJ,CAAC;gBAEF,IAAI,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE;oBAChC,IAAI,CAAC,YAAY,CAAC,IAAI,CAClB;wBACI,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,YAAY;wBAClB,OAAO,EAAE,KAAK;wBACd,OAAO,EAAE,uCAAuC;wBAChD,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;wBACtB,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE;4BACxB,OAAO,KAAK,CAAC;wBACjB,CAAC;qBACJ,CACJ,CAAC;iBACL;aACJ;QACL,CAAC,CAAA,CAAA;IACL,CAAC;CAAA;AAED,kBAAe,sBAAsB,CAAA"} \ No newline at end of file diff --git a/dist/tasks/downloadTask.js.map b/dist/tasks/downloadTask.js.map index 1cbe6fa..22f596e 100644 --- a/dist/tasks/downloadTask.js.map +++ b/dist/tasks/downloadTask.js.map @@ -1 +1 @@ -{"version":3,"file":"downloadTask.js","sourceRoot":"","sources":["../../src/tasks/downloadTask.ts"],"names":[],"mappings":";;;AAAA,8CAA0H;AAE1H,aAAa;AAEb,MAAM,YAAY;IAAlB;QACY,kBAAa,GAAG,EAAE,CAAC;QAE3B,cAAS,GAAG,CAAO,IAAS,EAAE,MAAW,EAAE,GAAQ,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/importTask.js b/dist/tasks/importTask.js index ce98d69..53a653e 100644 --- a/dist/tasks/importTask.js +++ b/dist/tasks/importTask.js @@ -51,6 +51,17 @@ class ImportTask { yield console_1.localhostShopwareRootExec(`mysql -u ${config.localhost.username} --password=${config.localhost.password} ${config.localhost.database} --force < ${config.settings.databaseFullPath}/${config.settings.databaseFileName}.sql`, config, true); }) }); + if (config.settings.syncImages) { + this.importTasks.push({ + title: 'Synchronizing public/media & public/thumbnail', + task: () => tslib_1.__awaiter(this, void 0, void 0, function* () { + // Sync media + yield console_1.localhostShopwareRootExec(`rsync -avz -e "ssh -p ${config.databases.databaseData.port}" ${config.databases.databaseData.username}@${config.databases.databaseData.server}:${config.serverVariables.shopwareRoot}/public/media/* public/media/`, config, true); + // Sync thumbnail + yield console_1.localhostShopwareRootExec(`rsync -avz -e "ssh -p ${config.databases.databaseData.port}" ${config.databases.databaseData.username}@${config.databases.databaseData.server}:${config.serverVariables.shopwareRoot}/public/thumbnail/* public/thumbnail/`, config, true); + }) + }); + } this.importTasks.push({ title: 'Cleaning up', task: () => tslib_1.__awaiter(this, void 0, void 0, function* () { diff --git a/dist/tasks/importTask.js.map b/dist/tasks/importTask.js.map index 04465a7..2d304a6 100644 --- a/dist/tasks/importTask.js.map +++ b/dist/tasks/importTask.js.map @@ -1 +1 @@ -{"version":3,"file":"importTask.js","sourceRoot":"","sources":["../../src/tasks/importTask.ts"],"names":[],"mappings":";;;AAAA,8CAAmF;AAGnF,MAAM,UAAU;IAAhB;QACY,gBAAW,GAAG,EAAE,CAAC;QAEzB,cAAS,GAAG,CAAO,IAAS,EAAE,MAAW,EAAE,EAAE;YACzC,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAClC,OAAO,IAAI,CAAC;QAChB,CAAC,CAAA,CAAA;QAED,YAAY;QACZ,aAAQ,GAAG,CAAO,IAAS,EAAE,MAAW,EAAE,EAAE;YACxC,IAAI,CAAC,GAAG,CACJ;gBACI,KA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AAC;QACN,CAAC,CAAA,CAAA;IACL,CAAC;CAAA;AAED,kBAAe,UAAU,CAAA"} \ No newline at end of file diff --git a/dist/tasks/shopwareConfigureTask.js b/dist/tasks/shopwareConfigureTask.js index 82cb202..dd51b1d 100644 --- a/dist/tasks/shopwareConfigureTask.js +++ b/dist/tasks/shopwareConfigureTask.js @@ -21,24 +21,26 @@ class ShopwareConfigureTask { task: () => tslib_1.__awaiter(this, void 0, void 0, function* () { yield console_1.localhostShopwareRootExec(`bin/console sales-channel:update:domain ${config.localhost.domainUrl}`, config); if (config.localhost.https) { - yield console_1.localhostShopwareRootExec(`mysql -u ${config.localhost.username} --password=${config.localhost.password} ${config.localhost.database} -e "UPDATE sales_channel_domain SET url = REPLACE(url,'http://', 'https://');"`, config); + yield console_1.localhostShopwareRootMysqlExec("UPDATE sales_channel_domain SET url = REPLACE(url,'http://', 'https://')", config); config.finalMessages.importDomain = `https://${config.localhost.domainUrl}`; } else { - yield console_1.localhostShopwareRootExec(`mysql -u ${config.localhost.username} --password=${config.localhost.password} ${config.localhost.database} -e "UPDATE sales_channel_domain SET url = REPLACE(url,'https://', 'http://');"`, config); + yield console_1.localhostShopwareRootMysqlExec("UPDATE sales_channel_domain SET url = REPLACE(url,'https://', 'http://')", config); config.finalMessages.importDomain = `http://${config.localhost.domainUrl}`; } }) }); - this.configureTasks.push({ - title: "Emptying media tables", - task: () => tslib_1.__awaiter(this, void 0, void 0, function* () { - // Product media - yield console_1.localhostShopwareRootExec(`mysql -u ${config.localhost.username} --password=${config.localhost.password} ${config.localhost.database} -e "TRUNCATE TABLE product_media"`, config); - // Theme media - yield console_1.localhostShopwareRootExec(`mysql -u ${config.localhost.username} --password=${config.localhost.password} ${config.localhost.database} -e "TRUNCATE TABLE theme_media"`, config); - }) - }); + if (!config.settings.syncImages) { + this.configureTasks.push({ + title: "Emptying media tables", + task: () => tslib_1.__awaiter(this, void 0, void 0, function* () { + // Product media + yield console_1.localhostShopwareRootMysqlExec('TRUNCATE TABLE product_media', config); + // Theme media + yield console_1.localhostShopwareRootMysqlExec('TRUNCATE TABLE theme_media', config); + }) + }); + } this.configureTasks.push({ title: "Compiling theme", task: () => tslib_1.__awaiter(this, void 0, void 0, function* () { diff --git a/dist/tasks/shopwareConfigureTask.js.map b/dist/tasks/shopwareConfigureTask.js.map index 8436d29..a4b9961 100644 --- a/dist/tasks/shopwareConfigureTask.js.map +++ b/dist/tasks/shopwareConfigureTask.js.map @@ -1 +1 @@ -{"version":3,"file":"shopwareConfigureTask.js","sourceRoot":"","sources":["../../src/tasks/shopwareConfigureTask.ts"],"names":[],"mappings":";;;AAAA,8CAA2D;AAE3D,uFAAmD;AAEnD,MAAM,qBAAqB;IAA3B;QACY,mBAAc,GAAG,EAAE,CAAC;QAE5B,cAAS,GAAG,CAAO,IAAS,EAAE,MAAW,EAAE,EAAE;YACzC,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAClC,OAAO,IAAI,CAAC;QAChB,CAAC,CAAA,CAAA;QAED,YAAY;QACZ,aAAQ,GAAG,CAAO,IAAS,EAAE,MAAW,EAAE,EAAE;YACxC,IAAI,CAAC,GAAG,CACJ;gBACI,KAAK,EAAE,8CAA8C;gBACrD,IAAI,EAAE,CAAC,GAAQ,EAAE,IAAS,EAAS,EAAE,CACrC,IAAI,CAAC,QAAQ,CACT,IAAI,CAAC,cAAc,CACtB;aACJ,CACJ,CAAA;YAED,IAAI,CAAC,cAAc,CAAC,IAAI,CACpB;gBACI,KAAK,EAAE,gCAAgC;gBACvC,IAAI,EAAE,GAAwB,EAAE;oBAC5B,MAAM,mCAAyB,CAAC,2CAA2C,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC;oBAEjH,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE;wBACxB,MAAM,mCAAyB,CAAC,YAAY,MAAM,CAAC,SAAS,CAAC,QAAQ,eAAe,MAAM,CAAC,SAAS,CAA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AAC,IAAI,CACpB;gBACI,KAAK,EAAE,uBAAuB;gBAC9B,IAAI,EAAE,GAAwB,EAAE;oBAC5B,MAAM,mCAAyB,CAAC,8BAA8B,uBAAU,CAAC,eAAe,CAAC,aAAa,OAAO,uBAAU,CAAC,eAAe,CAAC,aAAa,YAAY,uBAAU,CAAC,eAAe,CAAC,iBAAiB,EAAE,EAAE,MAAM,CAAC,CAAC;gBAC7N,CAAC,CAAA;aACJ,CACJ,CAAC;YAEF,IAAI,CAAC,cAAc,CAAC,IAAI,CACpB;gBACI,KAAK,EAAE,0BAA0B;gBACjC,IAAI,EAAE,GAAwB,EAAE;oBAC5B,UAAU;oBACV,MAAM,mCAAyB,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC;oBACnE,gBAAgB;oBAChB,MAAM,mCAAyB,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC;gBACvE,CAAC,CAAA;aACJ,CACJ,CAAC;YAEF,IAAI,CAAC,cAAc,CAAC,IAAI,CACpB;gBACI,KAAK,EAAE,4BAA4B;gBACnC,IAAI,EAAE,GAAwB,EAAE;oBAC5B,mDAAmD;oBACnD,MAAM,mCAAyB,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC;gBACvE,CAAC,CAAA;aACJ,CACJ,CAAC;QACN,CAAC,CAAA,CAAA;IACL,CAAC;CAAA;AAED,kBAAe,qBAAqB,CAAA"} \ No newline at end of file +{"version":3,"file":"shopwareConfigureTask.js","sourceRoot":"","sources":["../../src/tasks/shopwareConfigureTask.ts"],"names":[],"mappings":";;;AAAA,8CAA2F;AAE3F,uFAAmD;AAEnD,MAAM,qBAAqB;IAA3B;QACY,mBAAc,GAAG,EAAE,CAAC;QAE5B,cAAS,GAAG,CAAO,IAAS,EAAE,MAAW,EAAE,EAAE;YACzC,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAClC,OAAO,IAAI,CAAC;QAChB,CAAC,CAAA,CAAA;QAED,YAAY;Q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,IAAI,CACpB;gBACI,KAAK,EAAE,iBAAiB;gBACxB,IAAI,EAAE,GAAwB,EAAE;oBAC5B,MAAM,mCAAyB,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC;gBACzE,CAAC,CAAA;aACJ,CACJ,CAAC;YAEF,IAAI,CAAC,cAAc,CAAC,IAAI,CACpB;gBACI,KAAK,EAAE,uBAAuB;gBAC9B,IAAI,EAAE,GAAwB,EAAE;oBAC5B,MAAM,mCAAyB,CAAC,8BAA8B,uBAAU,CAAC,eAAe,CAAC,aAAa,OAAO,uBAAU,CAAC,eAAe,CAAC,aAAa,YAAY,uBAAU,CAAC,eAAe,CAAC,iBAAiB,EAAE,EAAE,MAAM,CAAC,CAAC;gBAC7N,CAAC,CAAA;aACJ,CACJ,CAAC;YAEF,IAAI,CAAC,cAAc,CAAC,IAAI,CACpB;gBACI,KAAK,EAAE,0BAA0B;gBACjC,IAAI,EAAE,GAAwB,EAAE;oBAC5B,UAAU;oBACV,MAAM,mCAAyB,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC;oBACnE,gBAAgB;oBAChB,MAAM,mCAAyB,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC;gBACvE,CAAC,CAAA;aACJ,CACJ,CAAC;YAEF,IAAI,CAAC,cAAc,CAAC,IAAI,CACpB;gBACI,KAAK,EAAE,4BAA4B;gBACnC,IAAI,EAAE,GAAwB,EAAE;oBAC5B,mDAAmD;oBACnD,MAAM,mCAAyB,CAAC,yBAAyB,EAAE,MAAM,CAAC,CAAC;gBACvE,CAAC,CAAA;aACJ,CACJ,CAAC;QACN,CAAC,CAAA,CAAA;IACL,CAAC;CAAA;AAED,kBAAe,qBAAqB,CAAA"} \ No newline at end of file diff --git a/dist/utils/console.js b/dist/utils/console.js index 0cee115..3047105 100644 --- a/dist/utils/console.js +++ b/dist/utils/console.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.extractDatabaseDetails = exports.localhostRsyncDownloadCommand = exports.localhostShopwareRootExec = exports.sshShopwareRootFolderPhpCommand = exports.sshNavigateToShopwareRootCommand = exports.consoleCommand = exports.clearConsole = exports.emptyLine = exports.url = exports.error = exports.warning = exports.success = exports.info = exports.verbose = void 0; +exports.localhostShopwareRootMysqlExec = exports.extractDatabaseDetails = exports.localhostRsyncDownloadCommand = exports.localhostShopwareRootExec = exports.sshShopwareRootFolderPhpCommand = exports.sshNavigateToShopwareRootCommand = exports.consoleCommand = exports.clearConsole = exports.emptyLine = exports.url = exports.error = exports.warning = exports.success = exports.info = exports.verbose = void 0; const tslib_1 = require("tslib"); const kleur_1 = tslib_1.__importDefault(require("kleur")); const readline = tslib_1.__importStar(require("readline")); @@ -106,6 +106,10 @@ const localhostRsyncDownloadCommand = (source, destination, config) => { return consoleCommand(totalRsyncCommand, false); }; exports.localhostRsyncDownloadCommand = localhostRsyncDownloadCommand; +const localhostShopwareRootMysqlExec = (command, config) => { + return localhostShopwareRootExec(`mysql -u ${config.localhost.username} --password=${config.localhost.password} ${config.localhost.database} -e "${command}"`, config); +}; +exports.localhostShopwareRootMysqlExec = localhostShopwareRootMysqlExec; const extractDatabaseDetails = (string) => { var details = string, details = details.replace('DATABASE_URL="mysql', '').replace('//', '').replace('"', '').replace('@', ':').replace('/', ':'), details = details.split(':'), details = details.filter((a) => a); let detailsObject = { diff --git a/dist/utils/console.js.map b/dist/utils/console.js.map index 9116303..a73848c 100644 --- a/dist/utils/console.js.map +++ b/dist/utils/console.js.map @@ -1 +1 @@ -{"version":3,"file":"console.js","sourceRoot":"","sources":["../../src/utils/console.ts"],"names":[],"mappings":";;;;AAAA,0DAAyB;AACzB,2DAAoC;AAGpC,MAAM,MAAM,GAAG;IACX,OAAO,EAAE,eAAK,CAAC,IAAI,CAAC,eAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,EAAE,eAAK,CAAC,IAAI,CAAC,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACl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AAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE;QACnE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;QACvB,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;QACvB,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;KAC9B,CAAC;IAEF,OAAO,aAAa,CAAC;AACzB,CAAC,CAAA;AAgBG,wDAAsB"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index b02bcdc..cc0dc93 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "sw-db-sync", - "version": "0.1.5", + "version": "0.1.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4133a13..9a8eb65 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sw-db-sync", - "version": "0.1.5", + "version": "0.1.6", "description": "Database synchronizer for Shopware 6", "author": { "name": "Jelle Siderius" diff --git a/src/controllers/mainController.ts b/src/controllers/mainController.ts index b81c135..a7c7946 100644 --- a/src/controllers/mainController.ts +++ b/src/controllers/mainController.ts @@ -30,7 +30,6 @@ class MainController { 'strip': '', 'syncImages': false, 'rsyncInstalled': false, - 'elasticSearchUsed': false, 'import': 'no', 'currentFolderIsShopware': false, }, diff --git a/src/questions/configurationQuestions.ts b/src/questions/configurationQuestions.ts index 099e853..30a83f3 100644 --- a/src/questions/configurationQuestions.ts +++ b/src/questions/configurationQuestions.ts @@ -18,6 +18,9 @@ class ConfigurationQuestions { // Set import setting for Shopware config.settings.import = answers.import + // Set image import setting for Shopware + config.settings.syncImages = answers.syncImages + // Change location of database download depending on answer if (config.settings.import == 'yes') { config.customConfig.localDatabaseFolderLocation = config.settings.currentFolder; @@ -57,6 +60,21 @@ class ConfigurationQuestions { }, } ); + + if (config.settings.rsyncInstalled) { + this.questionsOne.push( + { + type: 'list', + name: 'syncImages', + default: 'yes', + message: 'Synchronize images from public/media?', + choices: ['yes', 'no'], + validate: (input: string) => { + return false; + }, + } + ); + } } } } diff --git a/src/tasks/downloadTask.ts b/src/tasks/downloadTask.ts index 8016dbf..40dcf85 100644 --- a/src/tasks/downloadTask.ts +++ b/src/tasks/downloadTask.ts @@ -48,6 +48,7 @@ class DownloadTask { if (result) { let serverValues = result.stdout.split("\n"); config.serverVariables.shopwareRoot = serverValues[0]; + // Get PHP path config.serverVariables.externalPhpPath = serverValues[1]; } diff --git a/src/tasks/importTask.ts b/src/tasks/importTask.ts index 42c8b64..0ea736d 100644 --- a/src/tasks/importTask.ts +++ b/src/tasks/importTask.ts @@ -71,6 +71,21 @@ class ImportTask { } ); + if (config.settings.syncImages) { + this.importTasks.push( + { + title: 'Synchronizing public/media & public/thumbnail', + task: async (): Promise => { + // Sync media + await localhostShopwareRootExec(`rsync -avz -e "ssh -p ${config.databases.databaseData.port}" ${config.databases.databaseData.username}@${config.databases.databaseData.server}:${config.serverVariables.shopwareRoot}/public/media/* public/media/`, config, true); + + // Sync thumbnail + await localhostShopwareRootExec(`rsync -avz -e "ssh -p ${config.databases.databaseData.port}" ${config.databases.databaseData.username}@${config.databases.databaseData.server}:${config.serverVariables.shopwareRoot}/public/thumbnail/* public/thumbnail/`, config, true); + } + } + ); + } + this.importTasks.push( { title: 'Cleaning up', diff --git a/src/tasks/shopwareConfigureTask.ts b/src/tasks/shopwareConfigureTask.ts index 04b5f8e..b664fc7 100644 --- a/src/tasks/shopwareConfigureTask.ts +++ b/src/tasks/shopwareConfigureTask.ts @@ -1,4 +1,4 @@ -import {localhostShopwareRootExec} from '../utils/console'; +import {localhostShopwareRootExec, localhostShopwareRootMysqlExec} from '../utils/console'; import { Listr } from 'listr2'; import configFile from '../../config/settings.json' @@ -29,28 +29,30 @@ class ShopwareConfigureTask { await localhostShopwareRootExec(`bin/console sales-channel:update:domain ${config.localhost.domainUrl}`, config); if (config.localhost.https) { - await localhostShopwareRootExec(`mysql -u ${config.localhost.username} --password=${config.localhost.password} ${config.localhost.database} -e "UPDATE sales_channel_domain SET url = REPLACE(url,'http://', 'https://');"`, config); + await localhostShopwareRootMysqlExec("UPDATE sales_channel_domain SET url = REPLACE(url,'http://', 'https://')", config); config.finalMessages.importDomain = `https://${config.localhost.domainUrl}`; } else { - await localhostShopwareRootExec(`mysql -u ${config.localhost.username} --password=${config.localhost.password} ${config.localhost.database} -e "UPDATE sales_channel_domain SET url = REPLACE(url,'https://', 'http://');"`, config); + await localhostShopwareRootMysqlExec("UPDATE sales_channel_domain SET url = REPLACE(url,'https://', 'http://')", config); config.finalMessages.importDomain = `http://${config.localhost.domainUrl}`; } } } ); - this.configureTasks.push( - { - title: "Emptying media tables", - task: async (): Promise => { - // Product media - await localhostShopwareRootExec(`mysql -u ${config.localhost.username} --password=${config.localhost.password} ${config.localhost.database} -e "TRUNCATE TABLE product_media"`, config); + if (!config.settings.syncImages) { + this.configureTasks.push( + { + title: "Emptying media tables", + task: async (): Promise => { + // Product media + await localhostShopwareRootMysqlExec('TRUNCATE TABLE product_media', config); - // Theme media - await localhostShopwareRootExec(`mysql -u ${config.localhost.username} --password=${config.localhost.password} ${config.localhost.database} -e "TRUNCATE TABLE theme_media"`, config); + // Theme media + await localhostShopwareRootMysqlExec('TRUNCATE TABLE theme_media', config); + } } - } - ); + ); + } this.configureTasks.push( { diff --git a/src/utils/console.ts b/src/utils/console.ts index d0925c2..2b7d811 100644 --- a/src/utils/console.ts +++ b/src/utils/console.ts @@ -110,6 +110,10 @@ const localhostRsyncDownloadCommand = (source: string, destination: string, conf return consoleCommand(totalRsyncCommand, false) } +const localhostShopwareRootMysqlExec = (command: string, config: any) => { + return localhostShopwareRootExec(`mysql -u ${config.localhost.username} --password=${config.localhost.password} ${config.localhost.database} -e "${command}"`, config); +} + const extractDatabaseDetails = (string: string) => { var details = string, details = details.replace('DATABASE_URL="mysql', '').replace('//', '').replace('"', '').replace('@', ':').replace('/', ':'), @@ -141,5 +145,6 @@ export { sshShopwareRootFolderPhpCommand, localhostShopwareRootExec, localhostRsyncDownloadCommand, - extractDatabaseDetails + extractDatabaseDetails, + localhostShopwareRootMysqlExec }