diff --git a/.gitignore b/.gitignore index 6fdc62d..5a53a79 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +dist + # OS Specific .DS_Store .DS_Store? diff --git a/dist/actions/android_init.js b/dist/actions/android_init.js deleted file mode 100644 index 31337cb..0000000 --- a/dist/actions/android_init.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _buildAndroid_build = require('../build/android_build'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(CONFIGFILE); - (0, _buildAndroid_build.androidInit)({ config: config, environment: environment }); - done(null, 'android is init'); -}; - -module.exports = exports['default']; -//# sourceMappingURL=android_init.js.map \ No newline at end of file diff --git a/dist/actions/android_init.js.map b/dist/actions/android_init.js.map deleted file mode 100644 index 41d1541..0000000 --- a/dist/actions/android_init.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/actions/android_init.js"],"names":[],"mappings":";;;;;;kCAA4B,wBAAwB;;iCACzB,uBAAuB;;AAElD,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAEtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,mCAAW,UAAU,CAAC,CAAC;AACtC,uCAAY,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;AACrC,MAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;CAC/B","file":"android_init.js","sourcesContent":["import { androidInit } from '../build/android_build';\nimport { readConfig } from '../utils/config_utils';\n\nconst CONFIGFILE = '.catladder.yaml';\n\nexport default (environment, done) => {\n const config = readConfig(CONFIGFILE);\n androidInit({ config, environment });\n done(null, 'android is init');\n};\n"]} \ No newline at end of file diff --git a/dist/actions/android_prepare_for_store.js b/dist/actions/android_prepare_for_store.js deleted file mode 100644 index 3de9dc0..0000000 --- a/dist/actions/android_prepare_for_store.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _buildAndroid_build = require('../build/android_build'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(CONFIGFILE); - var outfile = (0, _buildAndroid_build.androidPrepareForStore)({ config: config, environment: environment }); - done(null, 'your apk is ready: ' + outfile); -}; - -module.exports = exports['default']; -//# sourceMappingURL=android_prepare_for_store.js.map \ No newline at end of file diff --git a/dist/actions/android_prepare_for_store.js.map b/dist/actions/android_prepare_for_store.js.map deleted file mode 100644 index 10c9f76..0000000 --- a/dist/actions/android_prepare_for_store.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/actions/android_prepare_for_store.js"],"names":[],"mappings":";;;;;;kCAAuC,wBAAwB;;iCACpC,uBAAuB;;AAElD,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAGtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,mCAAW,UAAU,CAAC,CAAC;AACtC,MAAM,OAAO,GAAG,gDAAuB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;AAChE,MAAI,CAAC,IAAI,0BAAwB,OAAO,CAAG,CAAC;CAC7C","file":"android_prepare_for_store.js","sourcesContent":["import { androidPrepareForStore } from '../build/android_build';\nimport { readConfig } from '../utils/config_utils';\n\nconst CONFIGFILE = '.catladder.yaml';\n\n\nexport default (environment, done) => {\n const config = readConfig(CONFIGFILE);\n const outfile = androidPrepareForStore({ config, environment });\n done(null, `your apk is ready: ${outfile}`);\n};\n"]} \ No newline at end of file diff --git a/dist/actions/build_apps.js b/dist/actions/build_apps.js deleted file mode 100644 index 69d0cda..0000000 --- a/dist/actions/build_apps.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _rimraf = require('rimraf'); - -var _rimraf2 = _interopRequireDefault(_rimraf); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _buildAndroid_build = require('../build/android_build'); - -var _configsDirectories = require('../configs/directories'); - -var _utilsGit_utils = require('../utils/git_utils'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var _uiAction_title = require('../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _android_prepare_for_store = require('./android_prepare_for_store'); - -var _android_prepare_for_store2 = _interopRequireDefault(_android_prepare_for_store); - -var _buildExec_meteor_build = require('../build/exec_meteor_build'); - -var _buildExec_meteor_build2 = _interopRequireDefault(_buildExec_meteor_build); - -var _ios_reveal_project = require('./ios_reveal_project'); - -var _ios_reveal_project2 = _interopRequireDefault(_ios_reveal_project); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(CONFIGFILE); - var buildDir = (0, _configsDirectories.getBuildDir)({ config: config, environment: environment }); - (0, _uiAction_title2['default'])('building mobile apps ' + (0, _utilsGit_utils.getFullVersionString)(environment)); - console.log('build dir: ' + buildDir); - - // remove project folders if existing - // otherwise apps might get bloated with old code - if (_fs2['default'].existsSync((0, _buildAndroid_build.getAndroidBuildProjectFolder)({ config: config, environment: environment }))) { - _rimraf2['default'].sync((0, _buildAndroid_build.getAndroidBuildProjectFolder)({ config: config, environment: environment })); - } - if (_fs2['default'].existsSync((0, _configsDirectories.getIosBuildProjectFolder)({ config: config, environment: environment }))) { - _rimraf2['default'].sync((0, _configsDirectories.getIosBuildProjectFolder)({ config: config, environment: environment })); - } - - (0, _buildExec_meteor_build2['default'])({ config: config, environment: environment }); - - // open ios project if exists - (0, _ios_reveal_project2['default'])(environment, config); - - // init android if it exists - if (_fs2['default'].existsSync((0, _buildAndroid_build.getAndroidBuildDir)({ config: config, environment: environment }))) { - (0, _android_prepare_for_store2['default'])(environment, done); - } else { - done(null, 'apps created in ' + buildDir); - } -}; - -module.exports = exports['default']; -//# sourceMappingURL=build_apps.js.map \ No newline at end of file diff --git a/dist/actions/build_apps.js.map b/dist/actions/build_apps.js.map deleted file mode 100644 index 85cd5ff..0000000 --- a/dist/actions/build_apps.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/actions/build_apps.js"],"names":[],"mappings":";;;;;;;;sBAAmB,QAAQ;;;;kBAEZ,IAAI;;;;kCAKZ,wBAAwB;;kCACuB,wBAAwB;;8BACzC,oBAAoB;;iCAC9B,uBAAuB;;8BAC1B,oBAAoB;;;;yCACT,6BAA6B;;;;sCACpC,4BAA4B;;;;kCAC3B,sBAAsB;;;;AAEnD,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAGtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,mCAAW,UAAU,CAAC,CAAC;AACtC,MAAM,QAAQ,GAAG,qCAAY,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;AACtD,6DAAoC,0CAAqB,WAAW,CAAC,CAAG,CAAC;AACzE,SAAO,CAAC,GAAG,iBAAe,QAAQ,CAAG,CAAC;;;;AAItC,MAAI,gBAAG,UAAU,CAAC,sDAA6B,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC,EAAE;AACxE,wBAAO,IAAI,CAAC,sDAA6B,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC,CAAC;GACpE;AACD,MAAI,gBAAG,UAAU,CAAC,kDAAyB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC,EAAE;AACpE,wBAAO,IAAI,CAAC,kDAAyB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC,CAAC;GAChE;;AAED,2CAAgB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;;;AAGzC,uCAAiB,WAAW,EAAE,MAAM,CAAC,CAAC;;;AAGtC,MAAI,gBAAG,UAAU,CAAC,4CAAmB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC,EAAE;AAC9D,gDAAuB,WAAW,EAAE,IAAI,CAAC,CAAC;GAC3C,MAAM;AACL,QAAI,CAAC,IAAI,uBAAqB,QAAQ,CAAG,CAAC;GAC3C;CACF","file":"build_apps.js","sourcesContent":["import rimraf from 'rimraf';\n\nimport fs from 'fs';\n\nimport {\n getAndroidBuildDir,\n getAndroidBuildProjectFolder,\n} from '../build/android_build';\nimport { getBuildDir, getIosBuildProjectFolder } from '../configs/directories';\nimport { getFullVersionString } from '../utils/git_utils';\nimport { readConfig } from '../utils/config_utils';\nimport actionTitle from '../ui/action_title';\nimport androidPrepareForStore from './android_prepare_for_store';\nimport execMeteorBuild from '../build/exec_meteor_build';\nimport iosRevealProject from './ios_reveal_project';\n\nconst CONFIGFILE = '.catladder.yaml';\n\n\nexport default (environment, done) => {\n const config = readConfig(CONFIGFILE);\n const buildDir = getBuildDir({ config, environment });\n actionTitle(`building mobile apps ${getFullVersionString(environment)}`);\n console.log(`build dir: ${buildDir}`);\n\n // remove project folders if existing\n // otherwise apps might get bloated with old code\n if (fs.existsSync(getAndroidBuildProjectFolder({ config, environment }))) {\n rimraf.sync(getAndroidBuildProjectFolder({ config, environment }));\n }\n if (fs.existsSync(getIosBuildProjectFolder({ config, environment }))) {\n rimraf.sync(getIosBuildProjectFolder({ config, environment }));\n }\n\n execMeteorBuild({ config, environment });\n\n // open ios project if exists\n iosRevealProject(environment, config);\n\n // init android if it exists\n if (fs.existsSync(getAndroidBuildDir({ config, environment }))) {\n androidPrepareForStore(environment, done);\n } else {\n done(null, `apps created in ${buildDir}`);\n }\n};\n"]} \ No newline at end of file diff --git a/dist/actions/build_server.js b/dist/actions/build_server.js deleted file mode 100644 index f9890c0..0000000 --- a/dist/actions/build_server.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _utilsGit_utils = require('../utils/git_utils'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var _uiAction_title = require('../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _buildExec_meteor_build = require('../build/exec_meteor_build'); - -var _buildExec_meteor_build2 = _interopRequireDefault(_buildExec_meteor_build); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(CONFIGFILE); - // read build params - (0, _uiAction_title2['default'])('building server ' + (0, _utilsGit_utils.getFullVersionString)(environment)); - - (0, _buildExec_meteor_build2['default'])({ config: config, environment: environment }, ['--server-only']); - done(null, 'server built'); -}; - -module.exports = exports['default']; -//# sourceMappingURL=build_server.js.map \ No newline at end of file diff --git a/dist/actions/build_server.js.map b/dist/actions/build_server.js.map deleted file mode 100644 index fcd9a2d..0000000 --- a/dist/actions/build_server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/actions/build_server.js"],"names":[],"mappings":";;;;;;;;8BAAqC,oBAAoB;;iCAC9B,uBAAuB;;8BAC1B,oBAAoB;;;;sCAChB,4BAA4B;;;;AAExD,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAGtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,mCAAW,UAAU,CAAC,CAAC;;AAEtC,wDAA+B,0CAAqB,WAAW,CAAC,CAAG,CAAC;;AAEpE,2CAAgB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;AAC5D,MAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;CAC5B","file":"build_server.js","sourcesContent":["import { getFullVersionString } from '../utils/git_utils';\nimport { readConfig } from '../utils/config_utils';\nimport actionTitle from '../ui/action_title';\nimport execMeteorBuild from '../build/exec_meteor_build';\n\nconst CONFIGFILE = '.catladder.yaml';\n\n\nexport default (environment, done) => {\n const config = readConfig(CONFIGFILE);\n // read build params\n actionTitle(`building server ${getFullVersionString(environment)}`);\n\n execMeteorBuild({ config, environment }, ['--server-only']);\n done(null, 'server built');\n};\n"]} \ No newline at end of file diff --git a/dist/actions/deploy.js b/dist/actions/deploy.js deleted file mode 100644 index 963075c..0000000 --- a/dist/actions/deploy.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _uiAction_title = require('../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _build_server = require('./build_server'); - -var _build_server2 = _interopRequireDefault(_build_server); - -var _upload_server = require('./upload_server'); - -var _upload_server2 = _interopRequireDefault(_upload_server); - -exports['default'] = function (environment, done) { - (0, _uiAction_title2['default'])('deploying ' + environment); - (0, _build_server2['default'])(environment, function () { - (0, _upload_server2['default'])(environment, done); - }); -}; - -module.exports = exports['default']; -//# sourceMappingURL=deploy.js.map \ No newline at end of file diff --git a/dist/actions/deploy.js.map b/dist/actions/deploy.js.map deleted file mode 100644 index afa0bae..0000000 --- a/dist/actions/deploy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/actions/deploy.js"],"names":[],"mappings":";;;;;;;;8BAAwB,oBAAoB;;;;4BACpB,gBAAgB;;;;6BACf,iBAAiB;;;;qBAE3B,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,kDAAyB,WAAW,CAAG,CAAC;AACxC,iCAAY,WAAW,EAAE,YAAM;AAC7B,oCAAa,WAAW,EAAE,IAAI,CAAC,CAAC;GACjC,CAAC,CAAC;CACJ","file":"deploy.js","sourcesContent":["import actionTitle from '../ui/action_title';\nimport buildServer from './build_server';\nimport uploadServer from './upload_server';\n\nexport default (environment, done) => {\n actionTitle(`deploying ${environment}`);\n buildServer(environment, () => {\n uploadServer(environment, done);\n });\n};\n"]} \ No newline at end of file diff --git a/dist/actions/edit_env.js b/dist/actions/edit_env.js deleted file mode 100644 index 9a0a962..0000000 --- a/dist/actions/edit_env.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _utilsPass_utils = require('../utils/pass_utils'); - -var _configsDirectories = require('../configs/directories'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(CONFIGFILE); - var passPathForEnvVars = (0, _configsDirectories.passEnvFile)({ config: config, environment: environment }); - (0, _utilsPass_utils.editPass)(passPathForEnvVars); - done(null, 'env in pass edited. Remember that this not updates the server. Use catladder setup to do so'); -}; - -module.exports = exports['default']; -//# sourceMappingURL=edit_env.js.map \ No newline at end of file diff --git a/dist/actions/edit_env.js.map b/dist/actions/edit_env.js.map deleted file mode 100644 index 65d1477..0000000 --- a/dist/actions/edit_env.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/actions/edit_env.js"],"names":[],"mappings":";;;;;;+BAAyB,qBAAqB;;kCAClB,wBAAwB;;iCACzB,uBAAuB;;AAElD,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAEtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,mCAAW,UAAU,CAAC,CAAC;AACtC,MAAM,kBAAkB,GAAG,qCAAY,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;AAChE,iCAAS,kBAAkB,CAAC,CAAC;AAC7B,MAAI,CAAC,IAAI,EAAE,mGAAmG,CAAC,CAAC;CACjH","file":"edit_env.js","sourcesContent":["import { editPass } from '../utils/pass_utils';\nimport { passEnvFile } from '../configs/directories';\nimport { readConfig } from '../utils/config_utils';\n\nconst CONFIGFILE = '.catladder.yaml';\n\nexport default (environment, done) => {\n const config = readConfig(CONFIGFILE);\n const passPathForEnvVars = passEnvFile({ config, environment });\n editPass(passPathForEnvVars);\n done(null, 'env in pass edited. Remember that this not updates the server. Use catladder setup to do so');\n};\n"]} \ No newline at end of file diff --git a/dist/actions/index.js b/dist/actions/index.js deleted file mode 100644 index e61cf60..0000000 --- a/dist/actions/index.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _buildAndroid_build = require('../build/android_build'); - -var _build_apps = require('./build_apps'); - -var _build_apps2 = _interopRequireDefault(_build_apps); - -var _build_server = require('./build_server'); - -var _build_server2 = _interopRequireDefault(_build_server); - -var _deploy = require('./deploy'); - -var _deploy2 = _interopRequireDefault(_deploy); - -var _edit_env = require('./edit_env'); - -var _edit_env2 = _interopRequireDefault(_edit_env); - -var _init = require('./init'); - -var _init2 = _interopRequireDefault(_init); - -var _ios_reveal_project = require('./ios_reveal_project'); - -var _ios_reveal_project2 = _interopRequireDefault(_ios_reveal_project); - -var _restart = require('./restart'); - -var _restart2 = _interopRequireDefault(_restart); - -var _setup = require('./setup'); - -var _setup2 = _interopRequireDefault(_setup); - -var _upload_server = require('./upload_server'); - -var _upload_server2 = _interopRequireDefault(_upload_server); - -exports.init = _init2['default']; -exports.setup = _setup2['default']; -exports.editEnv = _edit_env2['default']; -exports.restart = _restart2['default']; -exports.buildServer = _build_server2['default']; -exports.buildApps = _build_apps2['default']; -exports.iosRevealProject = _ios_reveal_project2['default']; -exports.androidPrepareForStore = _buildAndroid_build.androidPrepareForStore; -exports.androidInit = _buildAndroid_build.androidInit; -exports.uploadServer = _upload_server2['default']; -exports.deploy = _deploy2['default']; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/actions/index.js.map b/dist/actions/index.js.map deleted file mode 100644 index eb0d37c..0000000 --- a/dist/actions/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/actions/index.js"],"names":[],"mappings":";;;;;;;;kCAAoD,wBAAwB;;0BACtD,cAAc;;;;4BACZ,gBAAgB;;;;sBACrB,UAAU;;;;wBACT,YAAY;;;;oBACf,QAAQ;;;;kCACI,sBAAsB;;;;uBAC/B,WAAW;;;;qBACb,SAAS;;;;6BACF,iBAAiB;;;;QAGxC,IAAI;QACJ,KAAK;QACL,OAAO;QACP,OAAO;QACP,WAAW;QACX,SAAS;QACT,gBAAgB;QAChB,sBAAsB;QACtB,WAAW;QACX,YAAY;QACZ,MAAM","file":"index.js","sourcesContent":["import { androidInit, androidPrepareForStore } from '../build/android_build';\nimport buildApps from './build_apps';\nimport buildServer from './build_server';\nimport deploy from './deploy';\nimport editEnv from './edit_env';\nimport init from './init';\nimport iosRevealProject from './ios_reveal_project';\nimport restart from './restart';\nimport setup from './setup';\nimport uploadServer from './upload_server';\n\nexport {\n init,\n setup,\n editEnv,\n restart,\n buildServer,\n buildApps,\n iosRevealProject,\n androidPrepareForStore,\n androidInit,\n uploadServer,\n deploy,\n};\n"]} \ No newline at end of file diff --git a/dist/actions/init.js b/dist/actions/init.js deleted file mode 100644 index 278d029..0000000 --- a/dist/actions/init.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var _extends = require('babel-runtime/helpers/extends')['default']; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _prompt = require('prompt'); - -var _prompt2 = _interopRequireDefault(_prompt); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _path = require('path'); - -var _path2 = _interopRequireDefault(_path); - -var _configsPrompt_schemas = require('../configs/prompt_schemas'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (__, done) { - var configOld = _fs2['default'].existsSync(CONFIGFILE) && (0, _utilsConfig_utils.readConfig)(CONFIGFILE) || {}; - _prompt2['default'].start(); - _prompt2['default'].get((0, _configsPrompt_schemas.initSchema)(configOld), function (error, configNew) { - var config = _extends({}, configOld, configNew); - (0, _utilsConfig_utils.writeConfig)(CONFIGFILE, config); - var buildDir = _path2['default'].resolve(config.buildDir); - if (!_fs2['default'].existsSync(buildDir)) { - _fs2['default'].mkdirSync(buildDir); - } - done(null, 'created ' + CONFIGFILE); - }); -}; - -module.exports = exports['default']; -//# sourceMappingURL=init.js.map \ No newline at end of file diff --git a/dist/actions/init.js.map b/dist/actions/init.js.map deleted file mode 100644 index bd7f1a8..0000000 --- a/dist/actions/init.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/actions/init.js"],"names":[],"mappings":";;;;;;;;;;sBAAmB,QAAQ;;;;kBAEZ,IAAI;;;;oBACF,MAAM;;;;qCAEI,2BAA2B;;iCACd,uBAAuB;;AAE/D,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBACtB,UAAC,EAAE,EAAE,IAAI,EAAK;AAC3B,MAAM,SAAS,GAAG,AAAC,gBAAG,UAAU,CAAC,UAAU,CAAC,IAAI,mCAAW,UAAU,CAAC,IAAK,EAAE,CAAC;AAC9E,sBAAO,KAAK,EAAE,CAAC;AACf,sBAAO,GAAG,CAAC,uCAAW,SAAS,CAAC,EAAE,UAAC,KAAK,EACpC,SAAS,EACN;AACL,QAAM,MAAM,gBACP,SAAS,EACT,SAAS,CACb,CAAC;AACF,wCAAY,UAAU,EAAE,MAAM,CAAC,CAAC;AAChC,QAAM,QAAQ,GAAG,kBAAK,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC/C,QAAI,CAAC,gBAAG,UAAU,CAAC,QAAQ,CAAC,EAAE;AAC5B,sBAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;KACxB;AACD,QAAI,CAAC,IAAI,eAAa,UAAU,CAAG,CAAC;GACrC,CAAC,CAAC;CACJ","file":"init.js","sourcesContent":["import prompt from 'prompt';\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { initSchema } from '../configs/prompt_schemas';\nimport { readConfig, writeConfig } from '../utils/config_utils';\n\nconst CONFIGFILE = '.catladder.yaml';\nexport default (__, done) => {\n const configOld = (fs.existsSync(CONFIGFILE) && readConfig(CONFIGFILE)) || {};\n prompt.start();\n prompt.get(initSchema(configOld), (error,\n configNew,\n ) => {\n const config = {\n ...configOld,\n ...configNew,\n };\n writeConfig(CONFIGFILE, config);\n const buildDir = path.resolve(config.buildDir);\n if (!fs.existsSync(buildDir)) {\n fs.mkdirSync(buildDir);\n }\n done(null, `created ${CONFIGFILE}`);\n });\n};\n"]} \ No newline at end of file diff --git a/dist/actions/ios_reveal_project.js b/dist/actions/ios_reveal_project.js deleted file mode 100644 index d7bc794..0000000 --- a/dist/actions/ios_reveal_project.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _child_process = require('child_process'); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _configsDirectories = require('../configs/directories'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(CONFIGFILE); - if (_fs2['default'].existsSync((0, _configsDirectories.getIosBuildProjectFolder)({ config: config, environment: environment }))) { - (0, _child_process.execSync)('open ' + (0, _configsDirectories.getIosBuildProjectFolder)({ config: config, environment: environment })); - } else { - done(null, 'ios project does not exist under ' + (0, _configsDirectories.getIosBuildProjectFolder)({ config: config, environment: environment })); - } -}; - -module.exports = exports['default']; -//# sourceMappingURL=ios_reveal_project.js.map \ No newline at end of file diff --git a/dist/actions/ios_reveal_project.js.map b/dist/actions/ios_reveal_project.js.map deleted file mode 100644 index 43adfb2..0000000 --- a/dist/actions/ios_reveal_project.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/actions/ios_reveal_project.js"],"names":[],"mappings":";;;;;;;;6BAAyB,eAAe;;kBACzB,IAAI;;;;kCAEsB,wBAAwB;;iCACtC,uBAAuB;;AAElD,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAGtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,mCAAW,UAAU,CAAC,CAAC;AACtC,MAAI,gBAAG,UAAU,CAAC,kDAAyB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC,EAAE;AACpE,2CAAiB,kDAAyB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAG,CAAC;GACvE,MAAM;AACL,QAAI,CAAC,IAAI,wCAAsC,kDAAyB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAG,CAAC;GACrG;CACF","file":"ios_reveal_project.js","sourcesContent":["import { execSync } from 'child_process';\nimport fs from 'fs';\n\nimport { getIosBuildProjectFolder } from '../configs/directories';\nimport { readConfig } from '../utils/config_utils';\n\nconst CONFIGFILE = '.catladder.yaml';\n\n\nexport default (environment, done) => {\n const config = readConfig(CONFIGFILE);\n if (fs.existsSync(getIosBuildProjectFolder({ config, environment }))) {\n execSync(`open ${getIosBuildProjectFolder({ config, environment })}`);\n } else {\n done(null, `ios project does not exist under ${getIosBuildProjectFolder({ config, environment })}`);\n }\n};\n"]} \ No newline at end of file diff --git a/dist/actions/restart.js b/dist/actions/restart.js deleted file mode 100644 index ffe1745..0000000 --- a/dist/actions/restart.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _sshExec = require('ssh-exec'); - -var _sshExec2 = _interopRequireDefault(_sshExec); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var _uiAction_title = require('../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - (0, _uiAction_title2['default'])('restarting ' + environment); - (0, _sshExec2['default'])('./bin/nodejs.sh restart', (0, _utilsConfig_utils.getSshConfig)(CONFIGFILE, environment), function () { - done(null, 'server restarted'); - }).pipe(process.stdout); -}; - -module.exports = exports['default']; -//# sourceMappingURL=restart.js.map \ No newline at end of file diff --git a/dist/actions/restart.js.map b/dist/actions/restart.js.map deleted file mode 100644 index ccb4b2b..0000000 --- a/dist/actions/restart.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/actions/restart.js"],"names":[],"mappings":";;;;;;;;uBAAuB,UAAU;;;;iCAEJ,uBAAuB;;8BAC5B,oBAAoB;;;;AAE5C,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAEtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,mDAA0B,WAAW,CAAG,CAAC;AACzC,4BAAW,yBAAyB,EAAE,qCAAa,UAAU,EAAE,WAAW,CAAC,EAAE,YAAM;AACjF,QAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;GAChC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB","file":"restart.js","sourcesContent":["import remoteExec from 'ssh-exec';\n\nimport { getSshConfig } from '../utils/config_utils';\nimport actionTitle from '../ui/action_title';\n\nconst CONFIGFILE = '.catladder.yaml';\n\nexport default (environment, done) => {\n actionTitle(`restarting ${environment}`);\n remoteExec('./bin/nodejs.sh restart', getSshConfig(CONFIGFILE, environment), () => {\n done(null, 'server restarted');\n }).pipe(process.stdout);\n};\n"]} \ No newline at end of file diff --git a/dist/actions/setup.js b/dist/actions/setup.js deleted file mode 100644 index 3670632..0000000 --- a/dist/actions/setup.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; - -var _extends = require('babel-runtime/helpers/extends')['default']; - -var _defineProperty = require('babel-runtime/helpers/define-property')['default']; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _prompt = require('prompt'); - -var _prompt2 = _interopRequireDefault(_prompt); - -var _sshExec = require('ssh-exec'); - -var _sshExec2 = _interopRequireDefault(_sshExec); - -var _jsYaml = require('js-yaml'); - -var _jsYaml2 = _interopRequireDefault(_jsYaml); - -var _configsPrompt_schemas = require('../configs/prompt_schemas'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var _configsDirectories = require('../configs/directories'); - -var _packageJson = require('../../package.json'); - -var _utilsPass_utils = require('../utils/pass_utils'); - -var _uiAction_title = require('../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _configsDefault_env = require('../configs/default_env'); - -var _configsDefault_env2 = _interopRequireDefault(_configsDefault_env); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(CONFIGFILE); - _prompt2['default'].start(); - - (0, _uiAction_title2['default'])('setting up ' + environment); - var passPathForEnvVars = (0, _configsDirectories.passEnvFile)({ config: config, environment: environment }); - // console.log(passPathForEnvVars); - var oldEnvConfig = _lodash2['default'].get(config, ['environments', environment], {}); - _prompt2['default'].get((0, _configsPrompt_schemas.environmentSchema)(_extends({}, config, { environment: environment })), function (error, envConfig) { - // write new envConfig - config.environments = _extends({}, config.environments, _defineProperty({}, environment, _extends({}, oldEnvConfig, envConfig))); - (0, _utilsConfig_utils.writeConfig)(CONFIGFILE, config); - // update env-vars in path - // first get current vars in path - var envVars = (0, _utilsPass_utils.readPassYaml)(passPathForEnvVars); - // if envVars do not exist yet, create new one and write to pass - if (_lodash2['default'].isEmpty(envVars)) { - envVars = (0, _configsDefault_env2['default'])({ config: config, envConfig: envConfig }); - (0, _utilsPass_utils.writePass)(passPathForEnvVars, _jsYaml2['default'].safeDump(envVars)); - } - // open editor to edit the en vars - (0, _utilsPass_utils.editPass)(passPathForEnvVars); - // load changed envVars and create env.sh on server - // we create ROOT_URL always from the config - var envSh = (0, _utilsConfig_utils.createEnvSh)({ version: _packageJson.version, environment: environment }, _extends({}, (0, _utilsPass_utils.readPassYaml)(passPathForEnvVars), { - ROOT_URL: envConfig.url - })); - // create env.sh on server - (0, _sshExec2['default'])('echo "' + envSh.replace(/"/g, '\\"') + '" > ~/app/env.sh', (0, _utilsConfig_utils.getSshConfig)(CONFIGFILE, environment), function (err) { - if (err) { - throw err; - } - console.log(''); - console.log('~/app/env.sh has ben written on ', envConfig.host); - done(null, environment + ' is set up, please restart server'); - }).pipe(process.stdout); - }); -}; - -module.exports = exports['default']; -// merge with old config -//# sourceMappingURL=setup.js.map \ No newline at end of file diff --git a/dist/actions/setup.js.map b/dist/actions/setup.js.map deleted file mode 100644 index 479ead4..0000000 --- a/dist/actions/setup.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/actions/setup.js"],"names":[],"mappings":";;;;;;;;;;;;sBAAc,QAAQ;;;;sBACH,QAAQ;;;;uBACJ,UAAU;;;;sBAChB,SAAS;;;;qCAEQ,2BAA2B;;iCACM,uBAAuB;;kCAC9D,wBAAwB;;2BAC5B,oBAAoB;;+BACM,qBAAqB;;8BAC/C,oBAAoB;;;;kCACrB,wBAAwB;;;;AAE/C,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAGtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,mCAAW,UAAU,CAAC,CAAC;AACtC,sBAAO,KAAK,EAAE,CAAC;;AAEf,mDAA0B,WAAW,CAAG,CAAC;AACzC,M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,UAAI,CAAC,IAAI,EAAK,WAAW,uCAAoC,CAAC;KAC/D,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;GACzB,CAAC,CAAC;CACJ","file":"setup.js","sourcesContent":["import _ from 'lodash';\nimport prompt from 'prompt';\nimport remoteExec from 'ssh-exec';\nimport yaml from 'js-yaml';\n\nimport { environmentSchema } from '../configs/prompt_schemas';\nimport { getSshConfig, readConfig, writeConfig, createEnvSh } from '../utils/config_utils';\nimport { passEnvFile } from '../configs/directories';\nimport { version } from '../../package.json';\nimport { writePass, editPass, readPassYaml } from '../utils/pass_utils';\nimport actionTitle from '../ui/action_title';\nimport defaultEnv from '../configs/default_env';\n\nconst CONFIGFILE = '.catladder.yaml';\n\n\nexport default (environment, done) => {\n const config = readConfig(CONFIGFILE);\n prompt.start();\n\n actionTitle(`setting up ${environment}`);\n const passPathForEnvVars = passEnvFile({ config, environment });\n // console.log(passPathForEnvVars);\n const oldEnvConfig = _.get(config, ['environments', environment], {});\n prompt.get(environmentSchema({ ...config, environment }), (error, envConfig) => {\n // write new envConfig\n config.environments = {\n ...config.environments,\n [environment]: {\n ...oldEnvConfig, // merge with old config\n ...envConfig,\n },\n };\n writeConfig(CONFIGFILE, config);\n // update env-vars in path\n // first get current vars in path\n let envVars = readPassYaml(passPathForEnvVars);\n // if envVars do not exist yet, create new one and write to pass\n if (_.isEmpty(envVars)) {\n envVars = defaultEnv({ config, envConfig });\n writePass(passPathForEnvVars, yaml.safeDump(envVars));\n }\n // open editor to edit the en vars\n editPass(passPathForEnvVars);\n // load changed envVars and create env.sh on server\n // we create ROOT_URL always from the config\n const envSh = createEnvSh(\n { version, environment },\n {\n ...readPassYaml(passPathForEnvVars),\n ROOT_URL: envConfig.url,\n },\n );\n // create env.sh on server\n remoteExec(`echo \"${envSh.replace(/\"/g, '\\\\\"')}\" > ~/app/env.sh`, getSshConfig(CONFIGFILE, environment), (err) => {\n if (err) {\n throw err;\n }\n console.log('');\n console.log('~/app/env.sh has ben written on ', envConfig.host);\n done(null, `${environment} is set up, please restart server`);\n }).pipe(process.stdout);\n });\n};\n"]} \ No newline at end of file diff --git a/dist/actions/upload_server.js b/dist/actions/upload_server.js deleted file mode 100644 index 4a806d8..0000000 --- a/dist/actions/upload_server.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _sshExec = require('ssh-exec'); - -var _sshExec2 = _interopRequireDefault(_sshExec); - -var _child_process = require('child_process'); - -var _configsDirectories = require('../configs/directories'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var _uiAction_title = require('../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _restart = require('./restart'); - -var _restart2 = _interopRequireDefault(_restart); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - var next = function next() { - return (0, _restart2['default'])(environment, done); - }; - var config = (0, _utilsConfig_utils.readConfig)(CONFIGFILE); - // const envConf = config.environments[environment]; - var sshConfig = (0, _utilsConfig_utils.getSshConfig)(CONFIGFILE, environment); - (0, _uiAction_title2['default'])('uploading server bundle to ' + environment); - var buildDir = (0, _configsDirectories.getBuildDir)({ config: config, environment: environment }); - (0, _child_process.execSync)('scp ' + buildDir + '/app.tar.gz ' + sshConfig.user + '@' + sshConfig.host + ':', { stdio: 'inherit' }); - (0, _sshExec2['default'])('\n rm -rf ~/app/last\n mv ~/app/bundle ~/app/last\n rm ~/app/current\n ln -s ~/app/bundle ~/app/current\n tar xfz app.tar.gz -C app\n pushd ~/app/bundle/programs/server\n npm install\n popd\n ', sshConfig, next).pipe(process.stdout); -}; - -module.exports = exports['default']; -//# sourceMappingURL=upload_server.js.map \ No newline at end of file diff --git a/dist/actions/upload_server.js.map b/dist/actions/upload_server.js.map deleted file mode 100644 index 5e654db..0000000 --- a/dist/actions/upload_server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/actions/upload_server.js"],"names":[],"mappings":";;;;;;;;uBAAuB,UAAU;;;;6BAER,eAAe;;kCAEZ,wBAAwB;;iCACX,uBAAuB;;8BACxC,oBAAoB;;;;uBACxB,WAAW;;;;AAE/B,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAGtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,IAAI,GAAG,SAAP,IAAI;WAAS,0BAAQ,WAAW,EAAE,IAAI,CAAC;GAAA,CAAC;AAC9C,MAAM,MAAM,GAAG,mCAAW,UAAU,CAAC,CAAC;;AAEtC,MAAM,SAAS,GAAG,qCAAa,UAAU,EAAE,WAAW,CAAC,CAAC;AACxD,mEAA0C,WAAW,CAAG,CAAC;AACzD,MAAM,QAAQ,GAAG,qCAAY,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;AACtD,wCAAgB,QAAQ,oBAAe,SAAS,CAAC,IAAI,SAAI,SAAS,CAAC,IAAI,QAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAClG,2QASK,SAAS,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5C","file":"upload_server.js","sourcesContent":["import remoteExec from 'ssh-exec';\n\nimport { execSync } from 'child_process';\n\nimport { getBuildDir } from '../configs/directories';\nimport { getSshConfig, readConfig } from '../utils/config_utils';\nimport actionTitle from '../ui/action_title';\nimport restart from './restart';\n\nconst CONFIGFILE = '.catladder.yaml';\n\n\nexport default (environment, done) => {\n const next = () => restart(environment, done);\n const config = readConfig(CONFIGFILE);\n // const envConf = config.environments[environment];\n const sshConfig = getSshConfig(CONFIGFILE, environment);\n actionTitle(`uploading server bundle to ${environment}`);\n const buildDir = getBuildDir({ config, environment });\n execSync(`scp ${buildDir}/app.tar.gz ${sshConfig.user}@${sshConfig.host}:`, { stdio: 'inherit' });\n remoteExec(`\n rm -rf ~/app/last\n mv ~/app/bundle ~/app/last\n rm ~/app/current\n ln -s ~/app/bundle ~/app/current\n tar xfz app.tar.gz -C app\n pushd ~/app/bundle/programs/server\n npm install\n popd\n `, sshConfig, next).pipe(process.stdout);\n};\n"]} \ No newline at end of file diff --git a/dist/android_build.js b/dist/android_build.js deleted file mode 100644 index b8fcffd..0000000 --- a/dist/android_build.js +++ /dev/null @@ -1,142 +0,0 @@ -'use strict'; - -var _extends = require('babel-runtime/helpers/extends')['default']; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _child_process = require('child_process'); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _moment = require('moment'); - -var _moment2 = _interopRequireDefault(_moment); - -var _path = require('path'); - -var _path2 = _interopRequireDefault(_path); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _shellEscape = require('shell-escape'); - -var _shellEscape2 = _interopRequireDefault(_shellEscape); - -var _pass_utils = require('./pass_utils'); - -var getAndroidBuildDir = function getAndroidBuildDir(_ref) { - var config = _ref.config; - var environment = _ref.environment; - return _path2['default'].resolve(config.buildDir + '/' + environment + '/android'); -}; -exports.getAndroidBuildDir = getAndroidBuildDir; -var getAndroidBuildProjectFolder = function getAndroidBuildProjectFolder(_ref2) { - var config = _ref2.config; - var environment = _ref2.environment; - return getAndroidBuildDir({ config: config, environment: environment }) + '/project'; -}; -exports.getAndroidBuildProjectFolder = getAndroidBuildProjectFolder; -var getAndroidBuildTool = function getAndroidBuildTool(config, buildTool) { - return _path2['default'].resolve(process.env.ANDROID_HOME + '/build-tools/' + config.androidBuildToolVersion + '/' + buildTool); -}; - -exports.getAndroidBuildTool = getAndroidBuildTool; -var getKeystoreConfig = function getKeystoreConfig(_ref3) { - var config = _ref3.config; - var environment = _ref3.environment; - - var envConfig = _lodash2['default'].get(config, ['environments', environment]); - var keyStore = _path2['default'].resolve(envConfig.androidKeystore); - var keystorePWPassPath = config.passPath + '/android_keystore_pw'; - var keyname = envConfig.androidKeyname; - var keyDName = envConfig.androidDName; - return { - keyStore: keyStore, keyname: keyname, keystorePWPassPath: keystorePWPassPath, keyDName: keyDName - }; -}; -var getKeystoreProps = function getKeystoreProps(_ref4) { - var config = _ref4.config; - var environment = _ref4.environment; - - var keyStoreConfig = getKeystoreConfig({ config: config, environment: environment }); - var keystorePWPassPath = keyStoreConfig.keystorePWPassPath; - - var keystorePW = _lodash2['default'].trim((0, _pass_utils.readPass)(keystorePWPassPath)); - return _extends({}, keyStoreConfig, { keystorePW: keystorePW - }); -}; - -var androidInit = function androidInit(_ref5) { - var config = _ref5.config; - var environment = _ref5.environment; - - // create keystorePW if not existing - - var _getKeystoreConfig = getKeystoreConfig({ config: config, environment: environment }); - - var keystorePWPassPath = _getKeystoreConfig.keystorePWPassPath; - - if (!(0, _pass_utils.hasPass)(keystorePWPassPath)) { - (0, _pass_utils.generatePass)(keystorePWPassPath); - } - - // kudos to http://stackoverflow.com/questions/3997748/how-can-i-create-a-keystore - - var _getKeystoreProps = getKeystoreProps({ config: config, environment: environment }); - - var keystorePW = _getKeystoreProps.keystorePW; - var keyStore = _getKeystoreProps.keyStore; - var keyname = _getKeystoreProps.keyname; - var keyDName = _getKeystoreProps.keyDName; - - var createKeyCommand = (0, _shellEscape2['default'])(['keytool', '-genkeypair', '-dname', keyDName, '-alias', keyname, '--storepass', keystorePW, '--keypass', keystorePW, '--keystore', keyStore, '-keyalg', 'RSA', '-keysize', 2048, '-validity', 10000]); - (0, _child_process.execSync)('echo y | ' + createKeyCommand, { stdio: 'inherit' }); -}; - -exports.androidInit = androidInit; -var androidPrepareForStore = function androidPrepareForStore(_ref6) { - var config = _ref6.config; - var environment = _ref6.environment; - - var _getKeystoreProps2 = getKeystoreProps({ config: config, environment: environment }); - - var keystorePW = _getKeystoreProps2.keystorePW; - var keyStore = _getKeystoreProps2.keyStore; - var keyname = _getKeystoreProps2.keyname; - - var androidBuildDir = getAndroidBuildDir({ config: config, environment: environment }); - if (!_fs2['default'].existsSync(androidBuildDir)) { - throw new Error('android build dir does not exist'); - } - if (!_fs2['default'].existsSync(keyStore)) { - throw new Error('please call android-init ' + environment + ' first'); - } - var now = (0, _moment2['default'])().format('YYYYMMDD-HHmm'); - - var inFile = androidBuildDir + '/release-unsigned.apk'; - var alignFile = androidBuildDir + '/release-unsigned-aligned.apk'; - if (_fs2['default'].existsSync(alignFile)) { - _fs2['default'].unlinkSync(alignFile); - } - var zipAlignCommand = (0, _shellEscape2['default'])([getAndroidBuildTool(config, 'zipalign'), 4, inFile, alignFile]); - (0, _child_process.execSync)(zipAlignCommand, { stdio: 'inherit' }); - - var outfile = androidBuildDir + '/' + config.appname + '-' + environment + '-' + now + '.apk'; - if (_fs2['default'].existsSync(outfile)) { - _fs2['default'].unlinkSync(outfile); - } - var signCommand = (0, _shellEscape2['default'])([getAndroidBuildTool(config, 'apksigner'), 'sign', '--ks-key-alias', keyname, '--ks', keyStore, '--ks-pass', 'stdin', '--key-pass', 'stdin', '--out', outfile, alignFile]); - (0, _child_process.execSync)(signCommand, { input: keystorePW + '\n' + keystorePW, stdio: ['pipe', 1, 2] }); - - return outfile; -}; -exports.androidPrepareForStore = androidPrepareForStore; -//# sourceMappingURL=android_build.js.map \ No newline at end of file diff --git a/dist/android_build.js.map b/dist/android_build.js.map deleted file mode 100644 index cdb50da..0000000 --- a/dist/android_build.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/android_build.js"],"names":[],"mappings":";;;;;;;;;;6BACyB,eAAe;;kBACzB,IAAI;;;;sBACA,QAAQ;;;;oBACV,MAAM;;;;sBACT,QAAQ;;;;2BACE,cAAc;;;;0BAEU,cAAc;;AAEvD,IAAM,kBAAkB,GAAG,SAArB,kBAAkB,CAAI,IAAuB;MAArB,MAAM,GAAR,IAAuB,CAArB,MAAM;MAAE,WAAW,GAArB,IAAuB,CAAb,WAAW;SAAO,kBAAK,OAAO,CAAI,MAAM,C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AAC,mBAAmB,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AAC3M,+BAAS,WAAW,EAAE,EAAE,KAAK,EAAK,UAAU,UAAK,UAAU,AAAE,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;;AAGxF,SAAO,OAAO,CAAC;CAChB,CAAC","file":"android_build.js","sourcesContent":["\nimport { execSync } from 'child_process';\nimport fs from 'fs';\nimport moment from 'moment';\nimport path from 'path';\nimport _ from 'lodash';\nimport shellescape from 'shell-escape';\n\nimport { readPass, generatePass, hasPass } from './pass_utils';\n\nexport const getAndroidBuildDir = ({ config, environment }) => path.resolve(`${config.buildDir}/${environment}/android`);\nexport const getAndroidBuildProjectFolder = ({ config, environment }) => `${getAndroidBuildDir({ config, environment })}/project`;\nexport const getAndroidBuildTool = (config, buildTool) => path.resolve(`${process.env.ANDROID_HOME}/build-tools/${config.androidBuildToolVersion}/${buildTool}`);\n\nconst getKeystoreConfig = ({ config, environment }) => {\n const envConfig = _.get(config, ['environments', environment]);\n const keyStore = path.resolve(envConfig.androidKeystore);\n const keystorePWPassPath = `${config.passPath}/android_keystore_pw`;\n const keyname = envConfig.androidKeyname;\n const keyDName = envConfig.androidDName;\n return {\n keyStore, keyname, keystorePWPassPath, keyDName,\n };\n};\nconst getKeystoreProps = ({ config, environment }) => {\n const keyStoreConfig = getKeystoreConfig({ config, environment });\n const { keystorePWPassPath } = keyStoreConfig;\n const keystorePW = _.trim(readPass(keystorePWPassPath));\n return {\n ...keyStoreConfig, keystorePW,\n };\n};\n\n\nexport const androidInit = ({ config, environment }) => {\n // create keystorePW if not existing\n const { keystorePWPassPath } = getKeystoreConfig({ config, environment });\n if (!hasPass(keystorePWPassPath)) {\n generatePass(keystorePWPassPath);\n }\n\n // kudos to http://stackoverflow.com/questions/3997748/how-can-i-create-a-keystore\n const { keystorePW, keyStore, keyname, keyDName } = getKeystoreProps({ config, environment });\n const createKeyCommand = shellescape(['keytool', '-genkeypair', '-dname', keyDName, '-alias', keyname, '--storepass', keystorePW, '--keypass', keystorePW, '--keystore', keyStore, '-keyalg', 'RSA', '-keysize', 2048, '-validity', 10000]);\n execSync(`echo y | ${createKeyCommand}`, { stdio: 'inherit' });\n};\n\nexport const androidPrepareForStore = ({ config, environment }) => {\n const { keystorePW, keyStore, keyname } = getKeystoreProps({ config, environment });\n const androidBuildDir = getAndroidBuildDir({ config, environment });\n if (!fs.existsSync(androidBuildDir)) {\n throw new Error('android build dir does not exist');\n }\n if (!fs.existsSync(keyStore)) {\n throw new Error(`please call android-init ${environment} first`);\n }\n const now = moment().format('YYYYMMDD-HHmm');\n\n\n const inFile = `${androidBuildDir}/release-unsigned.apk`;\n const alignFile = `${androidBuildDir}/release-unsigned-aligned.apk`;\n if (fs.existsSync(alignFile)) {\n fs.unlinkSync(alignFile);\n }\n const zipAlignCommand = shellescape([getAndroidBuildTool(config, 'zipalign'), 4, inFile, alignFile]);\n execSync(zipAlignCommand, { stdio: 'inherit' });\n\n const outfile = `${androidBuildDir}/${config.appname}-${environment}-${now}.apk`;\n if (fs.existsSync(outfile)) {\n fs.unlinkSync(outfile);\n }\n const signCommand = shellescape([getAndroidBuildTool(config, 'apksigner'), 'sign', '--ks-key-alias', keyname, '--ks', keyStore, '--ks-pass', 'stdin', '--key-pass', 'stdin', '--out', outfile, alignFile]);\n execSync(signCommand, { input: `${keystorePW}\\n${keystorePW}`, stdio: ['pipe', 1, 2] });\n\n\n return outfile;\n};\n"]} \ No newline at end of file diff --git a/dist/build/android_build.js b/dist/build/android_build.js deleted file mode 100644 index 5e84099..0000000 --- a/dist/build/android_build.js +++ /dev/null @@ -1,150 +0,0 @@ -'use strict'; - -var _extends = require('babel-runtime/helpers/extends')['default']; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _path = require('path'); - -var _path2 = _interopRequireDefault(_path); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _moment = require('moment'); - -var _moment2 = _interopRequireDefault(_moment); - -var _shellEscape = require('shell-escape'); - -var _shellEscape2 = _interopRequireDefault(_shellEscape); - -var _utilsGit_utils = require('../utils/git_utils'); - -var _utilsPass_utils = require('../utils/pass_utils'); - -var _utilsExec = require('../utils/exec'); - -var _utilsExec2 = _interopRequireDefault(_utilsExec); - -var getAndroidBuildDir = function getAndroidBuildDir(_ref) { - var config = _ref.config; - var environment = _ref.environment; - return _path2['default'].resolve(config.buildDir + '/' + environment + '/android'); -}; -exports.getAndroidBuildDir = getAndroidBuildDir; -var getAndroidBuildProjectFolder = function getAndroidBuildProjectFolder(_ref2) { - var config = _ref2.config; - var environment = _ref2.environment; - return getAndroidBuildDir({ config: config, environment: environment }) + '/project'; -}; -exports.getAndroidBuildProjectFolder = getAndroidBuildProjectFolder; -var getAndroidBuildTool = function getAndroidBuildTool(config, buildTool) { - return _path2['default'].resolve(process.env.ANDROID_HOME + '/build-tools/' + config.androidBuildToolVersion + '/' + buildTool); -}; - -exports.getAndroidBuildTool = getAndroidBuildTool; -var getKeystoreConfig = function getKeystoreConfig(_ref3) { - var config = _ref3.config; - var environment = _ref3.environment; - - var envConfig = _lodash2['default'].get(config, ['environments', environment]); - var keyStore = _path2['default'].resolve(envConfig.androidKeystore); - var keystorePWPassPath = config.passPath + '/android_keystore_pw'; - var keyname = envConfig.androidKeyname; - var keyDName = envConfig.androidDName; - return { - keyStore: keyStore, - keyname: keyname, - keystorePWPassPath: keystorePWPassPath, - keyDName: keyDName - }; -}; -var getKeystoreProps = function getKeystoreProps(_ref4) { - var config = _ref4.config; - var environment = _ref4.environment; - - var keyStoreConfig = getKeystoreConfig({ config: config, environment: environment }); - var keystorePWPassPath = keyStoreConfig.keystorePWPassPath; - - var keystorePW = _lodash2['default'].trim((0, _utilsPass_utils.readPass)(keystorePWPassPath)); - return _extends({}, keyStoreConfig, { - keystorePW: keystorePW - }); -}; - -var androidInit = function androidInit(_ref5) { - var config = _ref5.config; - var environment = _ref5.environment; - - // create keystorePW if not existing - - var _getKeystoreConfig = getKeystoreConfig({ config: config, environment: environment }); - - var keystorePWPassPath = _getKeystoreConfig.keystorePWPassPath; - - if (!(0, _utilsPass_utils.hasPass)(keystorePWPassPath)) { - (0, _utilsPass_utils.generatePass)(keystorePWPassPath); - } - - // kudos to http://stackoverflow.com/questions/3997748/how-can-i-create-a-keystore - - var _getKeystoreProps = getKeystoreProps({ config: config, environment: environment }); - - var keystorePW = _getKeystoreProps.keystorePW; - var keyStore = _getKeystoreProps.keyStore; - var keyname = _getKeystoreProps.keyname; - var keyDName = _getKeystoreProps.keyDName; - - var createKeyCommand = (0, _shellEscape2['default'])(['keytool', '-genkeypair', '-dname', keyDName, '-alias', keyname, '--storepass', keystorePW, '--keypass', keystorePW, '--keystore', keyStore, '-keyalg', 'RSA', '-keysize', 2048, '-validity', 10000]); - (0, _utilsExec2['default'])('echo y | ' + createKeyCommand, { stdio: 'inherit' }); -}; - -exports.androidInit = androidInit; -var androidPrepareForStore = function androidPrepareForStore(_ref6) { - var config = _ref6.config; - var environment = _ref6.environment; - - var _getKeystoreProps2 = getKeystoreProps({ config: config, environment: environment }); - - var keystorePW = _getKeystoreProps2.keystorePW; - var keyStore = _getKeystoreProps2.keyStore; - var keyname = _getKeystoreProps2.keyname; - - var androidBuildDir = getAndroidBuildDir({ config: config, environment: environment }); - if (!_fs2['default'].existsSync(androidBuildDir)) { - throw new Error('android build dir does not exist'); - } - if (!_fs2['default'].existsSync(keyStore)) { - throw new Error('please call android-init ' + environment + ' first'); - } - var now = (0, _moment2['default'])().format('YYYYMMDD-HHmm'); - - var inFile = androidBuildDir + '/project/build/outputs/apk/release/android-release-unsigned.apk'; - var alignFile = androidBuildDir + '/release-unsigned-aligned.apk'; - if (_fs2['default'].existsSync(alignFile)) { - _fs2['default'].unlinkSync(alignFile); - } - var zipAlignCommand = (0, _shellEscape2['default'])([getAndroidBuildTool(config, 'zipalign'), 4, inFile, alignFile]); - (0, _utilsExec2['default'])(zipAlignCommand, { stdio: 'inherit' }); - - var outfile = androidBuildDir + '/' + config.appname + '-' + (0, _utilsGit_utils.getFullVersionString)(environment) + '-' + now + '.apk'; - if (_fs2['default'].existsSync(outfile)) { - _fs2['default'].unlinkSync(outfile); - } - var signCommand = (0, _shellEscape2['default'])([getAndroidBuildTool(config, 'apksigner'), 'sign', '--ks-key-alias', keyname, '--ks', keyStore, '--ks-pass', 'stdin', '--key-pass', 'stdin', '--out', outfile, alignFile]); - (0, _utilsExec2['default'])(signCommand, { input: keystorePW + '\n' + keystorePW, stdio: ['pipe', 1, 2] }); - - return outfile; -}; -exports.androidPrepareForStore = androidPrepareForStore; -//# sourceMappingURL=android_build.js.map \ No newline at end of file diff --git a/dist/build/android_build.js.map b/dist/build/android_build.js.map deleted file mode 100644 index 2e92328..0000000 --- a/dist/build/android_build.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/build/android_build.js"],"names":[],"mappings":";;;;;;;;;;kBAAe,IAAI;;;;oBACF,MAAM;;;;sBAET,QAAQ;;;;sBACH,QAAQ;;;;2BACH,cAAc;;;;8BAED,oBAAoB;;+BACT,qBAAqB;;yBACpD,eAAe;;;;AAEzB,IAAM,kBAAkB,GAAG,SAArB,kBAAkB,CAAI,IAAuB;MAArB,MAAM,GAAR,IAAuB,CAArB,MAAM;MAAE,WAAW,GAArB,IAAuB,CAAb,WAAW;SACtD,kBAAK,OAAO,CAAI,MAAM,CAAC,QAAQ,SAAI,WAAW,cAAW;CAAA,CAAC;;AACrD,IAAM,4BAA4B,GAAG,SAA/B,4BAA4B,CAAI,KAAuB;MAArB,M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EACP,YAAY,EACZ,OAAO,EACP,OAAO,EACP,OAAO,EACP,SAAS,CACV,CAAC,CAAC;AACH,8BAAK,WAAW,EAAE,EAAE,KAAK,EAAK,UAAU,UAAK,UAAU,AAAE,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;;AAEpF,SAAO,OAAO,CAAC;CAChB,CAAC","file":"android_build.js","sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport _ from 'lodash';\nimport moment from 'moment';\nimport shellescape from 'shell-escape';\n\nimport { getFullVersionString } from '../utils/git_utils';\nimport { readPass, generatePass, hasPass } from '../utils/pass_utils';\nimport exec from '../utils/exec';\n\nexport const getAndroidBuildDir = ({ config, environment }) =>\n path.resolve(`${config.buildDir}/${environment}/android`);\nexport const getAndroidBuildProjectFolder = ({ config, environment }) =>\n `${getAndroidBuildDir({ config, environment })}/project`;\nexport const getAndroidBuildTool = (config, buildTool) =>\n path.resolve(\n `${process.env.ANDROID_HOME}/build-tools/${config.androidBuildToolVersion}/${buildTool}`,\n );\n\nconst getKeystoreConfig = ({ config, environment }) => {\n const envConfig = _.get(config, ['environments', environment]);\n const keyStore = path.resolve(envConfig.androidKeystore);\n const keystorePWPassPath = `${config.passPath}/android_keystore_pw`;\n const keyname = envConfig.androidKeyname;\n const keyDName = envConfig.androidDName;\n return {\n keyStore,\n keyname,\n keystorePWPassPath,\n keyDName,\n };\n};\nconst getKeystoreProps = ({ config, environment }) => {\n const keyStoreConfig = getKeystoreConfig({ config, environment });\n const { keystorePWPassPath } = keyStoreConfig;\n const keystorePW = _.trim(readPass(keystorePWPassPath));\n return {\n ...keyStoreConfig,\n keystorePW,\n };\n};\n\nexport const androidInit = ({ config, environment }) => {\n // create keystorePW if not existing\n const { keystorePWPassPath } = getKeystoreConfig({ config, environment });\n if (!hasPass(keystorePWPassPath)) {\n generatePass(keystorePWPassPath);\n }\n\n // kudos to http://stackoverflow.com/questions/3997748/how-can-i-create-a-keystore\n const { keystorePW, keyStore, keyname, keyDName } = getKeystoreProps({ config, environment });\n const createKeyCommand = shellescape([\n 'keytool',\n '-genkeypair',\n '-dname',\n keyDName,\n '-alias',\n keyname,\n '--storepass',\n keystorePW,\n '--keypass',\n keystorePW,\n '--keystore',\n keyStore,\n '-keyalg',\n 'RSA',\n '-keysize',\n 2048,\n '-validity',\n 10000,\n ]);\n exec(`echo y | ${createKeyCommand}`, { stdio: 'inherit' });\n};\n\nexport const androidPrepareForStore = ({ config, environment }) => {\n const { keystorePW, keyStore, keyname } = getKeystoreProps({ config, environment });\n const androidBuildDir = getAndroidBuildDir({ config, environment });\n if (!fs.existsSync(androidBuildDir)) {\n throw new Error('android build dir does not exist');\n }\n if (!fs.existsSync(keyStore)) {\n throw new Error(`please call android-init ${environment} first`);\n }\n const now = moment().format('YYYYMMDD-HHmm');\n\n const inFile = `${androidBuildDir}/project/build/outputs/apk/release/android-release-unsigned.apk`;\n const alignFile = `${androidBuildDir}/release-unsigned-aligned.apk`;\n if (fs.existsSync(alignFile)) {\n fs.unlinkSync(alignFile);\n }\n const zipAlignCommand = shellescape([\n getAndroidBuildTool(config, 'zipalign'),\n 4,\n inFile,\n alignFile,\n ]);\n exec(zipAlignCommand, { stdio: 'inherit' });\n\n const outfile = `${androidBuildDir}/${config.appname}-${getFullVersionString(\n environment,\n )}-${now}.apk`;\n if (fs.existsSync(outfile)) {\n fs.unlinkSync(outfile);\n }\n const signCommand = shellescape([\n getAndroidBuildTool(config, 'apksigner'),\n 'sign',\n '--ks-key-alias',\n keyname,\n '--ks',\n keyStore,\n '--ks-pass',\n 'stdin',\n '--key-pass',\n 'stdin',\n '--out',\n outfile,\n alignFile,\n ]);\n exec(signCommand, { input: `${keystorePW}\\n${keystorePW}`, stdio: ['pipe', 1, 2] });\n\n return outfile;\n};\n"]} \ No newline at end of file diff --git a/dist/build/exec_meteor_build.js b/dist/build/exec_meteor_build.js deleted file mode 100644 index 86208c8..0000000 --- a/dist/build/exec_meteor_build.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; - -var _extends = require('babel-runtime/helpers/extends')['default']; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _configsDirectories = require('../configs/directories'); - -var _utilsExec = require('../utils/exec'); - -var _utilsExec2 = _interopRequireDefault(_utilsExec); - -var execInstallNpmModules = function execInstallNpmModules(_ref) { - var config = _ref.config; - - if (config.useYarn) { - // install yarn if not available on meteor - (0, _utilsExec2['default'])('meteor npm install -g yarn', { - cwd: config.appDir, - stdio: 'inherit' - }); - } - (0, _utilsExec2['default'])('meteor ' + (config.useYarn ? 'yarn' : 'npm') + ' install', { - cwd: config.appDir, - stdio: 'inherit' - }); -}; - -exports['default'] = function (_ref2) { - var config = _ref2.config; - var environment = _ref2.environment; - var _ref2$additionalBuildEnv = _ref2.additionalBuildEnv; - var additionalBuildEnv = _ref2$additionalBuildEnv === undefined ? {} : _ref2$additionalBuildEnv; - var args = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1]; - - var buildDir = (0, _configsDirectories.getBuildDir)({ config: config, environment: environment }); - var envConf = config.environments[environment]; - // read build params - var _envConf$buildEnv = envConf.buildEnv; - var buildEnv = _envConf$buildEnv === undefined ? {} : _envConf$buildEnv; - - var buildEnvWithAppVersions = _extends({}, additionalBuildEnv, buildEnv); - var buildEnvString = _lodash2['default'].map(buildEnvWithAppVersions, function (value, key) { - return key + '=\'' + value + '\''; - }).join(' '); - execInstallNpmModules({ config: config }); - (0, _utilsExec2['default'])(buildEnvString + ' meteor build ' + args.join(' ') + ' --architecture os.linux.x86_64 --server ' + envConf.url + ' --directory ' + buildDir, { - cwd: config.appDir, - stdio: 'inherit' - }); -}; - -module.exports = exports['default']; -//# sourceMappingURL=exec_meteor_build.js.map \ No newline at end of file diff --git a/dist/build/exec_meteor_build.js.map b/dist/build/exec_meteor_build.js.map deleted file mode 100644 index aff325e..0000000 --- a/dist/build/exec_meteor_build.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/build/exec_meteor_build.js"],"names":[],"mappings":";;;;;;;;;;sBAAc,QAAQ;;;;kCAEM,wBAAwB;;yBACnC,eAAe;;;;AAEhC,IAAM,qBAAqB,GAAG,SAAxB,qBAAqB,CAAI,IAAU,EAAK;MAAb,MAAM,GAAR,IAAU,CAAR,MAAM;;AACrC,MAAI,MAAM,CAAC,OAAO,EAAE;;AAElB,gCAAK,4BAA4B,EAAE;AACjC,SAAG,EAAE,MAAM,CAAC,MAAM;AAClB,WAAK,EAAE,SAAS;KACjB,CAAC,CAAC;GACJ;AACD,2CAAe,MAAM,CAAC,OAAO,GAAG,MAAM,GAAG,KAAK,CAAA,eAAY;AACxD,OAAG,EAAE,MAAM,CAAC,MAAM;AAClB,SAAK,EAAE,SAAS;GACjB,CAAC,CAAC;CACJ,CAAC;;qBAEa,UAAC,KAAgD,EAAgB;MAA9D,MAAM,GAAR,KAAgD,CAA9C,MAAM;MAAE,WAAW,GAArB,KAAgD,CAAtC,WAAW;iCAArB,KAAgD,CAAzB,kBAAkB;MAAlB,kBAAkB,4CAAG,EAAE;MAAI,IAAI,yDAAG,EAAE;;AACzE,MAAM,QAAQ,GAAG,qCAAY,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;AACtD,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;;0BAEvB,OAAO,CAAzB,QAAQ;MAAR,QAAQ,qCAAG,EAAE;;AACrB,MAAM,uBAAuB,gBACxB,kBAAkB,EAClB,QAAQ,CACZ,CAAC;AACF,MAAM,cAAc,GAAG,oBAAE,GAAG,CAAC,uBAAuB,EAAE,UAAC,KAAK,EAAE,GAAG;WAAQ,GAAG,WAAK,KAAK;GAAG,CAAC,CAAC,IAAI,CAC7F,GAAG,CACJ,CAAC;AACF,uBAAqB,CAAC,EAAE,MAAM,EAAN,MAAM,EAAE,CAAC,CAAC;AAClC,8BACK,cAAc,sBAAiB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,iDAC9C,OAAO,CAAC,GAAG,qBACG,QAAQ,EACxB;AACE,OAAG,EAAE,MAAM,CAAC,MAAM;AAClB,SAAK,EAAE,SAAS;GACjB,CACF,CAAC;CACH","file":"exec_meteor_build.js","sourcesContent":["import _ from 'lodash';\n\nimport { getBuildDir } from '../configs/directories';\nimport exec from '../utils/exec';\n\nconst execInstallNpmModules = ({ config }) => {\n if (config.useYarn) {\n // install yarn if not available on meteor\n exec('meteor npm install -g yarn', {\n cwd: config.appDir,\n stdio: 'inherit',\n });\n }\n exec(`meteor ${config.useYarn ? 'yarn' : 'npm'} install`, {\n cwd: config.appDir,\n stdio: 'inherit',\n });\n};\n\nexport default ({ config, environment, additionalBuildEnv = {} }, args = []) => {\n const buildDir = getBuildDir({ config, environment });\n const envConf = config.environments[environment];\n // read build params\n const { buildEnv = {} } = envConf;\n const buildEnvWithAppVersions = {\n ...additionalBuildEnv,\n ...buildEnv,\n };\n const buildEnvString = _.map(buildEnvWithAppVersions, (value, key) => `${key}='${value}'`).join(\n ' ',\n );\n execInstallNpmModules({ config });\n exec(\n `${buildEnvString} meteor build ${args.join(' ')} --architecture os.linux.x86_64 --server ${\n envConf.url\n } --directory ${buildDir}`,\n {\n cwd: config.appDir,\n stdio: 'inherit',\n },\n );\n};\n"]} \ No newline at end of file diff --git a/dist/build/meteor_build.js b/dist/build/meteor_build.js deleted file mode 100644 index 9571271..0000000 --- a/dist/build/meteor_build.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -//# sourceMappingURL=meteor_build.js.map \ No newline at end of file diff --git a/dist/build/meteor_build.js.map b/dist/build/meteor_build.js.map deleted file mode 100644 index fb0338e..0000000 --- a/dist/build/meteor_build.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","file":"meteor_build.js","sourcesContent":[]} \ No newline at end of file diff --git a/dist/catladder.js b/dist/catladder.js deleted file mode 100644 index 46814d6..0000000 --- a/dist/catladder.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -var _toArray = require('babel-runtime/helpers/to-array')['default']; - -var _toConsumableArray = require('babel-runtime/helpers/to-consumable-array')['default']; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -var _interopRequireWildcard = require('babel-runtime/helpers/interop-require-wildcard')['default']; - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _camelcase = require('camelcase'); - -var _camelcase2 = _interopRequireDefault(_camelcase); - -var _minimist = require('minimist'); - -var _minimist2 = _interopRequireDefault(_minimist); - -var _commands = require('./commands'); - -var commands = _interopRequireWildcard(_commands); - -var _uiDone_error = require('./ui/done_error'); - -var _uiDone_error2 = _interopRequireDefault(_uiDone_error); - -var _uiDone_success = require('./ui/done_success'); - -var _uiDone_success2 = _interopRequireDefault(_uiDone_success); - -var _uiIntro = require('./ui/intro'); - -var _uiIntro2 = _interopRequireDefault(_uiIntro); - -// parse options -var options = (0, _minimist2['default'])(process.argv.slice(2)); - -var _options$_ = _toArray(options._); - -var commandRaw = _options$_[0]; -var environment = _options$_[1]; - -var additionalArgs = _options$_.slice(2); - -var command = options.v ? 'version' : commandRaw && (0, _camelcase2['default'])(commandRaw); - -// show intro -(0, _uiIntro2['default'])(); - -var done = function done(error, message) { - if (!error) { - (0, _uiDone_success2['default'])(message); - } else { - (0, _uiDone_error2['default'])(error, message); - } -}; - -if (commands[command]) { - if (command !== 'init' && command !== 'version' && command !== 'run' && !environment) { - (0, _uiDone_error2['default'])(null, 'please specify an environment'); - } else { - try { - commands[command].apply(commands, [environment, done].concat(_toConsumableArray(additionalArgs))); - } catch (e) { - done(e, 'command failed'); - } - } -} else { - console.log('available commands: '); - console.log(''); - console.log(_lodash2['default'].keys(commands).join('\n')); - done(); -} -//# sourceMappingURL=catladder.js.map \ No newline at end of file diff --git a/dist/catladder.js.map b/dist/catladder.js.map deleted file mode 100644 index 687e67e..0000000 --- a/dist/catladder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/catladder.js"],"names":[],"mappings":";;;;;;;;;;sBAAc,QAAQ;;;;yBACA,WAAW;;;;wBACZ,UAAU;;;;wBAEL,YAAY;;IAA1B,QAAQ;;4BACE,iBAAiB;;;;8BACf,mBAAmB;;;;uBACzB,YAAY;;;;;AAG9B,IAAM,OAAO,GAAG,2BAAS,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;;0BAEK,OAAO,CAAC,CAAC;;IAAvD,UAAU;IAAE,WAAW;;IAAK,cAAc;;AAEjD,IAAM,OAAO,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,GAAG,UAAU,IAAI,4BAAU,UAAU,CAAC,CAAC;;;AAG5E,2BAAO,CAAC;;AAER,IAAM,IAAI,GAAG,SAAP,IAAI,CAAI,KAAK,EAAE,OAAO,EAAK;AAC/B,MAAI,CAAC,KAAK,EAAE;AACV,qCAAY,OAAO,CAAC,CAAC;GACtB,MAAM;AACL,mCAAU,KAAK,EAAE,OAAO,CAAC,CAAC;GAC3B;CACF,CAAC;;AAEF,IAAI,QAAQ,CAAC,OAAO,CAAC,EAAE;AACrB,MAAI,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,IAAI,CAAC,WAAW,EAAE;AACpF,mCAAU,IAAI,EAAE,+BAA+B,CAAC,CAAC;GAClD,MAAM;AACL,QAAI;AACF,cAAQ,CAAC,OAAO,OAAC,CAAjB,QAAQ,GAAU,WAAW,EAAE,IAAI,4BAAK,cAAc,GAAC,CAAC;KACzD,CAAC,OAAO,CAAC,EAAE;AACV,UAAI,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;KAC3B;GACF;CACF,MAAM;AACL,SAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;AACpC,SAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAChB,SAAO,CAAC,GAAG,CAAC,oBAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACzC,MAAI,EAAE,CAAC;CACR","file":"catladder.js","sourcesContent":["import _ from 'lodash';\nimport camelCase from 'camelcase';\nimport minimist from 'minimist';\n\nimport * as commands from './commands';\nimport doneError from './ui/done_error';\nimport doneSuccess from './ui/done_success';\nimport intro from './ui/intro';\n\n// parse options\nconst options = minimist(process.argv.slice(2));\n\nconst [commandRaw, environment, ...additionalArgs] = options._;\n\nconst command = options.v ? 'version' : commandRaw && camelCase(commandRaw);\n\n// show intro\nintro();\n\nconst done = (error, message) => {\n if (!error) {\n doneSuccess(message);\n } else {\n doneError(error, message);\n }\n};\n\nif (commands[command]) {\n if (command !== 'init' && command !== 'version' && command !== 'run' && !environment) {\n doneError(null, 'please specify an environment');\n } else {\n try {\n commands[command](environment, done, ...additionalArgs);\n } catch (e) {\n done(e, 'command failed');\n }\n }\n} else {\n console.log('available commands: ');\n console.log('');\n console.log(_.keys(commands).join('\\n'));\n done();\n}\n"]} \ No newline at end of file diff --git a/dist/commands/android_init.js b/dist/commands/android_init.js deleted file mode 100644 index 83ed2a7..0000000 --- a/dist/commands/android_init.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _buildAndroid_build = require('../build/android_build'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(); - (0, _buildAndroid_build.androidInit)({ config: config, environment: environment }); - done(null, 'android is init'); -}; - -module.exports = exports['default']; -//# sourceMappingURL=android_init.js.map \ No newline at end of file diff --git a/dist/commands/android_init.js.map b/dist/commands/android_init.js.map deleted file mode 100644 index a13d8dc..0000000 --- a/dist/commands/android_init.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/android_init.js"],"names":[],"mappings":";;;;;;kCAA4B,wBAAwB;;iCACzB,uBAAuB;;qBAGnC,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,oCAAY,CAAC;AAC5B,uCAAY,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;AACrC,MAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;CAC/B","file":"android_init.js","sourcesContent":["import { androidInit } from '../build/android_build';\nimport { readConfig } from '../utils/config_utils';\n\n\nexport default (environment, done) => {\n const config = readConfig();\n androidInit({ config, environment });\n done(null, 'android is init');\n};\n"]} \ No newline at end of file diff --git a/dist/commands/android_prepare_for_store.js b/dist/commands/android_prepare_for_store.js deleted file mode 100644 index 19398ec..0000000 --- a/dist/commands/android_prepare_for_store.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _buildAndroid_build = require('../build/android_build'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(); - var outfile = (0, _buildAndroid_build.androidPrepareForStore)({ config: config, environment: environment }); - done(null, 'your apk is ready: ' + outfile); -}; - -module.exports = exports['default']; -//# sourceMappingURL=android_prepare_for_store.js.map \ No newline at end of file diff --git a/dist/commands/android_prepare_for_store.js.map b/dist/commands/android_prepare_for_store.js.map deleted file mode 100644 index 310ca75..0000000 --- a/dist/commands/android_prepare_for_store.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/android_prepare_for_store.js"],"names":[],"mappings":";;;;;;kCAAuC,wBAAwB;;iCACpC,uBAAuB;;qBAGnC,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,oCAAY,CAAC;AAC5B,MAAM,OAAO,GAAG,gDAAuB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;AAChE,MAAI,CAAC,IAAI,0BAAwB,OAAO,CAAG,CAAC;CAC7C","file":"android_prepare_for_store.js","sourcesContent":["import { androidPrepareForStore } from '../build/android_build';\nimport { readConfig } from '../utils/config_utils';\n\n\nexport default (environment, done) => {\n const config = readConfig();\n const outfile = androidPrepareForStore({ config, environment });\n done(null, `your apk is ready: ${outfile}`);\n};\n"]} \ No newline at end of file diff --git a/dist/commands/build_apps.js b/dist/commands/build_apps.js deleted file mode 100644 index 29f33d0..0000000 --- a/dist/commands/build_apps.js +++ /dev/null @@ -1,80 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _rimraf = require('rimraf'); - -var _rimraf2 = _interopRequireDefault(_rimraf); - -var _buildAndroid_build = require('../build/android_build'); - -var _configsDirectories = require('../configs/directories'); - -var _utilsGit_utils = require('../utils/git_utils'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var _utilsPass_utils = require('../utils/pass_utils'); - -var _uiAction_title = require('../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _android_prepare_for_store = require('./android_prepare_for_store'); - -var _android_prepare_for_store2 = _interopRequireDefault(_android_prepare_for_store); - -var _buildExec_meteor_build = require('../build/exec_meteor_build'); - -var _buildExec_meteor_build2 = _interopRequireDefault(_buildExec_meteor_build); - -var _ios_reveal_project = require('./ios_reveal_project'); - -var _ios_reveal_project2 = _interopRequireDefault(_ios_reveal_project); - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(); - var buildDir = (0, _configsDirectories.getBuildDir)({ config: config, environment: environment }); - (0, _uiAction_title2['default'])('building mobile apps ' + (0, _utilsGit_utils.getFullVersionString)(environment)); - - console.log('build dir: ' + buildDir); - - // read it so that it asks for password - // otherwise it asks in the middle of the build, which can take some minutes - (0, _utilsPass_utils.readEnvFileFromPass)(environment); - - // remove project folders if existing - // otherwise apps might get bloated with old code - if (_fs2['default'].existsSync((0, _buildAndroid_build.getAndroidBuildProjectFolder)({ config: config, environment: environment }))) { - _rimraf2['default'].sync((0, _buildAndroid_build.getAndroidBuildProjectFolder)({ config: config, environment: environment })); - } - if (_fs2['default'].existsSync((0, _configsDirectories.getIosBuildProjectFolder)({ config: config, environment: environment }))) { - _rimraf2['default'].sync((0, _configsDirectories.getIosBuildProjectFolder)({ config: config, environment: environment })); - } - var additionalBuildEnv = { - CORDOVA_APP_BUILD_NUMBER: (0, _utilsGit_utils.getBuildNumberFromGit)(), - CORDOVA_APP_VERSION: (0, _utilsGit_utils.getVersionFromTag)() - }; - (0, _buildExec_meteor_build2['default'])({ config: config, environment: environment, additionalBuildEnv: additionalBuildEnv }); - - // open ios project if exists - (0, _ios_reveal_project2['default'])(environment, config); - - // init android if it exists - if (_fs2['default'].existsSync((0, _buildAndroid_build.getAndroidBuildDir)({ config: config, environment: environment }))) { - (0, _android_prepare_for_store2['default'])(environment, done); - } else { - done(null, 'apps created in ' + buildDir); - } -}; - -module.exports = exports['default']; -//# sourceMappingURL=build_apps.js.map \ No newline at end of file diff --git a/dist/commands/build_apps.js.map b/dist/commands/build_apps.js.map deleted file mode 100644 index 2900973..0000000 --- a/dist/commands/build_apps.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/build_apps.js"],"names":[],"mappings":";;;;;;;;kBAAe,IAAI;;;;sBAEA,QAAQ;;;;kCAEsC,wBAAwB;;kCACnC,wBAAwB;;8BACC,oBAAoB;;iCACxE,uBAAuB;;+BACd,qBAAqB;;8BACjC,oBAAoB;;;;yCACT,6BAA6B;;;;sCACpC,4BAA4B;;;;kCAC3B,sBAAsB;;;;qBAEpC,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,oCAAY,CAAC;AAC5B,MAAM,QAAQ,GAAG,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BuildProjectFolder } from '../build/android_build';\nimport { getBuildDir, getIosBuildProjectFolder } from '../configs/directories';\nimport { getBuildNumberFromGit, getFullVersionString, getVersionFromTag } from '../utils/git_utils';\nimport { readConfig } from '../utils/config_utils';\nimport { readEnvFileFromPass } from '../utils/pass_utils';\nimport actionTitle from '../ui/action_title';\nimport androidPrepareForStore from './android_prepare_for_store';\nimport execMeteorBuild from '../build/exec_meteor_build';\nimport iosRevealProject from './ios_reveal_project';\n\nexport default (environment, done) => {\n const config = readConfig();\n const buildDir = getBuildDir({ config, environment });\n actionTitle(`building mobile apps ${getFullVersionString(environment)}`);\n\n console.log(`build dir: ${buildDir}`);\n\n // read it so that it asks for password\n // otherwise it asks in the middle of the build, which can take some minutes\n readEnvFileFromPass(environment);\n\n // remove project folders if existing\n // otherwise apps might get bloated with old code\n if (fs.existsSync(getAndroidBuildProjectFolder({ config, environment }))) {\n rimraf.sync(getAndroidBuildProjectFolder({ config, environment }));\n }\n if (fs.existsSync(getIosBuildProjectFolder({ config, environment }))) {\n rimraf.sync(getIosBuildProjectFolder({ config, environment }));\n }\n const additionalBuildEnv = {\n CORDOVA_APP_BUILD_NUMBER: getBuildNumberFromGit(),\n CORDOVA_APP_VERSION: getVersionFromTag(),\n };\n execMeteorBuild({ config, environment, additionalBuildEnv });\n\n // open ios project if exists\n iosRevealProject(environment, config);\n\n // init android if it exists\n if (fs.existsSync(getAndroidBuildDir({ config, environment }))) {\n androidPrepareForStore(environment, done);\n } else {\n done(null, `apps created in ${buildDir}`);\n }\n};\n"]} \ No newline at end of file diff --git a/dist/commands/build_server.js b/dist/commands/build_server.js deleted file mode 100644 index 7ea0931..0000000 --- a/dist/commands/build_server.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _utilsGit_utils = require('../utils/git_utils'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var _uiAction_title = require('../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _buildExec_meteor_build = require('../build/exec_meteor_build'); - -var _buildExec_meteor_build2 = _interopRequireDefault(_buildExec_meteor_build); - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(); - // read build params - (0, _uiAction_title2['default'])('building server ' + (0, _utilsGit_utils.getFullVersionString)(environment)); - var additionalBuildEnv = { - SERVER_APP_BUILD_NUMBER: (0, _utilsGit_utils.getBuildNumberFromGit)(), - SERVER_APP_VERSION: (0, _utilsGit_utils.getVersionFromTag)() - }; - (0, _buildExec_meteor_build2['default'])({ config: config, environment: environment, additionalBuildEnv: additionalBuildEnv }, ['--server-only']); - done(null, 'server built'); -}; - -module.exports = exports['default']; -//# sourceMappingURL=build_server.js.map \ No newline at end of file diff --git a/dist/commands/build_server.js.map b/dist/commands/build_server.js.map deleted file mode 100644 index b233a09..0000000 --- a/dist/commands/build_server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/build_server.js"],"names":[],"mappings":";;;;;;;;8BAA+E,oBAAoB;;iCACxE,uBAAuB;;8BAC1B,oBAAoB;;;;sCAChB,4BAA4B;;;;qBAEzC,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,oCAAY,CAAC;;AAE5B,wDAA+B,0CAAqB,WAAW,CAAC,CAAG,CAAC;AACpE,MAAM,kBAAkB,GAAG;AACzB,2BAAuB,EAAE,4CAAuB;AAChD,sBAAkB,EAAE,wCAAmB;GACxC,CAAC;AACF,2CAAgB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,kBAAkB,EAAlB,kBAAkB,EAAE,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;AAChF,MAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;CAC5B","file":"build_server.js","sourcesContent":["import { getBuildNumberFromGit, getFullVersionString, getVersionFromTag } from '../utils/git_utils';\nimport { readConfig } from '../utils/config_utils';\nimport actionTitle from '../ui/action_title';\nimport execMeteorBuild from '../build/exec_meteor_build';\n\nexport default (environment, done) => {\n const config = readConfig();\n // read build params\n actionTitle(`building server ${getFullVersionString(environment)}`);\n const additionalBuildEnv = {\n SERVER_APP_BUILD_NUMBER: getBuildNumberFromGit(),\n SERVER_APP_VERSION: getVersionFromTag(),\n };\n execMeteorBuild({ config, environment, additionalBuildEnv }, ['--server-only']);\n done(null, 'server built');\n};\n"]} \ No newline at end of file diff --git a/dist/commands/config.js b/dist/commands/config.js deleted file mode 100644 index 4fb014c..0000000 --- a/dist/commands/config.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -var _extends = require('babel-runtime/helpers/extends')['default']; - -var _defineProperty = require('babel-runtime/helpers/define-property')['default']; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _prompt = require('prompt'); - -var _prompt2 = _interopRequireDefault(_prompt); - -var _jsYaml = require('js-yaml'); - -var _jsYaml2 = _interopRequireDefault(_jsYaml); - -var _configsPrompt_schemas = require('../configs/prompt_schemas'); - -var _configsDirectories = require('../configs/directories'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var _utilsPass_utils = require('../utils/pass_utils'); - -var _uiAction_title = require('../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _configsDefault_env = require('../configs/default_env'); - -var _configsDefault_env2 = _interopRequireDefault(_configsDefault_env); - -var _deploymentsGet_deployment_command = require('../deployments/get_deployment_command'); - -var _deploymentsGet_deployment_command2 = _interopRequireDefault(_deploymentsGet_deployment_command); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(); - _prompt2['default'].start(); - - (0, _uiAction_title2['default'])('setting up ' + environment); - var passPathForEnvVars = (0, _configsDirectories.passEnvFile)({ config: config, environment: environment }); - // console.log(passPathForEnvVars); - var oldEnvConfig = _lodash2['default'].get(config, ['environments', environment], {}); - _prompt2['default'].get((0, _configsPrompt_schemas.environmentSchema)(_extends({}, config, { environment: environment })), function (error, envConfig) { - // write new envConfig - config.environments = _extends({}, config.environments, _defineProperty({}, environment, _extends({}, oldEnvConfig, envConfig))); - (0, _utilsConfig_utils.writeConfig)(CONFIGFILE, config); - // update env-vars in path - // first get current vars in path - var envVars = (0, _utilsPass_utils.readPassYaml)(passPathForEnvVars); - // if envVars do not exist yet, create new one and write to pass - if (_lodash2['default'].isEmpty(envVars)) { - envVars = (0, _configsDefault_env2['default'])({ config: config, envConfig: envConfig }); - (0, _utilsPass_utils.writePass)(passPathForEnvVars, _jsYaml2['default'].safeDump(envVars)); - } - // open editor to edit the en vars - (0, _utilsPass_utils.editPass)(passPathForEnvVars); - - var command = (0, _deploymentsGet_deployment_command2['default'])(environment, 'applyConfig'); - if (command) command(environment, done);else { - done(); - } - }); -}; - -module.exports = exports['default']; -// merge with old config -//# sourceMappingURL=config.js.map \ No newline at end of file diff --git a/dist/commands/config.js.map b/dist/commands/config.js.map deleted file mode 100644 index a2c552b..0000000 --- a/dist/commands/config.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/config.js"],"names":[],"mappings":";;;;;;;;;;;;sBAAc,QAAQ;;;;sBACH,QAAQ;;;;sBACV,SAAS;;;;qCAEQ,2BAA2B;;kCACjC,wBAAwB;;iCACZ,uBAAuB;;+BACb,qBAAqB;;8BAC/C,oBAAoB;;;;kCACrB,wBAAwB;;;;iDACd,uCAAuC;;;;AAExE,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAEtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,oCAAY,CAAC;AAC5B,sBAAO,KAAK,EAAE,CAAC;;AAEf,mDAA0B,WAAW,CAAG,CAAC;AACzC,MAAM,kBAAkB,GAAG,qCAAY,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;;AAEhE,MAAM,YAAY,GAAG,oBAAE,GAAG,CAAC,MAAM,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;AACtE,sBAAO,GAAG,CAAC,2DAAuB,MAAM,IAAE,WAAW,EAAX,WAAW,IAAG,EAAE,UAAC,KAAK,EAAE,SAAS,EAAK;;AAE9E,UAAM,CAAC,YAAY,gBACd,MAAM,CAAC,YAAY,sBACrB,WAAW,eACP,YAAY,EACZ,SAAS,GAEf,CAAC;AACF,wCAAY,UAAU,EAAE,MAAM,CAAC,CAAC;;;AAGhC,QAAI,OAAO,GAAG,mCAAa,kBAAkB,CAAC,CAAC;;AAE/C,QAAI,oBAAE,OAAO,CAAC,OAAO,CAAC,EAAE;AACtB,aAAO,GAAG,qCAAW,EAAE,MAAM,EAAN,MAAM,EAAE,SAAS,EAAT,SAAS,EAAE,CAAC,CAAC;AAC5C,sCAAU,kBAAkB,EAAE,oBAAK,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;KACvD;;AAED,mCAAS,kBAAkB,CAAC,CAAC;;AAE7B,QAAM,OAAO,GAAG,oDAAqB,WAAW,EAAE,aAAa,CAAC,CAAC;AACjE,QAAI,OAAO,EAAE,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,KACnC;AACH,UAAI,EAAE,CAAC;KACR;GACF,CAAC,CAAC;CACJ","file":"config.js","sourcesContent":["import _ from 'lodash';\nimport prompt from 'prompt';\nimport yaml from 'js-yaml';\n\nimport { environmentSchema } from '../configs/prompt_schemas';\nimport { passEnvFile } from '../configs/directories';\nimport { readConfig, writeConfig } from '../utils/config_utils';\nimport { writePass, editPass, readPassYaml } from '../utils/pass_utils';\nimport actionTitle from '../ui/action_title';\nimport defaultEnv from '../configs/default_env';\nimport getDeploymentCommand from '../deployments/get_deployment_command';\n\nconst CONFIGFILE = '.catladder.yaml';\n\nexport default (environment, done) => {\n const config = readConfig();\n prompt.start();\n\n actionTitle(`setting up ${environment}`);\n const passPathForEnvVars = passEnvFile({ config, environment });\n // console.log(passPathForEnvVars);\n const oldEnvConfig = _.get(config, ['environments', environment], {});\n prompt.get(environmentSchema({ ...config, environment }), (error, envConfig) => {\n // write new envConfig\n config.environments = {\n ...config.environments,\n [environment]: {\n ...oldEnvConfig, // merge with old config\n ...envConfig,\n },\n };\n writeConfig(CONFIGFILE, config);\n // update env-vars in path\n // first get current vars in path\n let envVars = readPassYaml(passPathForEnvVars);\n // if envVars do not exist yet, create new one and write to pass\n if (_.isEmpty(envVars)) {\n envVars = defaultEnv({ config, envConfig });\n writePass(passPathForEnvVars, yaml.safeDump(envVars));\n }\n // open editor to edit the en vars\n editPass(passPathForEnvVars);\n\n const command = getDeploymentCommand(environment, 'applyConfig');\n if (command) command(environment, done);\n else {\n done();\n }\n });\n};\n"]} \ No newline at end of file diff --git a/dist/commands/deploy.js b/dist/commands/deploy.js deleted file mode 100644 index f7b39b1..0000000 --- a/dist/commands/deploy.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _utilsPass_utils = require('../utils/pass_utils'); - -var _uiAction_title = require('../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _deploymentsGet_deployment_command = require('../deployments/get_deployment_command'); - -var _deploymentsGet_deployment_command2 = _interopRequireDefault(_deploymentsGet_deployment_command); - -exports['default'] = function (environment, done) { - (0, _uiAction_title2['default'])('deploying ' + environment); - // read it so that it asks for password - // otherwise it asks in the middle of the build, which can take some minutes - (0, _utilsPass_utils.readEnvFileFromPass)(environment); - var command = (0, _deploymentsGet_deployment_command2['default'])(environment, 'deploy'); - command(environment, done); -}; - -module.exports = exports['default']; -//# sourceMappingURL=deploy.js.map \ No newline at end of file diff --git a/dist/commands/deploy.js.map b/dist/commands/deploy.js.map deleted file mode 100644 index ab5f072..0000000 --- a/dist/commands/deploy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/deploy.js"],"names":[],"mappings":";;;;;;;;+BAAoC,qBAAqB;;8BACjC,oBAAoB;;;;iDACX,uCAAuC;;;;qBAEzD,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,kDAAyB,WAAW,CAAG,CAAC;;;AAGxC,4CAAoB,WAAW,CAAC,CAAC;AACjC,MAAM,OAAO,GAAG,oDAAqB,WAAW,EAAE,QAAQ,CAAC,CAAC;AAC5D,SAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;CAC5B","file":"deploy.js","sourcesContent":["import { readEnvFileFromPass } from '../utils/pass_utils';\nimport actionTitle from '../ui/action_title';\nimport getDeploymentCommand from '../deployments/get_deployment_command';\n\nexport default (environment, done) => {\n actionTitle(`deploying ${environment}`);\n // read it so that it asks for password\n // otherwise it asks in the middle of the build, which can take some minutes\n readEnvFileFromPass(environment);\n const command = getDeploymentCommand(environment, 'deploy');\n command(environment, done);\n};\n"]} \ No newline at end of file diff --git a/dist/commands/deploy_push.js b/dist/commands/deploy_push.js deleted file mode 100644 index 0a4718e..0000000 --- a/dist/commands/deploy_push.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _deploymentsGet_deployment_command = require('../deployments/get_deployment_command'); - -var _deploymentsGet_deployment_command2 = _interopRequireDefault(_deploymentsGet_deployment_command); - -exports['default'] = function (environment, done) { - var command = (0, _deploymentsGet_deployment_command2['default'])(environment, 'push'); - command(environment, done); -}; - -module.exports = exports['default']; -//# sourceMappingURL=deploy_push.js.map \ No newline at end of file diff --git a/dist/commands/deploy_push.js.map b/dist/commands/deploy_push.js.map deleted file mode 100644 index 960a1c4..0000000 --- a/dist/commands/deploy_push.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/deploy_push.js"],"names":[],"mappings":";;;;;;;;iDAAiC,uCAAuC;;;;qBAEzD,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,OAAO,GAAG,oDAAqB,WAAW,EAAE,MAAM,CAAC,CAAC;AAC1D,SAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;CAC5B","file":"deploy_push.js","sourcesContent":["import getDeploymentCommand from '../deployments/get_deployment_command';\n\nexport default (environment, done) => {\n const command = getDeploymentCommand(environment, 'push');\n command(environment, done);\n};\n"]} \ No newline at end of file diff --git a/dist/commands/deploy_restart.js b/dist/commands/deploy_restart.js deleted file mode 100644 index ef24f67..0000000 --- a/dist/commands/deploy_restart.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _uiAction_title = require('../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _deploymentsGet_deployment_command = require('../deployments/get_deployment_command'); - -var _deploymentsGet_deployment_command2 = _interopRequireDefault(_deploymentsGet_deployment_command); - -exports['default'] = function (environment, done) { - var deployCommand = (0, _deploymentsGet_deployment_command2['default'])(environment, 'restart'); - (0, _uiAction_title2['default'])('restarting ' + environment); - deployCommand(environment, done); -}; - -module.exports = exports['default']; -//# sourceMappingURL=deploy_restart.js.map \ No newline at end of file diff --git a/dist/commands/deploy_restart.js.map b/dist/commands/deploy_restart.js.map deleted file mode 100644 index 9977cf6..0000000 --- a/dist/commands/deploy_restart.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/deploy_restart.js"],"names":[],"mappings":";;;;;;;;8BAAwB,oBAAoB;;;;iDACX,uCAAuC;;;;qBAEzD,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,aAAa,GAAG,oDAAqB,WAAW,EAAE,SAAS,CAAC,CAAC;AACnE,mDAA0B,WAAW,CAAG,CAAC;AACzC,eAAa,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;CAClC","file":"deploy_restart.js","sourcesContent":["import actionTitle from '../ui/action_title';\nimport getDeploymentCommand from '../deployments/get_deployment_command';\n\nexport default (environment, done) => {\n const deployCommand = getDeploymentCommand(environment, 'restart');\n actionTitle(`restarting ${environment}`);\n deployCommand(environment, done);\n};\n"]} \ No newline at end of file diff --git a/dist/commands/edit_env.js b/dist/commands/edit_env.js deleted file mode 100644 index 013af1d..0000000 --- a/dist/commands/edit_env.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _utilsPass_utils = require('../utils/pass_utils'); - -var _configsDirectories = require('../configs/directories'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(); - var passPathForEnvVars = (0, _configsDirectories.passEnvFile)({ config: config, environment: environment }); - (0, _utilsPass_utils.editPass)(passPathForEnvVars); - done(null, 'env in pass edited. Remember that this not updates the server. Use catladder setup to do so'); -}; - -module.exports = exports['default']; -//# sourceMappingURL=edit_env.js.map \ No newline at end of file diff --git a/dist/commands/edit_env.js.map b/dist/commands/edit_env.js.map deleted file mode 100644 index 571692c..0000000 --- a/dist/commands/edit_env.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/edit_env.js"],"names":[],"mappings":";;;;;;+BAAyB,qBAAqB;;kCAClB,wBAAwB;;iCACzB,uBAAuB;;qBAInC,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,oCAAY,CAAC;AAC5B,MAAM,kBAAkB,GAAG,qCAAY,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;AAChE,iCAAS,kBAAkB,CAAC,CAAC;AAC7B,MAAI,CAAC,IAAI,EAAE,mGAAmG,CAAC,CAAC;CACjH","file":"edit_env.js","sourcesContent":["import { editPass } from '../utils/pass_utils';\nimport { passEnvFile } from '../configs/directories';\nimport { readConfig } from '../utils/config_utils';\n\n\n\nexport default (environment, done) => {\n const config = readConfig();\n const passPathForEnvVars = passEnvFile({ config, environment });\n editPass(passPathForEnvVars);\n done(null, 'env in pass edited. Remember that this not updates the server. Use catladder setup to do so');\n};\n"]} \ No newline at end of file diff --git a/dist/commands/generic_command.js b/dist/commands/generic_command.js deleted file mode 100644 index f3616d3..0000000 --- a/dist/commands/generic_command.js +++ /dev/null @@ -1,80 +0,0 @@ -"use strict"; - -// draft -/* -sample config - - -customer: pvl -appname: biketowork -passPath: pvl/biketowork -appDir: ./app -buildDir: ./build -environments: - staging: - url: 'https://biketowork-staging.panter.biz' - commands: - deploy-web: - env: - MONGO_URL: 'mongodb://mongo-0.mongo,mongo-1.mongo,mongo-2.mongo,mongo-3.mongo:27017/biketowork?replicaSet=oplog' - PORT: '8080' - MONGO_OPLOG_URL: 'mongodb://mongo-0.mongo,mongo-1.mongo,mongo-2.mongo,mongo-3.mongo:27017/local?replicaSet=oplog' - tasks: - web: - type: panter-meteor-kubernetes - template: kube/staging/deployment.biketowork_web.yml - worker: - type: panter-meteor-kubernetes - template: kube/staging/deployment.biketowork_worker.yml - env: - BACKGROUND_JOBS_ENABLED: true - build-apps: - type: panter-meteor-cordova - meteorBuildEnv: - CORDOVA_APP_NAME: bike to work staging - CORDOVA_APP_ID: ch.biketowork.biketowork-staging - - - #host: biketowork-staging.panter.biz - #user: app - #url: 'https://biketowork-staging.panter.biz' - #androidKeystore: ./android.keystore - #androidKeyname: biketowork - #androidDName: 'cn=Panter, ou=Panter, o=Panter, c=CH' - #buildEnv: - # CORDOVA_APP_NAME: bike to work staging - # CORDOVA_APP_ID: ch.biketowork.biketowork-staging - - production: - host: biketowork-production.panter.biz - user: app - url: 'https://www.biketowork.ch' - androidKeystore: ./android.keystore - androidKeyname: biketowork - androidDName: 'cn=Panter, ou=Panter, o=Panter, c=CH' - buildEnv: - CORDOVA_APP_NAME: bike to work - CORDOVA_APP_ID: ch.biketowork.biketowork -androidBuildToolVersion: 25.0.2 - - -const doCommand = (environment, { tasks, type, ...commandProps }) => { - if (!empty(tasks) && !empty(type)) { - throw new Error('either define tasks or define a type (then its one task), but not both'); - } - if (empty(tasks)) { - doTask(environment, type, commandProps); - } else { - forEach(tasks, ({ type, ...taskProps }, key) => { - const props = merge({}, taskProps, commandProps); - doTask(environment, type, props); - }); - } -}; - -const doTask = (environment, type, props) => { - const task = TASKS[taskDef.type]; - task(environment, props); -}; -*/ -//# sourceMappingURL=generic_command.js.map \ No newline at end of file diff --git a/dist/commands/generic_command.js.map b/dist/commands/generic_command.js.map deleted file mode 100644 index cf50164..0000000 --- a/dist/commands/generic_command.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","file":"generic_command.js","sourcesContent":[]} \ No newline at end of file diff --git a/dist/commands/index.js b/dist/commands/index.js deleted file mode 100644 index d5868dc..0000000 --- a/dist/commands/index.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _buildAndroid_build = require('../build/android_build'); - -var _build_apps = require('./build_apps'); - -var _build_apps2 = _interopRequireDefault(_build_apps); - -var _build_server = require('./build_server'); - -var _build_server2 = _interopRequireDefault(_build_server); - -var _edit_env = require('./edit_env'); - -var _edit_env2 = _interopRequireDefault(_edit_env); - -var _run = require('./run'); - -var _run2 = _interopRequireDefault(_run); - -var _init = require('./init'); - -var _init2 = _interopRequireDefault(_init); - -var _ios_reveal_project = require('./ios_reveal_project'); - -var _ios_reveal_project2 = _interopRequireDefault(_ios_reveal_project); - -var _restart = require('./restart'); - -var _restart2 = _interopRequireDefault(_restart); - -var _config = require('./config'); - -var _config2 = _interopRequireDefault(_config); - -var _deploy = require('./deploy'); - -var _deploy2 = _interopRequireDefault(_deploy); - -var _deploy_push = require('./deploy_push'); - -var _deploy_push2 = _interopRequireDefault(_deploy_push); - -var _version = require('./version'); - -var _version2 = _interopRequireDefault(_version); - -exports.init = _init2['default']; -exports.config = _config2['default']; -exports.run = _run2['default']; -exports.editEnv = _edit_env2['default']; -exports.restart = _restart2['default']; -exports.buildServer = _build_server2['default']; -exports.buildApps = _build_apps2['default']; -exports.iosRevealProject = _ios_reveal_project2['default']; -exports.androidPrepareForStore = _buildAndroid_build.androidPrepareForStore; -exports.androidInit = _buildAndroid_build.androidInit; -exports.deployPush = _deploy_push2['default']; -exports.deploy = _deploy2['default']; -exports.version = _version2['default']; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/commands/index.js.map b/dist/commands/index.js.map deleted file mode 100644 index 6423698..0000000 --- a/dist/commands/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/index.js"],"names":[],"mappings":";;;;;;;;kCAAoD,wBAAwB;;0BACtD,cAAc;;;;4BACZ,gBAAgB;;;;wBAEpB,YAAY;;;;mBAChB,OAAO;;;;oBACN,QAAQ;;;;kCACI,sBAAsB;;;;uBAC/B,WAAW;;;;sBACZ,UAAU;;;;sBACV,UAAU;;;;2BACN,eAAe;;;;uBAClB,WAAW;;;;QAG7B,IAAI;QACJ,MAAM;QACN,GAAG;QACH,OAAO;QACP,OAAO;QACP,WAAW;QACX,SAAS;QACT,gBAAgB;QAChB,sBAAsB;QACtB,WAAW;QACX,UAAU;QACV,MAAM;QACN,OAAO","file":"index.js","sourcesContent":["import { androidInit, androidPrepareForStore } from '../build/android_build';\nimport buildApps from './build_apps';\nimport buildServer from './build_server';\n\nimport editEnv from './edit_env';\nimport run from './run';\nimport init from './init';\nimport iosRevealProject from './ios_reveal_project';\nimport restart from './restart';\nimport config from './config';\nimport deploy from './deploy';\nimport deployPush from './deploy_push';\nimport version from './version';\n\nexport {\n init,\n config,\n run,\n editEnv,\n restart,\n buildServer,\n buildApps,\n iosRevealProject,\n androidPrepareForStore,\n androidInit,\n deployPush,\n deploy,\n version,\n};\n"]} \ No newline at end of file diff --git a/dist/commands/init.js b/dist/commands/init.js deleted file mode 100644 index c843e44..0000000 --- a/dist/commands/init.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -var _extends = require('babel-runtime/helpers/extends')['default']; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _prompt = require('prompt'); - -var _prompt2 = _interopRequireDefault(_prompt); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _path = require('path'); - -var _path2 = _interopRequireDefault(_path); - -var _configsPrompt_schemas = require('../configs/prompt_schemas'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (__, done) { - var configOld = _fs2['default'].existsSync(CONFIGFILE) && (0, _utilsConfig_utils.readConfig)() || {}; - _prompt2['default'].start(); - _prompt2['default'].get((0, _configsPrompt_schemas.initSchema)(configOld), function (error, configNew) { - var config = _extends({}, configOld, configNew); - (0, _utilsConfig_utils.writeConfig)(CONFIGFILE, config); - var buildDir = _path2['default'].resolve(config.buildDir); - if (!_fs2['default'].existsSync(buildDir)) { - _fs2['default'].mkdirSync(buildDir); - } - done(null, 'created ' + CONFIGFILE); - }); -}; - -module.exports = exports['default']; -//# sourceMappingURL=init.js.map \ No newline at end of file diff --git a/dist/commands/init.js.map b/dist/commands/init.js.map deleted file mode 100644 index 60d6d11..0000000 --- a/dist/commands/init.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/init.js"],"names":[],"mappings":";;;;;;;;;;sBAAmB,QAAQ;;;;kBAEZ,IAAI;;;;oBACF,MAAM;;;;qCAEI,2BAA2B;;iCACd,uBAAuB;;AAE/D,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBACtB,UAAC,EAAE,EAAE,IAAI,EAAK;AAC3B,MAAM,SAAS,GAAG,AAAC,gBAAG,UAAU,CAAC,UAAU,CAAC,IAAI,oCAAY,IAAK,EAAE,CAAC;AACpE,sBAAO,KAAK,EAAE,CAAC;AACf,sBAAO,GAAG,CAAC,uCAAW,SAAS,CAAC,EAAE,UAAC,KAAK,EACtC,SAAS,EACN;AACH,QAAM,MAAM,gBACP,SAAS,EACT,SAAS,CACb,CAAC;AACF,wCAAY,UAAU,EAAE,MAAM,CAAC,CAAC;AAChC,QAAM,QAAQ,GAAG,kBAAK,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC/C,QAAI,CAAC,gBAAG,UAAU,CAAC,QAAQ,CAAC,EAAE;AAC5B,sBAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;KACxB;AACD,QAAI,CAAC,IAAI,eAAa,UAAU,CAAG,CAAC;GACrC,CAAC,CAAC;CACJ","file":"init.js","sourcesContent":["import prompt from 'prompt';\n\nimport fs from 'fs';\nimport path from 'path';\n\nimport { initSchema } from '../configs/prompt_schemas';\nimport { readConfig, writeConfig } from '../utils/config_utils';\n\nconst CONFIGFILE = '.catladder.yaml';\nexport default (__, done) => {\n const configOld = (fs.existsSync(CONFIGFILE) && readConfig()) || {};\n prompt.start();\n prompt.get(initSchema(configOld), (error,\n configNew,\n ) => {\n const config = {\n ...configOld,\n ...configNew,\n };\n writeConfig(CONFIGFILE, config);\n const buildDir = path.resolve(config.buildDir);\n if (!fs.existsSync(buildDir)) {\n fs.mkdirSync(buildDir);\n }\n done(null, `created ${CONFIGFILE}`);\n });\n};\n"]} \ No newline at end of file diff --git a/dist/commands/ios_reveal_project.js b/dist/commands/ios_reveal_project.js deleted file mode 100644 index 074bd6c..0000000 --- a/dist/commands/ios_reveal_project.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _configsDirectories = require('../configs/directories'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var _utilsExec = require('../utils/exec'); - -var _utilsExec2 = _interopRequireDefault(_utilsExec); - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(); - if (_fs2['default'].existsSync((0, _configsDirectories.getIosBuildProjectFolder)({ config: config, environment: environment }))) { - (0, _utilsExec2['default'])('open ' + (0, _configsDirectories.getIosBuildProjectFolder)({ config: config, environment: environment })); - } else { - done(null, 'ios project does not exist under ' + (0, _configsDirectories.getIosBuildProjectFolder)({ config: config, environment: environment })); - } -}; - -module.exports = exports['default']; -//# sourceMappingURL=ios_reveal_project.js.map \ No newline at end of file diff --git a/dist/commands/ios_reveal_project.js.map b/dist/commands/ios_reveal_project.js.map deleted file mode 100644 index bd0670e..0000000 --- a/dist/commands/ios_reveal_project.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/ios_reveal_project.js"],"names":[],"mappings":";;;;;;;;kBAAe,IAAI;;;;kCAEsB,wBAAwB;;iCACtC,uBAAuB;;yBACjC,eAAe;;;;qBAEjB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,oCAAY,CAAC;AAC5B,MAAI,gBAAG,UAAU,CAAC,kDAAyB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC,EAAE;AACpE,0CAAa,kDAAyB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAG,CAAC;GACnE,MAAM;AACL,QAAI,CACF,IAAI,wCACgC,kDAAyB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CACtF,CAAC;GACH;CACF","file":"ios_reveal_project.js","sourcesContent":["import fs from 'fs';\n\nimport { getIosBuildProjectFolder } from '../configs/directories';\nimport { readConfig } from '../utils/config_utils';\nimport exec from '../utils/exec';\n\nexport default (environment, done) => {\n const config = readConfig();\n if (fs.existsSync(getIosBuildProjectFolder({ config, environment }))) {\n exec(`open ${getIosBuildProjectFolder({ config, environment })}`);\n } else {\n done(\n null,\n `ios project does not exist under ${getIosBuildProjectFolder({ config, environment })}`,\n );\n }\n};\n"]} \ No newline at end of file diff --git a/dist/commands/push_server.js b/dist/commands/push_server.js deleted file mode 100644 index 727d8dc..0000000 --- a/dist/commands/push_server.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _deploymentsGet_deployment_command = require('../deployments/get_deployment_command'); - -var _deploymentsGet_deployment_command2 = _interopRequireDefault(_deploymentsGet_deployment_command); - -var _restart = require('./restart'); - -var _restart2 = _interopRequireDefault(_restart); - -exports['default'] = function (environment, done) { - var command = (0, _deploymentsGet_deployment_command2['default'])(environment, 'push_server'); - command(environment, done); -}; - -module.exports = exports['default']; -//# sourceMappingURL=push_server.js.map \ No newline at end of file diff --git a/dist/commands/push_server.js.map b/dist/commands/push_server.js.map deleted file mode 100644 index 4da9ef2..0000000 --- a/dist/commands/push_server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/push_server.js"],"names":[],"mappings":";;;;;;;;iDAAiC,uCAAuC;;;;uBACpD,WAAW;;;;qBAEhB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,OAAO,GAAG,oDAAqB,WAAW,EAAE,aAAa,CAAC,CAAC;AACjE,SAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;CAC5B","file":"push_server.js","sourcesContent":["import getDeploymentCommand from '../deployments/get_deployment_command';\nimport restart from './restart';\n\nexport default (environment, done) => {\n const command = getDeploymentCommand(environment, 'push_server');\n command(environment, done);\n};\n"]} \ No newline at end of file diff --git a/dist/commands/restart.js b/dist/commands/restart.js deleted file mode 100644 index 89a7822..0000000 --- a/dist/commands/restart.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _uiAction_title = require('../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _deploymentsGet_deployment_command = require('../deployments/get_deployment_command'); - -var _deploymentsGet_deployment_command2 = _interopRequireDefault(_deploymentsGet_deployment_command); - -exports['default'] = function (environment, done) { - var deployCommand = (0, _deploymentsGet_deployment_command2['default'])(environment, 'restart'); - (0, _uiAction_title2['default'])('restarting ' + environment); - deployCommand(environment, done); -}; - -module.exports = exports['default']; -//# sourceMappingURL=restart.js.map \ No newline at end of file diff --git a/dist/commands/restart.js.map b/dist/commands/restart.js.map deleted file mode 100644 index b960ee7..0000000 --- a/dist/commands/restart.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/restart.js"],"names":[],"mappings":";;;;;;;;8BAAwB,oBAAoB;;;;iDACX,uCAAuC;;;;qBAGzD,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,aAAa,GAAG,oDAAqB,WAAW,EAAE,SAAS,CAAC,CAAC;AACnE,mDAA0B,WAAW,CAAG,CAAC;AACzC,eAAa,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;CAClC","file":"restart.js","sourcesContent":["import actionTitle from '../ui/action_title';\nimport getDeploymentCommand from '../deployments/get_deployment_command';\n\n\nexport default (environment, done) => {\n const deployCommand = getDeploymentCommand(environment, 'restart');\n actionTitle(`restarting ${environment}`);\n deployCommand(environment, done);\n};\n"]} \ No newline at end of file diff --git a/dist/commands/run.js b/dist/commands/run.js deleted file mode 100644 index bfa84cd..0000000 --- a/dist/commands/run.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _lodash = require('lodash'); - -var _prompt = require('prompt'); - -var _prompt2 = _interopRequireDefault(_prompt); - -var _uniqueFilename = require('unique-filename'); - -var _uniqueFilename2 = _interopRequireDefault(_uniqueFilename); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _os = require('os'); - -var _os2 = _interopRequireDefault(_os); - -var _configsDirectories = require('../configs/directories'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var _utilsPass_utils = require('../utils/pass_utils'); - -var _utilsExec = require('../utils/exec'); - -var _utilsExec2 = _interopRequireDefault(_utilsExec); - -var getCommand = function getCommand(config) { - var script = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - - if (script) { - return config.scripts[script]; - } - return config.run; -}; - -exports['default'] = function (environment, done) { - if (environment === undefined) environment = 'develop'; - var script = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; - - var config = (0, _utilsConfig_utils.readConfig)(); - _prompt2['default'].start(); - - if (!config.run || !config.scripts) { - throw new Error('please config `run` or `config`'); - } - - if (script && (!config.scripts || !config.scripts[script])) { - throw new Error(script + ' does not exist in config.scripts'); - } - var appDir = config.appDir; - - var _getCommand = getCommand(config, script); - - var command = _getCommand.command; - var runEnv = _getCommand.env; - var _getCommand$dir = _getCommand.dir; - var dir = _getCommand$dir === undefined ? appDir : _getCommand$dir; - - var passPathForEnvVars = (0, _configsDirectories.passEnvFile)({ config: config, environment: environment }); - var passEnv = (0, _utilsPass_utils.readPassYaml)(passPathForEnvVars); - - var _ref = config.environments[environment] || {}; - - var environmentEnv = _ref.env; - - var fullEnv = (0, _lodash.merge)({}, environmentEnv, passEnv, runEnv); - var commandArgs = ''; - // damn https://github.com/meteor/meteor/issues/9907 - var tempSettingsFile = (0, _uniqueFilename2['default'])(_os2['default'].tmpdir(), 'settings'); - - if (command === 'meteor' && fullEnv.METEOR_SETTINGS) { - _fs2['default'].writeFileSync(tempSettingsFile, JSON.stringify(fullEnv.METEOR_SETTINGS)); - delete fullEnv.METEOR_SETTINGS; - - commandArgs = ' --settings ' + tempSettingsFile; - } - var envString = (0, _utilsConfig_utils.getEnvCommandString)(fullEnv); - try { - (0, _utilsExec2['default'])('' + (dir ? 'cd ' + dir + ' && ' : '') + envString + ' ' + command + ' ' + commandArgs); - } catch (e) { - // probably canceled - } finally { - if (_fs2['default'].existsSync(tempSettingsFile)) _fs2['default'].unlinkSync(tempSettingsFile); - } - done(); -}; - -module.exports = exports['default']; -//# sourceMappingURL=run.js.map \ No newline at end of file diff --git a/dist/commands/run.js.map b/dist/commands/run.js.map deleted file mode 100644 index edd9eac..0000000 --- a/dist/commands/run.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/run.js"],"names":[],"mappings":";;;;;;;;sBAAsB,QAAQ;;sBACX,QAAQ;;;;8BACA,iBAAiB;;;;kBAC7B,IAAI;;;;kBACJ,IAAI;;;;kCAES,wBAAwB;;iCACJ,uBAAuB;;+BAC1C,qBAAqB;;yBACjC,eAAe;;;;AAEhC,IAAM,UAAU,GAAG,SAAb,UAAU,CAAI,MAAM,EAAoB;MAAlB,MAAM,yDAAG,IAAI;;AACvC,MAAI,MAAM,EAAE;AACV,WAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;GAC/B;AACD,SAAO,MAAM,CAAC,GAAG,CAAC;CACnB,CAAC;;qBACa,UAAC,WAAW,EAAc,IAAI,EAAoB;MAAjD,WAAW,gBAAX,WAAW,GAAG,SAAS;MAAQ,MAAM,yDAAG,IAAI;;AAC1D,MAAM,MAAM,GAAG,oCAAY,CAAC;AAC5B,sBAAO,KAAK,EAAE,CAAC;;AAEf,MAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;AAClC,UAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;GACpD;;AAED,MAAI,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA,AAAC,EAAE;AAC1D,UAAM,IAAI,KAAK,CAAI,MA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["import { merge } from 'lodash';\nimport prompt from 'prompt';\nimport uniqueFilename from 'unique-filename';\nimport fs from 'fs';\nimport os from 'os';\n\nimport { passEnvFile } from '../configs/directories';\nimport { readConfig, getEnvCommandString } from '../utils/config_utils';\nimport { readPassYaml } from '../utils/pass_utils';\nimport exec from '../utils/exec';\n\nconst getCommand = (config, script = null) => {\n if (script) {\n return config.scripts[script];\n }\n return config.run;\n};\nexport default (environment = 'develop', done, script = null) => {\n const config = readConfig();\n prompt.start();\n\n if (!config.run || !config.scripts) {\n throw new Error('please config `run` or `config`');\n }\n\n if (script && (!config.scripts || !config.scripts[script])) {\n throw new Error(`${script} does not exist in config.scripts`);\n }\n const { appDir } = config;\n\n const { command, env: runEnv, dir = appDir } = getCommand(config, script);\n\n const passPathForEnvVars = passEnvFile({ config, environment });\n const passEnv = readPassYaml(passPathForEnvVars);\n\n const { env: environmentEnv } = config.environments[environment] || {};\n\n const fullEnv = merge({}, environmentEnv, passEnv, runEnv);\n let commandArgs = '';\n // damn https://github.com/meteor/meteor/issues/9907\n const tempSettingsFile = uniqueFilename(os.tmpdir(), 'settings');\n\n if (command === 'meteor' && fullEnv.METEOR_SETTINGS) {\n fs.writeFileSync(tempSettingsFile, JSON.stringify(fullEnv.METEOR_SETTINGS));\n delete fullEnv.METEOR_SETTINGS;\n\n commandArgs = ` --settings ${tempSettingsFile}`;\n }\n const envString = getEnvCommandString(fullEnv);\n try {\n exec(`${dir ? `cd ${dir} && ` : ''}${envString} ${command} ${commandArgs}`);\n } catch (e) {\n // probably canceled\n } finally {\n if (fs.existsSync(tempSettingsFile)) fs.unlinkSync(tempSettingsFile);\n }\n done();\n};\n"]} \ No newline at end of file diff --git a/dist/commands/setup.js b/dist/commands/setup.js deleted file mode 100644 index 4d13ce3..0000000 --- a/dist/commands/setup.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; - -var _extends = require('babel-runtime/helpers/extends')['default']; - -var _defineProperty = require('babel-runtime/helpers/define-property')['default']; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _prompt = require('prompt'); - -var _prompt2 = _interopRequireDefault(_prompt); - -var _sshExec = require('ssh-exec'); - -var _sshExec2 = _interopRequireDefault(_sshExec); - -var _jsYaml = require('js-yaml'); - -var _jsYaml2 = _interopRequireDefault(_jsYaml); - -var _configsPrompt_schemas = require('../configs/prompt_schemas'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var _configsDirectories = require('../configs/directories'); - -var _packageJson = require('../../package.json'); - -var _utilsPass_utils = require('../utils/pass_utils'); - -var _uiAction_title = require('../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _configsDefault_env = require('../configs/default_env'); - -var _configsDefault_env2 = _interopRequireDefault(_configsDefault_env); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(); - _prompt2['default'].start(); - - (0, _uiAction_title2['default'])('setting up ' + environment); - var passPathForEnvVars = (0, _configsDirectories.passEnvFile)({ config: config, environment: environment }); - // console.log(passPathForEnvVars); - var oldEnvConfig = _lodash2['default'].get(config, ['environments', environment], {}); - _prompt2['default'].get((0, _configsPrompt_schemas.environmentSchema)(_extends({}, config, { environment: environment })), function (error, envConfig) { - // write new envConfig - config.environments = _extends({}, config.environments, _defineProperty({}, environment, _extends({}, oldEnvConfig, envConfig))); - (0, _utilsConfig_utils.writeConfig)(CONFIGFILE, config); - // update env-vars in path - // first get current vars in path - var envVars = (0, _utilsPass_utils.readPassYaml)(passPathForEnvVars); - // if envVars do not exist yet, create new one and write to pass - if (_lodash2['default'].isEmpty(envVars)) { - envVars = (0, _configsDefault_env2['default'])({ config: config, envConfig: envConfig }); - (0, _utilsPass_utils.writePass)(passPathForEnvVars, _jsYaml2['default'].safeDump(envVars)); - } - // open editor to edit the en vars - (0, _utilsPass_utils.editPass)(passPathForEnvVars); - // load changed envVars and create env.sh on server - // we create ROOT_URL always from the config - var envSh = (0, _utilsConfig_utils.createEnvSh)({ version: _packageJson.version, environment: environment }, _extends({}, (0, _utilsPass_utils.readPassYaml)(passPathForEnvVars), { - ROOT_URL: envConfig.url - })); - // create env.sh on server - (0, _sshExec2['default'])('echo "' + envSh.replace(/"/g, '\\"') + '" > ~/app/env.sh', (0, _utilsConfig_utils.getSshConfig)(CONFIGFILE, environment), function (err) { - if (err) { - throw err; - } - console.log(''); - console.log('~/app/env.sh has ben written on ', envConfig.host); - done(null, environment + ' is set up, please restart server'); - }).pipe(process.stdout); - }); -}; - -module.exports = exports['default']; -// merge with old config -//# sourceMappingURL=setup.js.map \ No newline at end of file diff --git a/dist/commands/setup.js.map b/dist/commands/setup.js.map deleted file mode 100644 index 9f8dd58..0000000 --- a/dist/commands/setup.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/setup.js"],"names":[],"mappings":";;;;;;;;;;;;sBAAc,QAAQ;;;;sBACH,QAAQ;;;;uBACJ,UAAU;;;;sBAChB,SAAS;;;;qCAEQ,2BAA2B;;iCACM,uBAAuB;;kCAC9D,wBAAwB;;2BAC5B,oBAAoB;;+BACM,qBAAqB;;8BAC/C,oBAAoB;;;;kCACrB,wBAAwB;;;;AAE/C,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAGtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,oCAAY,CAAC;AAC5B,sBAAO,KAAK,EAAE,CAAC;;AAEf,mDAA0B,WAAW,CAAG,CAAC;AACzC,MAAM,kBAAkB,GAAG,qCAAY,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;;AAEhE,MAAM,YAAY,GAAG,oBAAE,GAAG,CAAC,MAAM,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;AACtE,sBAAO,G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ml';\n\nimport { environmentSchema } from '../configs/prompt_schemas';\nimport { getSshConfig, readConfig, writeConfig, createEnvSh } from '../utils/config_utils';\nimport { passEnvFile } from '../configs/directories';\nimport { version } from '../../package.json';\nimport { writePass, editPass, readPassYaml } from '../utils/pass_utils';\nimport actionTitle from '../ui/action_title';\nimport defaultEnv from '../configs/default_env';\n\nconst CONFIGFILE = '.catladder.yaml';\n\n\nexport default (environment, done) => {\n const config = readConfig();\n prompt.start();\n\n actionTitle(`setting up ${environment}`);\n const passPathForEnvVars = passEnvFile({ config, environment });\n // console.log(passPathForEnvVars);\n const oldEnvConfig = _.get(config, ['environments', environment], {});\n prompt.get(environmentSchema({ ...config, environment }), (error, envConfig) => {\n // write new envConfig\n config.environments = {\n ...config.environments,\n [environment]: {\n ...oldEnvConfig, // merge with old config\n ...envConfig,\n },\n };\n writeConfig(CONFIGFILE, config);\n // update env-vars in path\n // first get current vars in path\n let envVars = readPassYaml(passPathForEnvVars);\n // if envVars do not exist yet, create new one and write to pass\n if (_.isEmpty(envVars)) {\n envVars = defaultEnv({ config, envConfig });\n writePass(passPathForEnvVars, yaml.safeDump(envVars));\n }\n // open editor to edit the en vars\n editPass(passPathForEnvVars);\n // load changed envVars and create env.sh on server\n // we create ROOT_URL always from the config\n const envSh = createEnvSh(\n { version, environment },\n {\n ...readPassYaml(passPathForEnvVars),\n ROOT_URL: envConfig.url,\n },\n );\n // create env.sh on server\n remoteExec(`echo \"${envSh.replace(/\"/g, '\\\\\"')}\" > ~/app/env.sh`, getSshConfig(CONFIGFILE, environment), (err) => {\n if (err) {\n throw err;\n }\n console.log('');\n console.log('~/app/env.sh has ben written on ', envConfig.host);\n done(null, `${environment} is set up, please restart server`);\n }).pipe(process.stdout);\n });\n};\n"]} \ No newline at end of file diff --git a/dist/commands/upload_server.js b/dist/commands/upload_server.js deleted file mode 100644 index 269abe3..0000000 --- a/dist/commands/upload_server.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _deploymentsGet_deployment_command = require('../deployments/get_deployment_command'); - -var _deploymentsGet_deployment_command2 = _interopRequireDefault(_deploymentsGet_deployment_command); - -var _restart = require('./restart'); - -var _restart2 = _interopRequireDefault(_restart); - -exports['default'] = function (environment, done) { - var deployCommand = (0, _deploymentsGet_deployment_command2['default'])(environment, 'deploy'); - var next = function next() { - return (0, _restart2['default'])(environment, done); - }; - deployCommand(environment, next); -}; - -module.exports = exports['default']; -//# sourceMappingURL=upload_server.js.map \ No newline at end of file diff --git a/dist/commands/upload_server.js.map b/dist/commands/upload_server.js.map deleted file mode 100644 index b75c2f2..0000000 --- a/dist/commands/upload_server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/upload_server.js"],"names":[],"mappings":";;;;;;;;iDAAiC,uCAAuC;;;;uBACpD,WAAW;;;;qBAEhB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,aAAa,GAAG,oDAAqB,WAAW,EAAE,QAAQ,CAAC,CAAC;AAClE,MAAM,IAAI,GAAG,SAAP,IAAI;WAAS,0BAAQ,WAAW,EAAE,IAAI,CAAC;GAAA,CAAC;AAC9C,eAAa,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;CAClC","file":"upload_server.js","sourcesContent":["import getDeploymentCommand from '../deployments/get_deployment_command';\nimport restart from './restart';\n\nexport default (environment, done) => {\n const deployCommand = getDeploymentCommand(environment, 'deploy');\n const next = () => restart(environment, done);\n deployCommand(environment, next);\n};\n"]} \ No newline at end of file diff --git a/dist/commands/version.js b/dist/commands/version.js deleted file mode 100644 index b49baa2..0000000 --- a/dist/commands/version.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _packageJson = require('../../package.json'); - -var _utilsGit_utils = require('../utils/git_utils'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -exports['default'] = function (__, done) { - var projectConfig = 'no catladder project'; - try { - var config = (0, _utilsConfig_utils.readConfig)(); - projectConfig = JSON.stringify(config, null, 2); - } catch (e) { - // empty - } - - console.log('\n catladder version: ' + _packageJson.version + '\n\n project version: ' + (0, _utilsGit_utils.getFullGitVersion)() + '\n\n project config:\n\n ' + projectConfig + '\n '); - done(null); -}; - -module.exports = exports['default']; -//# sourceMappingURL=version.js.map \ No newline at end of file diff --git a/dist/commands/version.js.map b/dist/commands/version.js.map deleted file mode 100644 index 0f52208..0000000 --- a/dist/commands/version.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/commands/version.js"],"names":[],"mappings":";;;;;;2BAAwB,oBAAoB;;8BAEV,oBAAoB;;iCAC3B,uBAAuB;;qBAKnC,UAAC,EAAE,EAAE,IAAI,EAAK;AAC3B,MAAI,aAAa,GAAG,sBAAsB,CAAC;AAC3C,MAAI;AACF,QAAM,MAAM,GAAG,oCAAY,CAAC;AAC5B,iBAAa,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;GACjD,CAAC,OAAO,CAAC,EAAE;;GAEX;;AAED,SAAO,CAAC,GAAG,gFAGQ,wCAAmB,mCAIpC,aAAa,UACb,CAAC;AACH,MAAI,CAAC,IAAI,CAAC,CAAC;CACZ","file":"version.js","sourcesContent":["import { version } from '../../package.json';\n\nimport { getFullGitVersion } from '../utils/git_utils';\nimport { readConfig } from '../utils/config_utils';\n\n\n\n\nexport default (__, done) => {\n let projectConfig = 'no catladder project';\n try {\n const config = readConfig();\n projectConfig = JSON.stringify(config, null, 2);\n } catch (e) {\n // empty\n }\n\n console.log(`\n catladder version: ${version}\n\n project version: ${getFullGitVersion()}\n\n project config:\n\n ${projectConfig}\n `);\n done(null);\n};\n"]} \ No newline at end of file diff --git a/dist/config_utils.js b/dist/config_utils.js deleted file mode 100644 index abece62..0000000 --- a/dist/config_utils.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _jsYaml = require('js-yaml'); - -var _jsYaml2 = _interopRequireDefault(_jsYaml); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var writeConfig = function writeConfig(configFile, config) { - var theyaml = _jsYaml2['default'].safeDump(config); - _fs2['default'].writeFileSync(configFile, theyaml); -}; -exports.writeConfig = writeConfig; -var readConfig = function readConfig(configFile) { - return _jsYaml2['default'].safeLoad(_fs2['default'].readFileSync(configFile)); -}; - -exports.readConfig = readConfig; -var getSshConfig = function getSshConfig(configFile, environment) { - var config = readConfig(configFile); - return _lodash2['default'].pick(config.environments[environment], ['host', 'user', 'password', 'key']); -}; - -exports.getSshConfig = getSshConfig; -var createEnvSh = function createEnvSh(_ref, envVars) { - var environment = _ref.environment; - var version = _ref.version; - - var getSanitziedValue = function getSanitziedValue(value) { - if (_lodash2['default'].isObject(value)) { - return JSON.stringify(value); - } - return value; - }; - // build is excluded, that is only used while building - var body = _lodash2['default'].keys(_lodash2['default'].omit(envVars, ['build'])).map(function (key) { - var value = getSanitziedValue(envVars[key]); - - return 'export ' + key + '=\'' + value + '\''; - }).join('\n'); - var envHeader = '\n# autocreated with PANTER CATLADDER 🐱 πŸ”§ v' + version + '\n# environment: ' + environment + '\n#\n# DO NOT EDIT, use\n# $ catladder setup ' + environment + '\n# to edit\n#\n '; - return envHeader + '\n' + body; -}; -exports.createEnvSh = createEnvSh; -//# sourceMappingURL=config_utils.js.map \ No newline at end of file diff --git a/dist/config_utils.js.map b/dist/config_utils.js.map deleted file mode 100644 index e740b8f..0000000 --- a/dist/config_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/config_utils.js"],"names":[],"mappings":";;;;;;;;kBAAe,IAAI;;;;sBACF,SAAS;;;;sBAEZ,QAAQ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,CAAC,IAAI,CAAC,CAAC;AACd,MAAM,SAAS,qDAC4B,OAAO,yBACnC,WAAW,qDAGN,WAAW,uBAG9B,CAAC;AACF,SAAU,SAAS,UAAK,IAAI,CAAG;CAChC,CAAC","file":"config_utils.js","sourcesContent":["import fs from 'fs';\nimport yaml from 'js-yaml';\n\nimport _ from 'lodash';\n\nexport const writeConfig = (configFile, config) => {\n const theyaml = yaml.safeDump(config);\n fs.writeFileSync(configFile, theyaml);\n};\nexport const readConfig = configFile => yaml.safeLoad(fs.readFileSync(configFile));\n\nexport const getSshConfig = (configFile, environment) => {\n const config = readConfig(configFile);\n return _.pick(\n config.environments[environment],\n ['host', 'user', 'password', 'key'],\n );\n};\n\nexport const createEnvSh = ({ environment, version }, envVars) => {\n const getSanitziedValue = (value) => {\n if (_.isObject(value)) {\n return JSON.stringify(value);\n }\n return value;\n };\n // build is excluded, that is only used while building\n const body = _.keys(_.omit(envVars, ['build'])).map((key) => {\n const value = getSanitziedValue(envVars[key]);\n\n return `export ${key}='${value}'`;\n }).join('\\n');\n const envHeader = `\n# autocreated with PANTER CATLADDER 🐱 πŸ”§ v${version}\n# environment: ${environment}\n#\n# DO NOT EDIT, use\n# $ catladder setup ${environment}\n# to edit\n#\n `;\n return `${envHeader}\\n${body}`;\n};\n"]} \ No newline at end of file diff --git a/dist/configs/default_env.js b/dist/configs/default_env.js deleted file mode 100644 index 596cecf..0000000 --- a/dist/configs/default_env.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -exports['default'] = function (_ref) { - var config = _ref.config; - return { - PORT: 8080, - MONGO_URL: 'mongodb://localhost/' + config.appname, - MONGO_OPLOG_URL: 'mongodb://localhost/local', - MAIL_URL: 'smtp://localhost:25', - METEOR_SETTINGS: {} - }; -}; - -module.exports = exports['default']; -//# sourceMappingURL=default_env.js.map \ No newline at end of file diff --git a/dist/configs/default_env.js.map b/dist/configs/default_env.js.map deleted file mode 100644 index 435b982..0000000 --- a/dist/configs/default_env.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/configs/default_env.js"],"names":[],"mappings":";;;;;;qBACe,UAAC,IAAU;MAAR,MAAM,GAAR,IAAU,CAAR,MAAM;SAAQ;AAC9B,QAAI,EAAE,IAAI;AACV,aAAS,2BAAyB,MAAM,CAAC,OAAO,AAAE;AAClD,mBAAe,EAAE,2BAA2B;AAC5C,YAAQ,EAAE,qBAAqB;AAC/B,mBAAe,EAAE,EAChB;GACF;CAAC","file":"default_env.js","sourcesContent":["\nexport default ({ config }) => ({\n PORT: 8080,\n MONGO_URL: `mongodb://localhost/${config.appname}`,\n MONGO_OPLOG_URL: 'mongodb://localhost/local',\n MAIL_URL: 'smtp://localhost:25',\n METEOR_SETTINGS: {\n },\n});\n"]} \ No newline at end of file diff --git a/dist/configs/directories.js b/dist/configs/directories.js deleted file mode 100644 index 948bea7..0000000 --- a/dist/configs/directories.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _path = require('path'); - -var _path2 = _interopRequireDefault(_path); - -var getBuildDir = function getBuildDir(_ref) { - var config = _ref.config; - var environment = _ref.environment; - return _path2['default'].resolve(config.buildDir + '/' + environment); -}; - -exports.getBuildDir = getBuildDir; -var getBuildDirDockerFile = function getBuildDirDockerFile(_ref2) { - var config = _ref2.config; - var environment = _ref2.environment; - return getBuildDir({ config: config, environment: environment }) + '/Dockerfile'; -}; - -exports.getBuildDirDockerFile = getBuildDirDockerFile; -var getIosBuildDir = function getIosBuildDir(_ref3) { - var config = _ref3.config; - var environment = _ref3.environment; - return getBuildDir({ config: config, environment: environment }) + '/ios'; -}; -exports.getIosBuildDir = getIosBuildDir; -var getIosBuildProjectFolder = function getIosBuildProjectFolder(_ref4) { - var config = _ref4.config; - var environment = _ref4.environment; - return getIosBuildDir({ config: config, environment: environment }) + '/project'; -}; - -exports.getIosBuildProjectFolder = getIosBuildProjectFolder; -var passEnvFile = function passEnvFile(_ref5) { - var config = _ref5.config; - var environment = _ref5.environment; - return config.passPath + '/' + environment + '/env.yaml'; -}; -exports.passEnvFile = passEnvFile; -//# sourceMappingURL=directories.js.map \ No newline at end of file diff --git a/dist/configs/directories.js.map b/dist/configs/directories.js.map deleted file mode 100644 index 0c99ce1..0000000 --- a/dist/configs/directories.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/configs/directories.js"],"names":[],"mappings":";;;;;;;;oBAAiB,MAAM;;;;AAEhB,IAAM,WAAW,GAAG,SAAd,WAAW,CAAI,IAAuB;MAArB,MAAM,GAAR,IAAuB,CAArB,MAAM;MAAE,WAAW,GAArB,IAAuB,CAAb,WAAW;SAC/C,kBAAK,OAAO,CAAI,MAAM,CAAC,QAAQ,SAAI,WAAW,CAAG;CAAA,CAAC;;;AAE7C,IAAM,qBAAqB,GAAG,SAAxB,qBAAqB,CAAI,KAAuB;MAArB,MAAM,GAAR,KAAuB,CAArB,MAAM;MAAE,WAAW,GAArB,KAAuB,CAAb,WAAW;SACtD,WAAW,CAAC,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC;CAAa,CAAC;;;AAEhD,IAAM,cAAc,GAAG,SAAjB,cAAc,CAAI,KAAuB;MAArB,MAAM,GAAR,KAAuB,CAArB,MAAM;MAAE,WAAW,GAArB,KAAuB,CAAb,WAAW;SAC/C,WAAW,CAAC,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC;CAAM,CAAC;;AACzC,IAAM,wBAAwB,GAAG,SAA3B,wBAAwB,CAAI,KAAuB;MAArB,MAAM,GAAR,KAAuB,CAArB,MAAM;MAAE,WAAW,GAArB,KAAuB,CAAb,WAAW;SACzD,cAAc,CAAC,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC;CAAU,CAAC;;;AAEhD,IAAM,WAAW,GAAG,SAAd,WAAW,CAAI,KAAuB;MAArB,MAAM,GAAR,KAAuB,CAArB,MAAM;MAAE,WAAW,GAArB,KAAuB,CAAb,WAAW;SAC5C,MAAM,CAAC,QAAQ,SAAI,WAAW;CAAW,CAAC","file":"directories.js","sourcesContent":["import path from 'path';\n\nexport const getBuildDir = ({ config, environment }) =>\n path.resolve(`${config.buildDir}/${environment}`);\n\nexport const getBuildDirDockerFile = ({ config, environment }) =>\n `${getBuildDir({ config, environment })}/Dockerfile`;\n\nexport const getIosBuildDir = ({ config, environment }) =>\n `${getBuildDir({ config, environment })}/ios`;\nexport const getIosBuildProjectFolder = ({ config, environment }) =>\n `${getIosBuildDir({ config, environment })}/project`;\n\nexport const passEnvFile = ({ config, environment }) =>\n `${config.passPath}/${environment}/env.yaml`;\n"]} \ No newline at end of file diff --git a/dist/configs/prompt_schemas.js b/dist/configs/prompt_schemas.js deleted file mode 100644 index b25d618..0000000 --- a/dist/configs/prompt_schemas.js +++ /dev/null @@ -1,124 +0,0 @@ -'use strict'; - -var _extends = require('babel-runtime/helpers/extends')['default']; - -var _objectWithoutProperties = require('babel-runtime/helpers/object-without-properties')['default']; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _prompt = require('prompt'); - -var _prompt2 = _interopRequireDefault(_prompt); - -var withDefaults = function withDefaults(schema) { - var defaults = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - return _extends({}, schema, { - properties: _lodash2['default'].mapValues(schema.properties, function (value, key) { - return _extends({}, value, { - 'default': function _default() { - return defaults[key] || _lodash2['default'].result(value, 'default'); - } - }); - }) - }); -}; - -var initSchema = function initSchema(config) { - return withDefaults({ - properties: { - customer: { - description: 'Customer kΓΌrzel', - required: true, - 'default': 'pan' - }, - appname: { - description: 'App name (for dbs, filenames, etc.)', - type: 'string', - required: true, - pattern: /^[a-zA-Z]+$/ - }, - passPath: { - description: 'Path in pass', - required: true, - 'default': function _default() { - return _prompt2['default'].history('customer').value + '/' + _prompt2['default'].history('appname').value; - } - }, - appDir: { - description: 'app directory', - type: 'string', - 'default': './app' - }, - buildDir: { - description: 'build directory', - type: 'string', - 'default': './build' - }, - androidBuildToolVersion: { - description: 'android build tool version', - type: 'string', - 'default': '25.0.2' - }, - useYarn: { - description: 'use yarn to build (false: use npm)', - type: 'boolean', - 'default': true - } - } - }, config); -}; - -exports.initSchema = initSchema; -var environmentSchema = function environmentSchema(_ref) { - var environment = _ref.environment; - var appname = _ref.appname; - - var config = _objectWithoutProperties(_ref, ['environment', 'appname']); - - return withDefaults({ - properties: { - host: { - description: 'ssh host (deprecated, only for classic hosting)', - type: 'string', - required: true, - 'default': appname + '-' + environment + '.panter.biz' - }, - user: { - description: 'ssh user (deprecated, only for classic hosting)', - 'default': 'app' - }, - url: { - description: 'full url', - 'default': function _default() { - return 'https://' + _prompt2['default'].history('host').value; - } - }, - androidKeystore: { - description: 'android keystore file', - type: 'string', - 'default': './android.keystore' - }, - androidKeyname: { - description: 'Android keystore name / alias', - 'default': appname + '-' + environment - }, - androidDName: { - description: 'android dname for key', - type: 'string', - 'default': function _default() { - return 'cn=Panter, ou=Panter, o=Panter, c=CH'; - } - } - } - }, _lodash2['default'].get(config, ['environments', environment])); -}; -exports.environmentSchema = environmentSchema; -//# sourceMappingURL=prompt_schemas.js.map \ No newline at end of file diff --git a/dist/configs/prompt_schemas.js.map b/dist/configs/prompt_schemas.js.map deleted file mode 100644 index 32246f7..0000000 --- a/dist/configs/prompt_schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/configs/prompt_schemas.js"],"names":[],"mappings":";;;;;;;;;;;;sBAAc,QAAQ;;;;sBACH,QAAQ;;;;AAE3B,IAAM,YAAY,GAAG,SAAf,YAAY,CAAI,MAAM;MAAE,QAAQ,yDAAG,EAAE;sBACt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AW;MAAE,OAAO,GAAtB,IAAmC,CAApB,OAAO;;MAAK,MAAM,4BAAjC,IAAmC;;SACnE,YAAY,CACV;AACE,cAAU,EAAE;AACV,UAAI,EAAE;AACJ,mBAAW,EAAE,iDAAiD;AAC9D,YAAI,EAAE,QAAQ;AACd,gBAAQ,EAAE,IAAI;AACd,mBAAY,OAAO,SAAI,WAAW,gBAAa;OAChD;AACD,UAAI,EAAE;AACJ,mBAAW,EAAE,iDAAiD;AAC9D,mBAAS,KAAK;OACf;AACD,SAAG,EAAE;AACH,mBAAW,EAAE,UAAU;AACvB,mBAAS;8BAAiB,oBAAO,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK;SAAE;OACzD;AACD,qBAAe,EAAE;AACf,mBAAW,EAAE,uBAAuB;AACpC,YAAI,EAAE,QAAQ;AACd,mBAAS,oBAAoB;OAC9B;AACD,oBAAc,EAAE;AACd,mBAAW,EAAE,+BAA+B;AAC5C,mBAAY,OAAO,SAAI,WAAW,AAAE;OACrC;AACD,kBAAY,EAAE;AACZ,mBAAW,EAAE,uBAAuB;AACpC,YAAI,EAAE,QAAQ;AACd,mBAAS;iBAAM,sCAAsC;SAAA;OACtD;KACF;GACF,EACD,oBAAE,GAAG,CAAC,MAAM,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAC7C;CAAA,CAAC","file":"prompt_schemas.js","sourcesContent":["import _ from 'lodash';\nimport prompt from 'prompt';\n\nconst withDefaults = (schema, defaults = {}) => ({\n ...schema,\n properties: _.mapValues(schema.properties, (value, key) => ({\n ...value,\n default: () => defaults[key] || _.result(value, 'default'),\n })),\n});\n\nexport const initSchema = config =>\n withDefaults(\n {\n properties: {\n customer: {\n description: 'Customer kΓΌrzel',\n required: true,\n default: 'pan',\n },\n appname: {\n description: 'App name (for dbs, filenames, etc.)',\n type: 'string',\n required: true,\n pattern: /^[a-zA-Z]+$/,\n },\n passPath: {\n description: 'Path in pass',\n required: true,\n default: () => `${prompt.history('customer').value}/${prompt.history('appname').value}`,\n },\n appDir: {\n description: 'app directory',\n type: 'string',\n default: './app',\n },\n buildDir: {\n description: 'build directory',\n type: 'string',\n default: './build',\n },\n androidBuildToolVersion: {\n description: 'android build tool version',\n type: 'string',\n default: '25.0.2',\n },\n useYarn: {\n description: 'use yarn to build (false: use npm)',\n type: 'boolean',\n default: true,\n },\n },\n },\n config,\n );\n\nexport const environmentSchema = ({ environment, appname, ...config }) =>\n withDefaults(\n {\n properties: {\n host: {\n description: 'ssh host (deprecated, only for classic hosting)',\n type: 'string',\n required: true,\n default: `${appname}-${environment}.panter.biz`,\n },\n user: {\n description: 'ssh user (deprecated, only for classic hosting)',\n default: 'app',\n },\n url: {\n description: 'full url',\n default: () => `https://${prompt.history('host').value}`,\n },\n androidKeystore: {\n description: 'android keystore file',\n type: 'string',\n default: './android.keystore',\n },\n androidKeyname: {\n description: 'Android keystore name / alias',\n default: `${appname}-${environment}`,\n },\n androidDName: {\n description: 'android dname for key',\n type: 'string',\n default: () => 'cn=Panter, ou=Panter, o=Panter, c=CH',\n },\n },\n },\n _.get(config, ['environments', environment]),\n );\n"]} \ No newline at end of file diff --git a/dist/deploy/index.js b/dist/deploy/index.js deleted file mode 100644 index ae9e59e..0000000 --- a/dist/deploy/index.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _panterMeteroClassic = require('./panter-metero-classic'); - -var _panterMeteroClassic2 = _interopRequireDefault(_panterMeteroClassic); - -exports['default'] = { - 'panter-meteor-classic': _panterMeteroClassic2['default'] - -}; -module.exports = exports['default']; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/deploy/index.js.map b/dist/deploy/index.js.map deleted file mode 100644 index ae9108e..0000000 --- a/dist/deploy/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/deploy/index.js"],"names":[],"mappings":";;;;;;;;mCACgC,yBAAyB;;;;qBAG1C;AACb,yBAAuB,kCAAqB;;CAE7C","file":"index.js","sourcesContent":["\nimport panterMeteorClassic from './panter-metero-classic';\n\n\nexport default {\n 'panter-meteor-classic': panterMeteorClassic,\n\n};\n"]} \ No newline at end of file diff --git a/dist/deploy/panter-meteor-classic/deploy.js b/dist/deploy/panter-meteor-classic/deploy.js deleted file mode 100644 index 9fd148e..0000000 --- a/dist/deploy/panter-meteor-classic/deploy.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -//# sourceMappingURL=deploy.js.map \ No newline at end of file diff --git a/dist/deploy/panter-meteor-classic/deploy.js.map b/dist/deploy/panter-meteor-classic/deploy.js.map deleted file mode 100644 index 68719ae..0000000 --- a/dist/deploy/panter-meteor-classic/deploy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","file":"deploy.js","sourcesContent":[]} \ No newline at end of file diff --git a/dist/deploy/panter-meteor-classic/index.js b/dist/deploy/panter-meteor-classic/index.js deleted file mode 100644 index fa69a5a..0000000 --- a/dist/deploy/panter-meteor-classic/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/deploy/panter-meteor-classic/index.js.map b/dist/deploy/panter-meteor-classic/index.js.map deleted file mode 100644 index 43fe8b2..0000000 --- a/dist/deploy/panter-meteor-classic/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]} \ No newline at end of file diff --git a/dist/deployments/get_deployment_command.js b/dist/deployments/get_deployment_command.js deleted file mode 100644 index 1766700..0000000 --- a/dist/deployments/get_deployment_command.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _lodash = require('lodash'); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var _ = require('./'); - -var _2 = _interopRequireDefault(_); - -exports['default'] = function (environment, command) { - var config = (0, _utilsConfig_utils.readConfig)(); - var deployment = config.environments[environment].deployment; - - if (!deployment) { - console.log('no deployment configured'); - return; - } - - var _ref = deployment || {}; - - var type = _ref.type; - - var availableCommands = (0, _lodash.keys)(_2['default'][type]).join(', '); - if (_2['default'][type]) { - if (_2['default'][type][command]) { - return _2['default'][type][command]; - } - throw new Error('Unkown deployment-command: ' + command + ' in type ' + type + '. Available commands: ' + availableCommands); - } else { - throw new Error('Unkown deployment-type: ' + type + '. Available commands: ' + availableCommands); - } -}; - -module.exports = exports['default']; -//# sourceMappingURL=get_deployment_command.js.map \ No newline at end of file diff --git a/dist/deployments/get_deployment_command.js.map b/dist/deployments/get_deployment_command.js.map deleted file mode 100644 index d3a5632..0000000 --- a/dist/deployments/get_deployment_command.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/deployments/get_deployment_command.js"],"names":[],"mappings":";;;;;;;;sBAAqB,QAAQ;;iCAEF,uBAAuB;;gBAC1B,IAAI;;;;qBAEb,UAAC,WAAW,EAAE,OAAO,EAAK;AACvC,MAAM,MAAM,GAAG,oCAAY,CAAC;MACpB,UAAU,GAAK,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC,CAA/C,UAAU;;AAClB,MAAI,CAAC,UAAU,EAAE;AACf,WAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AACxC,WAAO;GACR;;aACgB,UAAU,IAAI,EAAE;;MAAzB,IAAI,QAAJ,IAAI;;AACZ,MAAM,iBAAiB,GAAG,kBAAK,cAAY,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7D,MAAI,cAAY,IAAI,CAAC,EAAE;AACrB,QAAI,cAAY,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE;AAC9B,aAAO,cAAY,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;KACnC;AACD,UAAM,IAAI,KAAK,iCACiB,OAAO,iBAAY,IAAI,8BAAyB,iBAAiB,CAChG,CAAC;GACH,MAAM;AACL,UAAM,IAAI,KAAK,8BAA4B,IAAI,8BAAyB,iBAAiB,CAAG,CAAC;GAC9F;CACF","file":"get_deployment_command.js","sourcesContent":["import { keys } from 'lodash';\n\nimport { readConfig } from '../utils/config_utils';\nimport deployments from './';\n\nexport default (environment, command) => {\n const config = readConfig();\n const { deployment } = config.environments[environment];\n if (!deployment) {\n console.log('no deployment configured');\n return;\n }\n const { type } = deployment || {};\n const availableCommands = keys(deployments[type]).join(', ');\n if (deployments[type]) {\n if (deployments[type][command]) {\n return deployments[type][command];\n }\n throw new Error(\n `Unkown deployment-command: ${command} in type ${type}. Available commands: ${availableCommands}`,\n );\n } else {\n throw new Error(`Unkown deployment-type: ${type}. Available commands: ${availableCommands}`);\n }\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/index.js b/dist/deployments/index.js deleted file mode 100644 index d36816f..0000000 --- a/dist/deployments/index.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _panterMeteorClassic = require('./panter-meteor-classic'); - -var _panterMeteorClassic2 = _interopRequireDefault(_panterMeteorClassic); - -var _panterMeteorKubernetes = require('./panter-meteor-kubernetes'); - -var _panterMeteorKubernetes2 = _interopRequireDefault(_panterMeteorKubernetes); - -exports['default'] = { - 'panter-meteor-classic': _panterMeteorClassic2['default'], - 'panter-meteor-kubernetes': _panterMeteorKubernetes2['default'] -}; -module.exports = exports['default']; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/deployments/index.js.map b/dist/deployments/index.js.map deleted file mode 100644 index 1ff6756..0000000 --- a/dist/deployments/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/deployments/index.js"],"names":[],"mappings":";;;;;;;;mCAAgC,yBAAyB;;;;sCACtB,4BAA4B;;;;qBAEhD;AACb,yBAAuB,kCAAqB;AAC5C,4BAA0B,qCAAwB;CACnD","file":"index.js","sourcesContent":["import panterMeteorClassic from './panter-meteor-classic';\nimport panterMeteorKubernetes from './panter-meteor-kubernetes';\n\nexport default {\n 'panter-meteor-classic': panterMeteorClassic,\n 'panter-meteor-kubernetes': panterMeteorKubernetes,\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/panter-meteor-classic/applyConfig.js b/dist/deployments/panter-meteor-classic/applyConfig.js deleted file mode 100644 index a60d592..0000000 --- a/dist/deployments/panter-meteor-classic/applyConfig.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -var _extends = require('babel-runtime/helpers/extends')['default']; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _sshExec = require('ssh-exec'); - -var _sshExec2 = _interopRequireDefault(_sshExec); - -var _utilsConfig_utils = require('../../utils/config_utils'); - -var _configsDirectories = require('../../configs/directories'); - -var _utilsPass_utils = require('../../utils/pass_utils'); - -var _packageJson = require('../../../package.json'); - -var _uiAction_title = require('../../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - (0, _uiAction_title2['default'])('apply config ' + environment); - var config = (0, _utilsConfig_utils.readConfig)(); - var passPathForEnvVars = (0, _configsDirectories.passEnvFile)({ config: config, environment: environment }); - // load changed envVars and create env.sh on server - // we create ROOT_URL always from the config - var envConfig = config[environment]; - var envSh = (0, _utilsConfig_utils.createEnvSh)({ version: _packageJson.version, environment: environment }, _extends({}, (0, _utilsPass_utils.readPassYaml)(passPathForEnvVars), { - ROOT_URL: envConfig.url - })); - // create env.sh on server - (0, _sshExec2['default'])('echo "' + envSh.replace(/"/g, '\\"') + '" > ~/app/env.sh', (0, _utilsConfig_utils.getSshConfig)(CONFIGFILE, environment), function (err) { - if (err) { - throw err; - } - console.log(''); - console.log('~/app/env.sh has ben written on ', envConfig.host); - done(null, environment + ' is set up, please restart server'); - }).pipe(process.stdout); -}; - -module.exports = exports['default']; -//# sourceMappingURL=applyConfig.js.map \ No newline at end of file diff --git a/dist/deployments/panter-meteor-classic/applyConfig.js.map b/dist/deployments/panter-meteor-classic/applyConfig.js.map deleted file mode 100644 index 84ceb3f..0000000 --- a/dist/deployments/panter-meteor-classic/applyConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/deployments/panter-meteor-classic/applyConfig.js"],"names":[],"mappings":";;;;;;;;;;uBAAuB,UAAU;;;;iCAEqB,0BAA0B;;kCACpD,2BAA2B;;+BAC1B,wBAAwB;;2BAC7B,uBAAuB;;8BACvB,uBAAuB;;;;AAE/C,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBACtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,qDAA4B,WAAW,CAAG,CAAC;AAC3C,MAAM,MAAM,GAAG,oCAAY,CAAC;AAC5B,MAAM,kBAAkB,GAAG,qCAAY,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;;;AAGhE,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AACtC,MAAM,KAAK,GAAG,oCACZ,EAAE,OAAO,sBAAA,EAAE,WAAW,EAAX,WAAW,EAAE,eAEnB,mCAAa,kBAAkB,CAAC;AACnC,YAAQ,EAAE,SAAS,CAAC,GAAG;KAE1B,CAAC;;AAEF,uCACW,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,uBACnC,qCAAa,UAAU,EAAE,WAAW,CAAC,EACrC,UAAC,GAAG,EAAK;AACP,QAAI,GAAG,EAAE;AACP,YAAM,GAAG,CAAC;KACX;AACD,WAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAChB,WAAO,CAAC,GAAG,CAAC,kCAAkC,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;AAChE,QAAI,CAAC,IAAI,EAAK,WAAW,uCAAoC,CAAC;GAC/D,CACF,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;CACxB","file":"applyConfig.js","sourcesContent":["import remoteExec from 'ssh-exec';\n\nimport { createEnvSh, getSshConfig, readConfig } from '../../utils/config_utils';\nimport { passEnvFile } from '../../configs/directories';\nimport { readPassYaml } from '../../utils/pass_utils';\nimport { version } from '../../../package.json';\nimport actionTitle from '../../ui/action_title';\n\nconst CONFIGFILE = '.catladder.yaml';\nexport default (environment, done) => {\n actionTitle(`apply config ${environment}`);\n const config = readConfig();\n const passPathForEnvVars = passEnvFile({ config, environment });\n // load changed envVars and create env.sh on server\n // we create ROOT_URL always from the config\n const envConfig = config[environment];\n const envSh = createEnvSh(\n { version, environment },\n {\n ...readPassYaml(passPathForEnvVars),\n ROOT_URL: envConfig.url,\n },\n );\n // create env.sh on server\n remoteExec(\n `echo \"${envSh.replace(/\"/g, '\\\\\"')}\" > ~/app/env.sh`,\n getSshConfig(CONFIGFILE, environment),\n (err) => {\n if (err) {\n throw err;\n }\n console.log('');\n console.log('~/app/env.sh has ben written on ', envConfig.host);\n done(null, `${environment} is set up, please restart server`);\n },\n ).pipe(process.stdout);\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/panter-meteor-classic/deploy.js b/dist/deployments/panter-meteor-classic/deploy.js deleted file mode 100644 index 8072773..0000000 --- a/dist/deployments/panter-meteor-classic/deploy.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _commands = require('../../commands'); - -var _uiAction_title = require('../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _push = require('./push'); - -var _push2 = _interopRequireDefault(_push); - -var _restart = require('./restart'); - -var _restart2 = _interopRequireDefault(_restart); - -exports['default'] = function (environment, done) { - (0, _uiAction_title2['default'])('deploying ' + environment); - (0, _commands.buildServer)(environment, function () { - (0, _push2['default'])(environment, function () { - return (0, _restart2['default'])(environment, done); - }); - }); -}; - -module.exports = exports['default']; -//# sourceMappingURL=deploy.js.map \ No newline at end of file diff --git a/dist/deployments/panter-meteor-classic/deploy.js.map b/dist/deployments/panter-meteor-classic/deploy.js.map deleted file mode 100644 index 60ff8ac..0000000 --- a/dist/deployments/panter-meteor-classic/deploy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/deployments/panter-meteor-classic/deploy.js"],"names":[],"mappings":";;;;;;;;wBAA4B,gBAAgB;;8BACpB,oBAAoB;;;;oBAC3B,QAAQ;;;;uBACL,WAAW;;;;qBAEhB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,kDAAyB,WAAW,CAAG,CAAC;AACxC,6BAAY,WAAW,EAAE,YAAM;AAC7B,2BAAK,WAAW,EAAE;aAAM,0BAAQ,WAAW,EAAE,IAAI,CAAC;KAAA,CAAC,CAAC;GACrD,CAAC,CAAC;CACJ","file":"deploy.js","sourcesContent":["import { buildServer } from '../../commands';\nimport actionTitle from '../ui/action_title';\nimport push from './push';\nimport restart from './restart';\n\nexport default (environment, done) => {\n actionTitle(`deploying ${environment}`);\n buildServer(environment, () => {\n push(environment, () => restart(environment, done));\n });\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/panter-meteor-classic/deploy_push.js b/dist/deployments/panter-meteor-classic/deploy_push.js deleted file mode 100644 index 26d42df..0000000 --- a/dist/deployments/panter-meteor-classic/deploy_push.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _child_process = require('child_process'); - -var _sshExec = require('ssh-exec'); - -var _sshExec2 = _interopRequireDefault(_sshExec); - -var _configsDirectories = require('../../configs/directories'); - -var _utilsConfig_utils = require('../../utils/config_utils'); - -var _uiAction_title = require('../../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(); - - // const envConf = config.environments[environment]; - var sshConfig = (0, _utilsConfig_utils.getSshConfig)(CONFIGFILE, environment); - (0, _uiAction_title2['default'])('uploading server bundle to ' + environment); - var buildDir = (0, _configsDirectories.getBuildDir)({ config: config, environment: environment }); - (0, _child_process.execSync)('scp ' + buildDir + '/app.tar.gz ' + sshConfig.user + '@' + sshConfig.host + ':', { stdio: 'inherit' }); - (0, _sshExec2['default'])('\n rm -rf ~/app/last\n mv ~/app/bundle ~/app/last\n rm ~/app/current\n ln -s ~/app/bundle ~/app/current\n tar xfz app.tar.gz -C app\n pushd ~/app/bundle/programs/server\n npm install\n popd\n ', sshConfig, done).pipe(process.stdout); -}; - -module.exports = exports['default']; -//# sourceMappingURL=deploy_push.js.map \ No newline at end of file diff --git a/dist/deployments/panter-meteor-classic/deploy_push.js.map b/dist/deployments/panter-meteor-classic/deploy_push.js.map deleted file mode 100644 index 86bfc17..0000000 --- a/dist/deployments/panter-meteor-classic/deploy_push.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/deployments/panter-meteor-classic/deploy_push.js"],"names":[],"mappings":";;;;;;;;6BAAyB,eAAe;;uBAEjB,UAAU;;;;kCAEL,2BAA2B;;iCACd,0BAA0B;;8BAC3C,uBAAuB;;;;AAE/C,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAEtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,QAAM,MAAM,GAAG,oCAAY,CAAC;;;AAG5B,QAAM,SAAS,GAAG,qCAAa,UAAU,EAAE,WAAW,CAAC,CAAC;AACxD,qEAA0C,WAAW,CAAG,CAAC;AACzD,QAAM,QAAQ,GAAG,qCAAY,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;AACtD,0CAAgB,QAAQ,oBAAe,SAAS,CAAC,IAAI,SAAI,SAAS,CAAC,IAAI,QAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAClG,6QASK,SAAS,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5C","file":"deploy_push.js","sourcesContent":["import { execSync } from 'child_process';\n\nimport remoteExec from 'ssh-exec';\n\nimport { getBuildDir } from '../../configs/directories';\nimport { getSshConfig, readConfig } from '../../utils/config_utils';\nimport actionTitle from '../../ui/action_title';\n\nconst CONFIGFILE = '.catladder.yaml';\n\nexport default (environment, done) => {\n const config = readConfig();\n\n // const envConf = config.environments[environment];\n const sshConfig = getSshConfig(CONFIGFILE, environment);\n actionTitle(`uploading server bundle to ${environment}`);\n const buildDir = getBuildDir({ config, environment });\n execSync(`scp ${buildDir}/app.tar.gz ${sshConfig.user}@${sshConfig.host}:`, { stdio: 'inherit' });\n remoteExec(`\n rm -rf ~/app/last\n mv ~/app/bundle ~/app/last\n rm ~/app/current\n ln -s ~/app/bundle ~/app/current\n tar xfz app.tar.gz -C app\n pushd ~/app/bundle/programs/server\n npm install\n popd\n `, sshConfig, done).pipe(process.stdout);\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/panter-meteor-classic/index.js b/dist/deployments/panter-meteor-classic/index.js deleted file mode 100644 index bbab2b1..0000000 --- a/dist/deployments/panter-meteor-classic/index.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _applyConfig = require('./applyConfig'); - -var _applyConfig2 = _interopRequireDefault(_applyConfig); - -var _push = require('./push'); - -var _push2 = _interopRequireDefault(_push); - -var _restart = require('./restart'); - -var _restart2 = _interopRequireDefault(_restart); - -exports['default'] = { - push: _push2['default'], - restart: _restart2['default'], - applyConfig: _applyConfig2['default'] -}; -module.exports = exports['default']; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/deployments/panter-meteor-classic/index.js.map b/dist/deployments/panter-meteor-classic/index.js.map deleted file mode 100644 index ce5b485..0000000 --- a/dist/deployments/panter-meteor-classic/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/deployments/panter-meteor-classic/index.js"],"names":[],"mappings":";;;;;;;;2BAAwB,eAAe;;;;oBACtB,QAAQ;;;;uBACL,WAAW;;;;qBAEhB;AACb,MAAI,mBAAA;AACJ,SAAO,sBAAA;AACP,aAAW,0BAAA;CACZ","file":"index.js","sourcesContent":["import applyConfig from './applyConfig';\nimport push from './push';\nimport restart from './restart';\n\nexport default {\n push,\n restart,\n applyConfig,\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/panter-meteor-classic/push.js b/dist/deployments/panter-meteor-classic/push.js deleted file mode 100644 index ceac022..0000000 --- a/dist/deployments/panter-meteor-classic/push.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _sshExec = require('ssh-exec'); - -var _sshExec2 = _interopRequireDefault(_sshExec); - -var _configsDirectories = require('../../configs/directories'); - -var _utilsConfig_utils = require('../../utils/config_utils'); - -var _uiAction_title = require('../../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _utilsExec = require('../../utils/exec'); - -var _utilsExec2 = _interopRequireDefault(_utilsExec); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(); - - // const envConf = config.environments[environment]; - var sshConfig = (0, _utilsConfig_utils.getSshConfig)(CONFIGFILE, environment); - (0, _uiAction_title2['default'])('uploading server bundle to ' + environment); - var buildDir = (0, _configsDirectories.getBuildDir)({ config: config, environment: environment }); - (0, _utilsExec2['default'])('scp ' + buildDir + '/app.tar.gz ' + sshConfig.user + '@' + sshConfig.host + ':', { stdio: 'inherit' }); - (0, _sshExec2['default'])('\n rm -rf ~/app/last\n mv ~/app/bundle ~/app/last\n rm ~/app/current\n ln -s ~/app/bundle ~/app/current\n tar xfz app.tar.gz -C app\n pushd ~/app/bundle/programs/server\n npm install\n popd\n ', sshConfig, done).pipe(process.stdout); -}; - -module.exports = exports['default']; -//# sourceMappingURL=push.js.map \ No newline at end of file diff --git a/dist/deployments/panter-meteor-classic/push.js.map b/dist/deployments/panter-meteor-classic/push.js.map deleted file mode 100644 index b67cd2f..0000000 --- a/dist/deployments/panter-meteor-classic/push.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/deployments/panter-meteor-classic/push.js"],"names":[],"mappings":";;;;;;;;uBAAuB,UAAU;;;;kCAEL,2BAA2B;;iCACd,0BAA0B;;8BAC3C,uBAAuB;;;;yBAC9B,kBAAkB;;;;AAEnC,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAEtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAM,MAAM,GAAG,oCAAY,CAAC;;;AAG5B,MAAM,SAAS,GAAG,qCAAa,UAAU,EAAE,WAAW,CAAC,CAAC;AACxD,mEAA0C,WAAW,CAAG,CAAC;AACzD,MAAM,QAAQ,GAAG,qCAAY,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;AACtD,uCAAY,QAAQ,oBAAe,SAAS,CAAC,IAAI,SAAI,SAAS,CAAC,IAAI,QAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAC9F,2QAWE,SAAS,EACT,IAAI,CACL,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;CACxB","file":"push.js","sourcesContent":["import remoteExec from 'ssh-exec';\n\nimport { getBuildDir } from '../../configs/directories';\nimport { getSshConfig, readConfig } from '../../utils/config_utils';\nimport actionTitle from '../../ui/action_title';\nimport exec from '../../utils/exec';\n\nconst CONFIGFILE = '.catladder.yaml';\n\nexport default (environment, done) => {\n const config = readConfig();\n\n // const envConf = config.environments[environment];\n const sshConfig = getSshConfig(CONFIGFILE, environment);\n actionTitle(`uploading server bundle to ${environment}`);\n const buildDir = getBuildDir({ config, environment });\n exec(`scp ${buildDir}/app.tar.gz ${sshConfig.user}@${sshConfig.host}:`, { stdio: 'inherit' });\n remoteExec(\n `\n rm -rf ~/app/last\n mv ~/app/bundle ~/app/last\n rm ~/app/current\n ln -s ~/app/bundle ~/app/current\n tar xfz app.tar.gz -C app\n pushd ~/app/bundle/programs/server\n npm install\n popd\n `,\n sshConfig,\n done,\n ).pipe(process.stdout);\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/panter-meteor-classic/push_server.js b/dist/deployments/panter-meteor-classic/push_server.js deleted file mode 100644 index 3c72b5b..0000000 --- a/dist/deployments/panter-meteor-classic/push_server.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _child_process = require('child_process'); - -var _sshExec = require('ssh-exec'); - -var _sshExec2 = _interopRequireDefault(_sshExec); - -var _configsDirectories = require('../../configs/directories'); - -var _utilsConfig_utils = require('../../utils/config_utils'); - -var _uiAction_title = require('../../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(); - - // const envConf = config.environments[environment]; - var sshConfig = (0, _utilsConfig_utils.getSshConfig)(CONFIGFILE, environment); - (0, _uiAction_title2['default'])('uploading server bundle to ' + environment); - var buildDir = (0, _configsDirectories.getBuildDir)({ config: config, environment: environment }); - (0, _child_process.execSync)('scp ' + buildDir + '/app.tar.gz ' + sshConfig.user + '@' + sshConfig.host + ':', { stdio: 'inherit' }); - (0, _sshExec2['default'])('\n rm -rf ~/app/last\n mv ~/app/bundle ~/app/last\n rm ~/app/current\n ln -s ~/app/bundle ~/app/current\n tar xfz app.tar.gz -C app\n pushd ~/app/bundle/programs/server\n npm install\n popd\n ', sshConfig, done).pipe(process.stdout); -}; - -module.exports = exports['default']; -//# sourceMappingURL=push_server.js.map \ No newline at end of file diff --git a/dist/deployments/panter-meteor-classic/push_server.js.map b/dist/deployments/panter-meteor-classic/push_server.js.map deleted file mode 100644 index 8673a2f..0000000 --- a/dist/deployments/panter-meteor-classic/push_server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/deployments/panter-meteor-classic/push_server.js"],"names":[],"mappings":";;;;;;;;6BAAyB,eAAe;;uBAEjB,UAAU;;;;kCAEL,2BAA2B;;iCACd,0BAA0B;;8BAC3C,uBAAuB;;;;AAE/C,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAEtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,QAAM,MAAM,GAAG,oCAAY,CAAC;;;AAG5B,QAAM,SAAS,GAAG,qCAAa,UAAU,EAAE,WAAW,CAAC,CAAC;AACxD,qEAA0C,WAAW,CAAG,CAAC;AACzD,QAAM,QAAQ,GAAG,qCAAY,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;AACtD,0CAAgB,QAAQ,oBAAe,SAAS,CAAC,IAAI,SAAI,SAAS,CAAC,IAAI,QAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AAClG,6QASK,SAAS,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5C","file":"push_server.js","sourcesContent":["import { execSync } from 'child_process';\n\nimport remoteExec from 'ssh-exec';\n\nimport { getBuildDir } from '../../configs/directories';\nimport { getSshConfig, readConfig } from '../../utils/config_utils';\nimport actionTitle from '../../ui/action_title';\n\nconst CONFIGFILE = '.catladder.yaml';\n\nexport default (environment, done) => {\n const config = readConfig();\n\n // const envConf = config.environments[environment];\n const sshConfig = getSshConfig(CONFIGFILE, environment);\n actionTitle(`uploading server bundle to ${environment}`);\n const buildDir = getBuildDir({ config, environment });\n execSync(`scp ${buildDir}/app.tar.gz ${sshConfig.user}@${sshConfig.host}:`, { stdio: 'inherit' });\n remoteExec(`\n rm -rf ~/app/last\n mv ~/app/bundle ~/app/last\n rm ~/app/current\n ln -s ~/app/bundle ~/app/current\n tar xfz app.tar.gz -C app\n pushd ~/app/bundle/programs/server\n npm install\n popd\n `, sshConfig, done).pipe(process.stdout);\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/panter-meteor-classic/restart.js b/dist/deployments/panter-meteor-classic/restart.js deleted file mode 100644 index 4da6df6..0000000 --- a/dist/deployments/panter-meteor-classic/restart.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _sshExec = require('ssh-exec'); - -var _sshExec2 = _interopRequireDefault(_sshExec); - -var _utilsConfig_utils = require('../../utils/config_utils'); - -var CONFIGFILE = '.catladder.yaml'; - -exports['default'] = function (environment, done) { - (0, _sshExec2['default'])('./bin/nodejs.sh restart', (0, _utilsConfig_utils.getSshConfig)(CONFIGFILE, environment), function () { - done(null, 'server restarted'); - }).pipe(process.stdout); -}; - -module.exports = exports['default']; -//# sourceMappingURL=restart.js.map \ No newline at end of file diff --git a/dist/deployments/panter-meteor-classic/restart.js.map b/dist/deployments/panter-meteor-classic/restart.js.map deleted file mode 100644 index d504f5b..0000000 --- a/dist/deployments/panter-meteor-classic/restart.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/deployments/panter-meteor-classic/restart.js"],"names":[],"mappings":";;;;;;;;uBAAuB,UAAU;;;;iCACJ,0BAA0B;;AAEvD,IAAM,UAAU,GAAG,iBAAiB,CAAC;;qBAEtB,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,4BAAW,yBAAyB,EAAE,qCAAa,UAAU,EAAE,WAAW,CAAC,EAAE,YAAM;AACjF,QAAI,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;GAChC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;CACzB","file":"restart.js","sourcesContent":["import remoteExec from 'ssh-exec';\nimport { getSshConfig } from '../../utils/config_utils';\n\nconst CONFIGFILE = '.catladder.yaml';\n\nexport default (environment, done) => {\n remoteExec('./bin/nodejs.sh restart', getSshConfig(CONFIGFILE, environment), () => {\n done(null, 'server restarted');\n }).pipe(process.stdout);\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/panter-meteor-kubernetes/applyConfig.js b/dist/deployments/panter-meteor-kubernetes/applyConfig.js deleted file mode 100644 index 445f143..0000000 --- a/dist/deployments/panter-meteor-kubernetes/applyConfig.js +++ /dev/null @@ -1,82 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _lodash = require('lodash'); - -var _libsUtils = require('./libs/utils'); - -var _configsDirectories = require('../../configs/directories'); - -var _utilsConfig_utils = require('../../utils/config_utils'); - -var _utilsPass_utils = require('../../utils/pass_utils'); - -var _uiAction_title = require('../../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _utilsExec = require('../../utils/exec'); - -var _utilsExec2 = _interopRequireDefault(_utilsExec); - -var sanitizeKubeValue = function sanitizeKubeValue(value) { - return (0, _lodash.isObject)(value) ? JSON.stringify(value) : (0, _lodash.toString)(value); -}; - -exports['default'] = function (environment, done) { - (0, _uiAction_title2['default'])('applying kubernetes config ' + environment + ' πŸ’« '); - var config = (0, _utilsConfig_utils.readConfig)(); - var imageName = (0, _libsUtils.getKubernetesImageNameFromConfig)(config, environment); - (0, _uiAction_title2['default'])('imageName: ' + imageName); - - var passPathForEnvVars = (0, _configsDirectories.passEnvFile)({ config: config, environment: environment }); - var passEnv = (0, _utilsPass_utils.readPassYaml)(passPathForEnvVars); - - var _config$environments$environment = config.environments[environment]; - var url = _config$environments$environment.url; - var environmentEnv = _config$environments$environment.env; - var _config$environments$environment$deployment = _config$environments$environment.deployment; - var commonDeploymentEnv = _config$environments$environment$deployment.env; - var _config$environments$environment$deployment$kubeDeployments = _config$environments$environment$deployment.kubeDeployments; - var kubeDeployments = _config$environments$environment$deployment$kubeDeployments === undefined ? [] : _config$environments$environment$deployment$kubeDeployments; - - kubeDeployments.forEach(function (deployment) { - var file = deployment.file; - var _deployment$env = deployment.env; - var deploymentEnv = _deployment$env === undefined ? {} : _deployment$env; - - var compiled = (0, _lodash.template)(_fs2['default'].readFileSync(file)); - var baseEnv = { - ROOT_URL: url, - METEOR_SETTINGS: { - 'public': { - KUBERNETES_IMAGE: imageName } - } - }; - // useful to show the actual image on the client - var fullEnv = (0, _lodash.merge)({}, baseEnv, environmentEnv, commonDeploymentEnv, deploymentEnv, passEnv); - - var kubeEnv = (0, _lodash.map)(fullEnv, function (value, name) { - return { name: name, value: sanitizeKubeValue(value) }; - }); - var yaml = compiled({ - image: imageName, - env: JSON.stringify(kubeEnv) - }); - console.log('apply', yaml); - (0, _utilsExec2['default'])('kubectl apply -f -', { input: yaml, stdio: ['pipe', 1, 2] }); - }); - done(null, 'done'); -}; - -module.exports = exports['default']; -//# sourceMappingURL=applyConfig.js.map \ No newline at end of file diff --git a/dist/deployments/panter-meteor-kubernetes/applyConfig.js.map b/dist/deployments/panter-meteor-kubernetes/applyConfig.js.map deleted file mode 100644 index 9b29760..0000000 --- a/dist/deployments/panter-meteor-kubernetes/applyConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/deployments/panter-meteor-kubernetes/applyConfig.js"],"names":[],"mappings":";;;;;;;;kBAAe,IAAI;;;;sBAEsC,QAAQ;;yBAChB,cAAc;;kCACnC,2BAA2B;;iCAC5B,0BAA0B;;+BACxB,wBAAwB;;8BAC7B,uBAAuB;;;;y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AAK,EAAE,IAAI;aAAM,EAAE,IAAI,EAAJ,IAAI,EAAE,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,EAAE;KAAC,CAAC,CAAC;AAC3F,QAAM,IAAI,GAAG,QAAQ,CAAC;AACpB,WAAK,EAAE,SAAS;AAChB,SAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;KAC7B,CAAC,CAAC;AACH,WAAO,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC3B,gCAAK,oBAAoB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;GACpE,CAAC,CAAC;AACH,MAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;CACpB","file":"applyConfig.js","sourcesContent":["import fs from 'fs';\n\nimport { template, map, isObject, toString, merge } from 'lodash';\nimport { getKubernetesImageNameFromConfig } from './libs/utils';\nimport { passEnvFile } from '../../configs/directories';\nimport { readConfig } from '../../utils/config_utils';\nimport { readPassYaml } from '../../utils/pass_utils';\nimport actionTitle from '../../ui/action_title';\nimport exec from '../../utils/exec';\n\nconst sanitizeKubeValue = value => (isObject(value) ? JSON.stringify(value) : toString(value));\n\nexport default (environment, done) => {\n actionTitle(`applying kubernetes config ${environment} πŸ’« `);\n const config = readConfig();\n const imageName = getKubernetesImageNameFromConfig(config, environment);\n actionTitle(`imageName: ${imageName}`);\n\n const passPathForEnvVars = passEnvFile({ config, environment });\n const passEnv = readPassYaml(passPathForEnvVars);\n\n const {\n url,\n env: environmentEnv,\n deployment: { env: commonDeploymentEnv, kubeDeployments = [] },\n } = config.environments[environment];\n\n kubeDeployments.forEach((deployment) => {\n const { file, env: deploymentEnv = {} } = deployment;\n const compiled = template(fs.readFileSync(file));\n const baseEnv = {\n ROOT_URL: url,\n METEOR_SETTINGS: {\n public: {\n KUBERNETES_IMAGE: imageName, // useful to show the actual image on the client\n },\n },\n };\n const fullEnv = merge({}, baseEnv, environmentEnv, commonDeploymentEnv, deploymentEnv, passEnv);\n \n const kubeEnv = map(fullEnv, (value, name) => ({ name, value: sanitizeKubeValue(value) }));\n const yaml = compiled({\n image: imageName,\n env: JSON.stringify(kubeEnv),\n });\n console.log('apply', yaml);\n exec('kubectl apply -f -', { input: yaml, stdio: ['pipe', 1, 2] });\n });\n done(null, 'done');\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/panter-meteor-kubernetes/deploy.js b/dist/deployments/panter-meteor-kubernetes/deploy.js deleted file mode 100644 index 0335dee..0000000 --- a/dist/deployments/panter-meteor-kubernetes/deploy.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _commands = require('../../commands'); - -var _push = require('./push'); - -var _push2 = _interopRequireDefault(_push); - -exports['default'] = function (environment, done) { - (0, _commands.buildServer)(environment, function () { - (0, _push2['default'])(environment, done); - }); -}; - -module.exports = exports['default']; -//# sourceMappingURL=deploy.js.map \ No newline at end of file diff --git a/dist/deployments/panter-meteor-kubernetes/deploy.js.map b/dist/deployments/panter-meteor-kubernetes/deploy.js.map deleted file mode 100644 index 136c606..0000000 --- a/dist/deployments/panter-meteor-kubernetes/deploy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/deployments/panter-meteor-kubernetes/deploy.js"],"names":[],"mappings":";;;;;;;;wBAA4B,gBAAgB;;oBAC3B,QAAQ;;;;qBAEV,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,6BAAY,WAAW,EAAE,YAAM;AAC7B,2BAAK,WAAW,EAAE,IAAI,CAAC,CAAC;GACzB,CAAC,CAAC;CACJ","file":"deploy.js","sourcesContent":["import { buildServer } from '../../commands';\nimport push from './push';\n\nexport default (environment, done) => {\n buildServer(environment, () => {\n push(environment, done);\n });\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/panter-meteor-kubernetes/index.js b/dist/deployments/panter-meteor-kubernetes/index.js deleted file mode 100644 index 33d94e3..0000000 --- a/dist/deployments/panter-meteor-kubernetes/index.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _applyConfig = require('./applyConfig'); - -var _applyConfig2 = _interopRequireDefault(_applyConfig); - -var _deploy = require('./deploy'); - -var _deploy2 = _interopRequireDefault(_deploy); - -var _push = require('./push'); - -var _push2 = _interopRequireDefault(_push); - -exports['default'] = { - push: _push2['default'], - deploy: _deploy2['default'], - applyConfig: _applyConfig2['default'] -}; -module.exports = exports['default']; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/deployments/panter-meteor-kubernetes/index.js.map b/dist/deployments/panter-meteor-kubernetes/index.js.map deleted file mode 100644 index 5ea0b05..0000000 --- a/dist/deployments/panter-meteor-kubernetes/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/deployments/panter-meteor-kubernetes/index.js"],"names":[],"mappings":";;;;;;;;2BAAwB,eAAe;;;;sBACpB,UAAU;;;;oBACZ,QAAQ;;;;qBAEV;AACb,MAAI,mBAAA;AACJ,QAAM,qBAAA;AACN,aAAW,0BAAA;CACZ","file":"index.js","sourcesContent":["import applyConfig from './applyConfig';\nimport deploy from './deploy';\nimport push from './push';\n\nexport default {\n push,\n deploy,\n applyConfig,\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/panter-meteor-kubernetes/libs/utils.js b/dist/deployments/panter-meteor-kubernetes/libs/utils.js deleted file mode 100644 index d1bc360..0000000 --- a/dist/deployments/panter-meteor-kubernetes/libs/utils.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _lodash = require('lodash'); - -var _utilsGit_utils = require('../../../utils/git_utils'); - -var _utilsConfig_utils = require('../../../utils/config_utils'); - -var CONFIGFILE = '.catladder.yaml'; - -var generateKubernetesImageName = function generateKubernetesImageName(config, environment) { - var _config$dockerEndPoint = config.dockerEndPoint; - var dockerEndPoint = _config$dockerEndPoint === undefined ? 'gcr.io/skynet-164509' : _config$dockerEndPoint; - var _config$appname = config.appname; - var appname = _config$appname === undefined ? 'unknown app' : _config$appname; - - var versionTag = (0, _utilsGit_utils.getFullVersionString)(environment); - return dockerEndPoint + '/' + appname + ':' + versionTag; -}; - -exports.generateKubernetesImageName = generateKubernetesImageName; -var getKubernetesImageNameFromConfig = function getKubernetesImageNameFromConfig(config, environment) { - return (0, _lodash.get)(config, ['environments', environment, 'deployment', 'image']); -}; - -exports.getKubernetesImageNameFromConfig = getKubernetesImageNameFromConfig; -var writeImageNameToConfig = function writeImageNameToConfig(config, environment, imageName) { - (0, _lodash.set)(config, ['environments', environment, 'deployment', 'image'], imageName); - (0, _utilsConfig_utils.writeConfig)(CONFIGFILE, config); -}; -exports.writeImageNameToConfig = writeImageNameToConfig; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/dist/deployments/panter-meteor-kubernetes/libs/utils.js.map b/dist/deployments/panter-meteor-kubernetes/libs/utils.js.map deleted file mode 100644 index 15228f5..0000000 --- a/dist/deployments/panter-meteor-kubernetes/libs/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../src/deployments/panter-meteor-kubernetes/libs/utils.js"],"names":[],"mappings":";;;;;;sBAAyB,QAAQ;;8BAEI,0BAA0B;;iCACnC,6BAA6B;;AAEzD,IAAM,UAAU,GAAG,iBAAiB,CAAC;;AAE9B,IAAM,2BAA2B,GAAG,SAA9B,2BAA2B,CAAI,MAAM,EAAE,WAAW,EAAK;+BACW,MAAM,CAA3E,cAAc;MAAd,cAAc,0CAAG,sBAAsB;wBAA8B,MAAM,CAAlC,OAAO;MAAP,OAAO,mCAAG,aAAa;;AAExE,MAAM,UAAU,GAAG,0CAAqB,WAAW,CAAC,CAAC;AACrD,SAAU,cAAc,SAAI,OAAO,SAAI,UAAU,CAAG;CACrD,CAAC;;;AAEK,IAAM,gCAAgC,GAAG,SAAnC,gCAAgC,CAAI,MAAM,EAAE,WAAW;SAClE,iBAAI,MAAM,EAAE,CAAC,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;CAAA,CAAC;;;AAE7D,IAAM,sBAAsB,GAAG,SAAzB,sBAAsB,CAAI,MAAM,EAAE,WAAW,EAAE,SAAS,EAAK;AACxE,mBAAI,MAAM,EAAE,CAAC,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;AAC7E,sCAAY,UAAU,EAAE,MAAM,CAAC,CAAC;CACjC,CAAC","file":"utils.js","sourcesContent":["import { set, get } from 'lodash';\n\nimport { getFullVersionString } from '../../../utils/git_utils';\nimport { writeConfig } from '../../../utils/config_utils';\n\nconst CONFIGFILE = '.catladder.yaml';\n\nexport const generateKubernetesImageName = (config, environment) => {\n const { dockerEndPoint = 'gcr.io/skynet-164509', appname = 'unknown app' } = config;\n\n const versionTag = getFullVersionString(environment);\n return `${dockerEndPoint}/${appname}:${versionTag}`;\n};\n\nexport const getKubernetesImageNameFromConfig = (config, environment) =>\n get(config, ['environments', environment, 'deployment', 'image']);\n\nexport const writeImageNameToConfig = (config, environment, imageName) => {\n set(config, ['environments', environment, 'deployment', 'image'], imageName);\n writeConfig(CONFIGFILE, config);\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/panter-meteor-kubernetes/push.js b/dist/deployments/panter-meteor-kubernetes/push.js deleted file mode 100644 index 473adf1..0000000 --- a/dist/deployments/panter-meteor-kubernetes/push.js +++ /dev/null @@ -1,98 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _libsUtils = require('./libs/utils'); - -var _configsDirectories = require('../../configs/directories'); - -var _utilsConfig_utils = require('../../utils/config_utils'); - -var _uiAction_title = require('../../ui/action_title'); - -var _uiAction_title2 = _interopRequireDefault(_uiAction_title); - -var _applyConfig = require('./applyConfig'); - -var _applyConfig2 = _interopRequireDefault(_applyConfig); - -var _utilsExec = require('../../utils/exec'); - -var _utilsExec2 = _interopRequireDefault(_utilsExec); - -var createDockerFile = function createDockerFile(_ref) { - var nodeVersion = _ref.nodeVersion; - var config = _ref.config; - var environment = _ref.environment; - - var dockerFile = (0, _configsDirectories.getBuildDirDockerFile)({ config: config, environment: environment }); - - _fs2['default'].writeFileSync(dockerFile, '\nFROM node:' + nodeVersion + '\nADD bundle /app\nRUN cd /app/programs/server && npm install\nWORKDIR /app\nEXPOSE 8888\nCMD ["node", "main.js"]\n '); - return dockerFile; -}; -/* todo generate dockerfile and pipe in * */ -/* -const dockerFile = ` - FROM node:4.8.4 - ADD build/production/app.tar.gz /app - RUN cd /app/bundle/programs/server && npm install - WORKDIR /app/bundle - EXPOSE 8888 - CMD ["node", "main.js"] -` */ - -var getNodeVersion = function getNodeVersion(_ref2) { - var environment = _ref2.environment; - var config = _ref2.config; - - var buildDir = (0, _configsDirectories.getBuildDir)({ environment: environment, config: config }); - var meteorNodeVersionFile = buildDir + '/bundle/.node_version.txt'; - var versionString = (0, _utilsExec2['default'])('cat ' + meteorNodeVersionFile, { stdio: [0], encoding: 'utf-8' }); - return versionString.replace('v', ''); -}; - -exports['default'] = function (environment, done) { - (0, _uiAction_title2['default'])(' 🎢 πŸ‘Š push it real good ! πŸ‘Š 🎢 ' + environment + ' 🎢 '); - var config = (0, _utilsConfig_utils.readConfig)(); - var fullImageName = (0, _libsUtils.generateKubernetesImageName)(config, environment); - - (0, _uiAction_title2['default'])('image ' + fullImageName); - - var _config$appname = config.appname; - var appname = _config$appname === undefined ? 'unknown app' : _config$appname; - - var nodeVersion = getNodeVersion({ environment: environment, config: config }); - console.log('using node version: ' + nodeVersion); - // const nodeVersion = '8.9.1'; - var dockerFile = createDockerFile({ nodeVersion: nodeVersion, config: config, environment: environment }); - var buildDir = (0, _configsDirectories.getBuildDir)({ environment: environment, config: config }); - var dockerBuildCommand = 'docker build -t ' + appname + ' -f ' + dockerFile + ' ' + buildDir; - - (0, _utilsExec2['default'])(dockerBuildCommand); - - (0, _libsUtils.writeImageNameToConfig)(config, environment, fullImageName); - - (0, _utilsExec2['default'])('docker tag ' + appname + ' ' + fullImageName); - - try { - (0, _utilsExec2['default'])('docker push ' + fullImageName); - } catch (e) { - console.warn('You need at least docker version 18.03.0'); - console.log(); - console.error(e); - process.exit(1); - } - - (0, _applyConfig2['default'])(environment, done); -}; - -module.exports = exports['default']; -//# sourceMappingURL=push.js.map \ No newline at end of file diff --git a/dist/deployments/panter-meteor-kubernetes/push.js.map b/dist/deployments/panter-meteor-kubernetes/push.js.map deleted file mode 100644 index d3a90c0..0000000 --- a/dist/deployments/panter-meteor-kubernetes/push.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/deployments/panter-meteor-kubernetes/push.js"],"names":[],"mappings":";;;;;;;;kBAAe,IAAI;;;;yBAEiD,cAAc;;kCAC/B,2BAA2B;;iCACnD,0BAA0B;;8BAC7B,uBAAuB;;;;2BACvB,eAAe;;;;yBACtB,kBAAkB;;;;AAEnC,IAAM,gBAAgB,GAAG,SAAnB,gBAAgB,CAAI,IAAoC,EAAK;MAAvC,WAAW,GAAb,IAAoC,CAAlC,WAAW;MAAE,MAAM,GAArB,IAAoC,CAArB,MAAM;MAAE,WAAW,GAAlC,IAAoC,CAAb,WAAW;;AAC1D,MAAM,UAAU,GAAG,+CAAsB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;;AAElE,kBAAG,aAAa,CACd,UAAU,mBAEF,WAAW,2HAOpB,CAAC;AACF,SAAO,UAAU,CAAC;CACnB,CAAC;;;;;;;;;;;;AAYF,IAAM,cAAc,GAAG,S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MAAM,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;;AAE3D,8CAAmB,OAAO,SAAI,aAAa,CAAG,CAAC;;AAE/C,MAAI;AACF,iDAAoB,aAAa,CAAG,CAAC;GACtC,CAAC,OAAO,CAAC,EAAE;AACV,WAAO,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;AACzD,WAAO,CAAC,GAAG,EAAE,CAAC;AACd,WAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACjB,WAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;GACjB;;AAED,gCAAY,WAAW,EAAE,IAAI,CAAC,CAAC;CAChC","file":"push.js","sourcesContent":["import fs from 'fs';\n\nimport { generateKubernetesImageName, writeImageNameToConfig } from './libs/utils';\nimport { getBuildDir, getBuildDirDockerFile } from '../../configs/directories';\nimport { readConfig } from '../../utils/config_utils';\nimport actionTitle from '../../ui/action_title';\nimport applyConfig from './applyConfig';\nimport exec from '../../utils/exec';\n\nconst createDockerFile = ({ nodeVersion, config, environment }) => {\n const dockerFile = getBuildDirDockerFile({ config, environment });\n\n fs.writeFileSync(\n dockerFile,\n `\nFROM node:${nodeVersion}\nADD bundle /app\nRUN cd /app/programs/server && npm install\nWORKDIR /app\nEXPOSE 8888\nCMD [\"node\", \"main.js\"]\n `,\n );\n return dockerFile;\n};\n/* todo generate dockerfile and pipe in * */\n/*\nconst dockerFile = `\n FROM node:4.8.4\n ADD build/production/app.tar.gz /app\n RUN cd /app/bundle/programs/server && npm install\n WORKDIR /app/bundle\n EXPOSE 8888\n CMD [\"node\", \"main.js\"]\n` */\n\nconst getNodeVersion = ({ environment, config }) => {\n const buildDir = getBuildDir({ environment, config });\n const meteorNodeVersionFile = `${buildDir}/bundle/.node_version.txt`;\n const versionString = exec(`cat ${meteorNodeVersionFile}`, { stdio: [0], encoding: 'utf-8' });\n return versionString.replace('v', '');\n};\n\nexport default (environment, done) => {\n actionTitle(` 🎢 πŸ‘Š push it real good ! πŸ‘Š 🎢 ${environment} 🎢 `);\n const config = readConfig();\n const fullImageName = generateKubernetesImageName(config, environment);\n\n actionTitle(`image ${fullImageName}`);\n\n const { appname = 'unknown app' } = config;\n const nodeVersion = getNodeVersion({ environment, config });\n console.log(`using node version: ${nodeVersion}`);\n // const nodeVersion = '8.9.1';\n const dockerFile = createDockerFile({ nodeVersion, config, environment });\n const buildDir = getBuildDir({ environment, config });\n const dockerBuildCommand = `docker build -t ${appname} -f ${dockerFile} ${buildDir}`;\n\n exec(dockerBuildCommand);\n\n writeImageNameToConfig(config, environment, fullImageName);\n\n exec(`docker tag ${appname} ${fullImageName}`);\n\n try {\n exec(`docker push ${fullImageName}`);\n } catch (e) {\n console.warn('You need at least docker version 18.03.0');\n console.log();\n console.error(e);\n process.exit(1);\n }\n\n applyConfig(environment, done);\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/panter-meteor-kubernetes/push_server.js b/dist/deployments/panter-meteor-kubernetes/push_server.js deleted file mode 100644 index 9d26fa4..0000000 --- a/dist/deployments/panter-meteor-kubernetes/push_server.js +++ /dev/null @@ -1,108 +0,0 @@ -'use strict'; - -var _extends = require('babel-runtime/helpers/extends')['default']; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _child_process = require('child_process'); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _lodash = require('lodash'); - -var _configsDirectories = require('../../configs/directories'); - -var _utilsGit_utils = require('../../utils/git_utils'); - -var _utilsConfig_utils = require('../../utils/config_utils'); - -var _utilsPass_utils = require('../../utils/pass_utils'); - -var createDockerFile = function createDockerFile(_ref) { - var config = _ref.config; - var environment = _ref.environment; - - var dockerFile = (0, _configsDirectories.getBuildDirDockerFile)({ config: config, environment: environment }); - _fs2['default'].writeFileSync(dockerFile, '\nFROM node:4.8.4\nADD app.tar.gz /app\nRUN cd /app/bundle/programs/server && npm install\nWORKDIR /app/bundle\nEXPOSE 8888\nCMD ["node", "main.js"]\n '); - return dockerFile; -}; -/* todo generate dockerfile and pipe in * */ -/* -const dockerFile = ` - FROM node:4.8.4 - ADD build/production/app.tar.gz /app - RUN cd /app/bundle/programs/server && npm install - WORKDIR /app/bundle - EXPOSE 8888 - CMD ["node", "main.js"] -` */ - -var exec = function exec(cmd) { - console.log(cmd); - (0, _child_process.execSync)(cmd, { stdio: 'inherit' }); -}; - -exports['default'] = function (environment, done) { - var config = (0, _utilsConfig_utils.readConfig)(); - var passPathForEnvVars = (0, _configsDirectories.passEnvFile)({ config: config, environment: environment }); - var passEnv = (0, _utilsPass_utils.readPassYaml)(passPathForEnvVars); - var _config$dockerEndPoint = config.dockerEndPoint; - var dockerEndPoint = _config$dockerEndPoint === undefined ? 'gcr.io/skynet-164509' : _config$dockerEndPoint; - var _config$appname = config.appname; - var appname = _config$appname === undefined ? 'unknown app' : _config$appname; - - console.log('would do the following if implemented: '); - console.log('(but you can do it manually! 😽 )'); - console.log(' '); - - var dockerFile = createDockerFile({ config: config, environment: environment }); - console.log(dockerFile); - var buildDir = (0, _configsDirectories.getBuildDir)({ environment: environment, config: config }); - var dockerBuildCommand = 'docker build -t ' + appname + ' -f ' + dockerFile + ' ' + buildDir; - - // exec(dockerBuildCommand); - - var versionTag = (0, _utilsGit_utils.getFullVersionString)(environment); - var fullImageName = dockerEndPoint + '/' + appname + ':' + versionTag; - // exec(`docker tag ${appname} ${fullImageName}`); - // exec(`gcloud docker -- push ${fullImageName}`); - - var _config$environments$environment = config.environments[environment]; - var url = _config$environments$environment.url; - var _config$environments$environment$deployment = _config$environments$environment.deployment; - var commonDeploymentEnv = _config$environments$environment$deployment.env; - var _config$environments$environment$deployment$kubeDeployments = _config$environments$environment$deployment.kubeDeployments; - var kubeDeployments = _config$environments$environment$deployment$kubeDeployments === undefined ? [] : _config$environments$environment$deployment$kubeDeployments; - - kubeDeployments.forEach(function (deployment) { - var file = deployment.file; - var _deployment$env = deployment.env; - var deploymentEnv = _deployment$env === undefined ? {} : _deployment$env; - - var compiled = (0, _lodash.template)(_fs2['default'].readFileSync(file)); - var fullEnv = _extends({}, passEnv, { - ROOT_URL: url - }, commonDeploymentEnv, deploymentEnv); - var yaml = compiled({ - image: fullImageName, - env: JSON.stringify(fullEnv) - }); - console.log('would apply'); - console.log(yaml); - }); - - console.log('generate or adjust: kube/' + environment + '/deployment.' + appname + '_worker.yml (add tag ' + versionTag + ')'); - console.log('generate or adjust: kube/' + environment + '/deployment.' + appname + '_web.yml (add tag ' + versionTag + ')'); - console.log('kubectl apply -f kube/' + environment + '/deployment.' + appname + '_worker.yml'); - console.log('kubectl apply -f kube/' + environment + '/deployment.' + appname + '_web.yml'); - done(null, 'done'); -}; - -module.exports = exports['default']; -//# sourceMappingURL=push_server.js.map \ No newline at end of file diff --git a/dist/deployments/panter-meteor-kubernetes/push_server.js.map b/dist/deployments/panter-meteor-kubernetes/push_server.js.map deleted file mode 100644 index bc2ab4a..0000000 --- a/dist/deployments/panter-meteor-kubernetes/push_server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/deployments/panter-meteor-kubernetes/push_server.js"],"names":[],"mappings":";;;;;;;;;;6BAAyB,eAAe;;kBACzB,IAAI;;;;sBAEM,QAAQ;;kCAE+B,2BAA2B;;8BACtD,uBAAuB;;iCACjC,0BAA0B;;+BACxB,wBAAwB;;AAErD,IAAM,gBAAgB,GAAG,SAAnB,gBAAgB,CAAI,IAAuB,EAAK;MAA1B,MAAM,GAAR,IAAuB,CAArB,MAAM;MAAE,WAAW,GAArB,IAAuB,CAAb,WAAW;;AAC7C,MAAM,UAAU,GAAG,+CAAsB,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;AAClE,kBAAG,aAAa,CACd,UAAU,6JASX,CAAC;AACF,SAAO,UAAU,CAAC;CACnB,CAAC;;;;;;;;;;;;AAYF,IAAM,IAAI,GAAG,SAAP,IAAI,CAAI,GAAG,EAAK;AACpB,SAAO,CA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AC,UAAC,UAAU,EAAK;QAC9B,IAAI,GAA8B,UAAU,CAA5C,IAAI;0BAA8B,UAAU,CAAtC,GAAG;QAAE,aAAa,mCAAG,EAAE;;AACrC,QAAM,QAAQ,GAAG,sBAAS,gBAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;AACjD,QAAM,OAAO,gBACR,OAAO;AACV,cAAQ,EAAE,GAAG;OACV,mBAAmB,EACnB,aAAa,CACjB,CAAC;AACF,QAAM,IAAI,GAAG,QAAQ,CAAC;AACpB,WAAK,EAAE,aAAa;AACpB,SAAG,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;KAC7B,CAAC,CAAC;AACH,WAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC3B,WAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;GACnB,CAAC,CAAC;;AAEH,SAAO,CAAC,GAAG,+BACmB,WAAW,oBAAe,OAAO,6BAAwB,UAAU,OAChG,CAAC;AACF,SAAO,CAAC,GAAG,+BACmB,WAAW,oBAAe,OAAO,0BAAqB,UAAU,OAC7F,CAAC;AACF,SAAO,CAAC,GAAG,4BAA0B,WAAW,oBAAe,OAAO,iBAAc,CAAC;AACrF,SAAO,CAAC,GAAG,4BAA0B,WAAW,oBAAe,OAAO,cAAW,CAAC;AAClF,MAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;CACpB","file":"push_server.js","sourcesContent":["import { execSync } from 'child_process';\nimport fs from 'fs';\n\nimport { template } from 'lodash';\n\nimport { getBuildDir, getBuildDirDockerFile, passEnvFile } from '../../configs/directories';\nimport { getFullVersionString } from '../../utils/git_utils';\nimport { readConfig } from '../../utils/config_utils';\nimport { readPassYaml } from '../../utils/pass_utils';\n\nconst createDockerFile = ({ config, environment }) => {\n const dockerFile = getBuildDirDockerFile({ config, environment });\n fs.writeFileSync(\n dockerFile,\n `\nFROM node:4.8.4\nADD app.tar.gz /app\nRUN cd /app/bundle/programs/server && npm install\nWORKDIR /app/bundle\nEXPOSE 8888\nCMD [\"node\", \"main.js\"]\n `,\n );\n return dockerFile;\n};\n/* todo generate dockerfile and pipe in * */\n/*\nconst dockerFile = `\n FROM node:4.8.4\n ADD build/production/app.tar.gz /app\n RUN cd /app/bundle/programs/server && npm install\n WORKDIR /app/bundle\n EXPOSE 8888\n CMD [\"node\", \"main.js\"]\n` */\n\nconst exec = (cmd) => {\n console.log(cmd);\n execSync(cmd, { stdio: 'inherit' });\n};\nexport default (environment, done) => {\n const config = readConfig();\n const passPathForEnvVars = passEnvFile({ config, environment });\n const passEnv = readPassYaml(passPathForEnvVars);\n const { dockerEndPoint = 'gcr.io/skynet-164509', appname = 'unknown app' } = config;\n console.log('would do the following if implemented: ');\n console.log('(but you can do it manually! 😽 )');\n console.log(' ');\n\n const dockerFile = createDockerFile({ config, environment });\n console.log(dockerFile);\n const buildDir = getBuildDir({ environment, config });\n const dockerBuildCommand = `docker build -t ${appname} -f ${dockerFile} ${buildDir}`;\n\n // exec(dockerBuildCommand);\n\n const versionTag = getFullVersionString(environment);\n const fullImageName = `${dockerEndPoint}/${appname}:${versionTag}`;\n // exec(`docker tag ${appname} ${fullImageName}`);\n // exec(`gcloud docker -- push ${fullImageName}`);\n\n const {\n url,\n deployment: { env: commonDeploymentEnv, kubeDeployments = [] },\n } = config.environments[environment];\n\n kubeDeployments.forEach((deployment) => {\n const { file, env: deploymentEnv = {} } = deployment;\n const compiled = template(fs.readFileSync(file));\n const fullEnv = {\n ...passEnv,\n ROOT_URL: url,\n ...commonDeploymentEnv,\n ...deploymentEnv,\n };\n const yaml = compiled({\n image: fullImageName,\n env: JSON.stringify(fullEnv),\n });\n console.log('would apply');\n console.log(yaml);\n });\n\n console.log(\n `generate or adjust: kube/${environment}/deployment.${appname}_worker.yml (add tag ${versionTag})`,\n );\n console.log(\n `generate or adjust: kube/${environment}/deployment.${appname}_web.yml (add tag ${versionTag})`,\n );\n console.log(`kubectl apply -f kube/${environment}/deployment.${appname}_worker.yml`);\n console.log(`kubectl apply -f kube/${environment}/deployment.${appname}_web.yml`);\n done(null, 'done');\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/panter-meteor-kubernetes/restart.js b/dist/deployments/panter-meteor-kubernetes/restart.js deleted file mode 100644 index a7773dc..0000000 --- a/dist/deployments/panter-meteor-kubernetes/restart.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -exports['default'] = function (environment, done) { - done(null, 'restart on kubernetes is not needed'); -}; - -module.exports = exports['default']; -//# sourceMappingURL=restart.js.map \ No newline at end of file diff --git a/dist/deployments/panter-meteor-kubernetes/restart.js.map b/dist/deployments/panter-meteor-kubernetes/restart.js.map deleted file mode 100644 index 2422f4b..0000000 --- a/dist/deployments/panter-meteor-kubernetes/restart.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/deployments/panter-meteor-kubernetes/restart.js"],"names":[],"mappings":";;;;;;qBAEe,UAAC,WAAW,EAAE,IAAI,EAAK;AACpC,MAAI,CAAC,IAAI,EAAE,qCAAqC,CAAC,CAAC;CACnD","file":"restart.js","sourcesContent":["\n\nexport default (environment, done) => {\n done(null, 'restart on kubernetes is not needed');\n};\n"]} \ No newline at end of file diff --git a/dist/deployments/utils.js b/dist/deployments/utils.js deleted file mode 100644 index a5cf0ee..0000000 --- a/dist/deployments/utils.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _utilsConfig_utils = require('../utils/config_utils'); - -var _ = require('./'); - -var _2 = _interopRequireDefault(_); - -exports['default'] = getDeploymentCommand = function (environment, command) { - var config = (0, _utilsConfig_utils.readConfig)(); - var deployment = config[environment].deployment; - - var _ref = deployment || {}; - - var _ref$type = _ref.type; - var type = _ref$type === undefined ? 'panter-meteor-classic' : _ref$type; - - if (_2['default'][type]) { - if (_2['default'][type][command]) { - return _2['default'][type][command]; - } - throw new Error('Unkown deployment-command: ' + command + ' in type ' + type); - } else { - throw new Error('Unkown deployment-type: ' + type); - } -}; - -module.exports = exports['default']; -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/dist/deployments/utils.js.map b/dist/deployments/utils.js.map deleted file mode 100644 index 73e26d6..0000000 --- a/dist/deployments/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/deployments/utils.js"],"names":[],"mappings":";;;;;;;;iCAA2B,uBAAuB;;gBAC1B,IAAI;;;;qBAEb,oBAAoB,GAAG,UAAC,WAAW,EAAE,OAAO,EAAK;AAC9D,MAAM,MAAM,GAAG,oCAAY,CAAC;MACpB,UAAU,GAAK,MAAM,CAAC,WAAW,CAAC,CAAlC,UAAU;;aACyB,UAAU,IAAI,EAAE;;uBAAnD,IAAI;MAAJ,IAAI,6BAAG,uBAAuB;;AACtC,MAAI,cAAY,IAAI,CAAC,EAAE;AACrB,QAAI,cAAY,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE;AAC9B,aAAO,cAAY,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;KACnC;AACD,UAAM,IAAI,KAAK,iCAA+B,OAAO,iBAAY,IAAI,CAAG,CAAC;GAC1E,MAAM;AACL,UAAM,IAAI,KAAK,8BAA4B,IAAI,CAAG,CAAC;GACpD;CACF","file":"utils.js","sourcesContent":["import { readConfig } from '../utils/config_utils';\nimport deployments from './';\n\nexport default getDeploymentCommand = (environment, command) => {\n const config = readConfig();\n const { deployment } = config[environment];\n const { type = 'panter-meteor-classic' } = deployment || {};\n if (deployments[type]) {\n if (deployments[type][command]) {\n return deployments[type][command];\n }\n throw new Error(`Unkown deployment-command: ${command} in type ${type}`);\n } else {\n throw new Error(`Unkown deployment-type: ${type}`);\n }\n};\n"]} \ No newline at end of file diff --git a/dist/logs.js b/dist/logs.js deleted file mode 100644 index b4f2eb5..0000000 --- a/dist/logs.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _colorsSafe = require('colors/safe'); - -var _colorsSafe2 = _interopRequireDefault(_colorsSafe); - -var intro = function intro(line) { - return console.log(_colorsSafe2['default'].yellow(line)); -}; -exports.intro = intro; -var actionTitle = function actionTitle(title) { - intro(''); - intro('🐱 πŸ”§ ' + title); - intro(''); -}; -exports.actionTitle = actionTitle; -//# sourceMappingURL=logs.js.map \ No newline at end of file diff --git a/dist/logs.js.map b/dist/logs.js.map deleted file mode 100644 index 7610850..0000000 --- a/dist/logs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/logs.js"],"names":[],"mappings":";;;;;;;;0BAAmB,aAAa;;;;AAEzB,IAAM,KAAK,GAAG,SAAR,KAAK,CAAG,IAAI;SAAI,OAAO,CAAC,GAAG,CAAC,wBAAO,MAAM,CAAC,IAAI,CAAC,CAAC;CAAA,CAAC;;AACvD,IAAM,WAAW,GAAG,SAAd,WAAW,CAAI,KAAK,EAAK;AACpC,OAAK,CAAC,EAAE,CAAC,CAAC;AACV,OAAK,YAAU,KAAK,CAAG,CAAC;AACxB,OAAK,CAAC,EAAE,CAAC,CAAC;CACX,CAAC","file":"logs.js","sourcesContent":["import colors from 'colors/safe';\n\nexport const intro = line => console.log(colors.yellow(line));\nexport const actionTitle = (title) => {\n intro('');\n intro(`🐱 πŸ”§ ${title}`);\n intro('');\n};\n"]} \ No newline at end of file diff --git a/dist/pass_utils.js b/dist/pass_utils.js deleted file mode 100644 index bc84f6a..0000000 --- a/dist/pass_utils.js +++ /dev/null @@ -1,76 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _jsYaml = require('js-yaml'); - -var _jsYaml2 = _interopRequireDefault(_jsYaml); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _child_process = require('child_process'); - -var pullPass = function pullPass() { - return (0, _child_process.execSync)('pass git pull', { stdio: ['pipe', 1, 2] }); -}; -exports.pullPass = pullPass; -var pushPass = function pushPass() { - pullPass(); - (0, _child_process.execSync)('pass git push', { stdio: ['pipe', 1, 2] }); -}; - -exports.pushPass = pushPass; -var readPass = function readPass(passPath) { - try { - pullPass(); - return (0, _child_process.execSync)('pass show ' + passPath, { stdio: [0], encoding: 'utf-8' }); - } catch (error) { - if (error.message.indexOf('is not in the password store') !== -1) { - return null; - } - throw error; - } -}; - -exports.readPass = readPass; -var hasPass = function hasPass(passPath) { - return !_lodash2['default'].isEmpty(readPass(passPath)); -}; - -exports.hasPass = hasPass; -var generatePass = function generatePass(passPath) { - var length = arguments.length <= 1 || arguments[1] === undefined ? 32 : arguments[1]; - - // generate without symbols - (0, _child_process.execSync)('pass generate -n ' + passPath + ' ' + length); - pushPass(); - return readPass(passPath); -}; -exports.generatePass = generatePass; -var readPassYaml = function readPassYaml(passPath) { - return _jsYaml2['default'].safeLoad(readPass(passPath)); -}; - -exports.readPassYaml = readPassYaml; -var writePass = function writePass(passPath, input) { - console.log('writing to pass', passPath); - (0, _child_process.execSync)('pass insert ' + passPath + ' -m', { input: input, stdio: ['pipe', 1, 2] }); - pushPass(); -}; - -exports.writePass = writePass; -var editPass = function editPass(passPath) { - pullPass(); - (0, _child_process.spawnSync)('pass', ['edit', passPath], { - stdio: 'inherit' - }); - pushPass(); -}; -exports.editPass = editPass; -//# sourceMappingURL=pass_utils.js.map \ No newline at end of file diff --git a/dist/pass_utils.js.map b/dist/pass_utils.js.map deleted file mode 100644 index 401353a..0000000 --- a/dist/pass_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/pass_utils.js"],"names":[],"mappings":";;;;;;;;sBAAiB,SAAS;;;;sBAEZ,QAAQ;;;;6BACc,eAAe;;AAG5C,IAAM,QAAQ,GAAG,SAAX,QAAQ;SAAS,6BAAS,eAAe,EAAE,EA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iBAAiB,EAAE,QAAQ,CAAC,CAAC;AACzC,gDAAwB,QAAQ,UAAO,EAAE,KAAK,EAAL,KAAK,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;AACzE,UAAQ,EAAE,CAAC;CACZ,CAAC;;;AAEK,IAAM,QAAQ,GAAG,SAAX,QAAQ,CAAI,QAAQ,EAAK;AACpC,UAAQ,EAAE,CAAC;AACX,gCAAU,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE;AACpC,SAAK,EAAE,SAAS;GACjB,CAAC,CAAC;AACH,UAAQ,EAAE,CAAC;CACZ,CAAC","file":"pass_utils.js","sourcesContent":["import yaml from 'js-yaml';\n\nimport _ from 'lodash';\nimport { execSync, spawnSync } from 'child_process';\n\n\nexport const pullPass = () => execSync('pass git pull', { stdio: ['pipe', 1, 2] });\nexport const pushPass = () => {\n pullPass();\n execSync('pass git push', { stdio: ['pipe', 1, 2] });\n};\n\nexport const readPass = (passPath) => {\n try {\n pullPass();\n return execSync(`pass show ${passPath}`, { stdio: [0], encoding: 'utf-8' });\n } catch (error) {\n if (error.message.indexOf('is not in the password store') !== -1) {\n return null;\n }\n throw error;\n }\n};\n\nexport const hasPass = passPath => (\n !_.isEmpty(readPass(passPath))\n);\n\nexport const generatePass = (passPath, length = 32) => {\n // generate without symbols\n execSync(`pass generate -n ${passPath} ${length}`);\n pushPass();\n return readPass(passPath);\n};\nexport const readPassYaml = passPath => yaml.safeLoad(readPass(passPath));\n\nexport const writePass = (passPath, input) => {\n console.log('writing to pass', passPath);\n execSync(`pass insert ${passPath} -m`, { input, stdio: ['pipe', 1, 2] });\n pushPass();\n};\n\nexport const editPass = (passPath) => {\n pullPass();\n spawnSync('pass', ['edit', passPath], {\n stdio: 'inherit',\n });\n pushPass();\n};\n"]} \ No newline at end of file diff --git a/dist/prompt_schemas.js b/dist/prompt_schemas.js deleted file mode 100644 index 87feeef..0000000 --- a/dist/prompt_schemas.js +++ /dev/null @@ -1,124 +0,0 @@ -'use strict'; - -var _extends = require('babel-runtime/helpers/extends')['default']; - -var _objectWithoutProperties = require('babel-runtime/helpers/object-without-properties')['default']; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _prompt = require('prompt'); - -var _prompt2 = _interopRequireDefault(_prompt); - -var withDefaults = function withDefaults(schema) { - var defaults = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - return _extends({}, schema, { - properties: _lodash2['default'].mapValues(schema.properties, function (value, key) { - return _extends({}, value, { - 'default': function _default() { - return defaults[key] || _lodash2['default'].result(value, 'default'); - } - }); - }) - }); -}; - -var initSchema = function initSchema(config) { - return withDefaults({ - properties: { - customer: { - description: 'Customer kΓΌrzel', - required: true, - 'default': 'pan' - }, - appname: { - description: 'App name (for dbs, filenames, etc.)', - type: 'string', - required: true, - pattern: /^[a-zA-Z]+$/ - }, - passPath: { - description: 'Path in pass', - required: true, - 'default': function _default() { - return _prompt2['default'].history('customer').value + '/' + _prompt2['default'].history('appname').value; - } - }, - appDir: { - description: 'app directory', - type: 'string', - 'default': './app' - }, - buildDir: { - description: 'build directory', - type: 'string', - 'default': './build' - }, - androidBuildToolVersion: { - description: 'android build tool version', - type: 'string', - 'default': '25.0.2' - }, - useYarn: { - description: 'use yarn to build (false: use npm)', - type: 'boolean', - 'default': true - } - } - }, config); -}; - -exports.initSchema = initSchema; -var environmentSchema = function environmentSchema(_ref) { - var environment = _ref.environment; - var appname = _ref.appname; - - var config = _objectWithoutProperties(_ref, ['environment', 'appname']); - - return withDefaults({ - properties: { - host: { - description: 'ssh host', - type: 'string', - required: true, - 'default': appname + '-' + environment + '.panter.biz' - }, - user: { - description: 'ssh user', - 'default': 'app' - }, - url: { - description: 'full url', - 'default': function _default() { - return 'https://' + _prompt2['default'].history('host').value; - } - }, - androidKeystore: { - description: 'android keystore file', - type: 'string', - 'default': './android.keystore' - }, - androidKeyname: { - description: 'Android keystore name / alias', - 'default': appname + '-' + environment - }, - androidDName: { - description: 'android dname for key', - type: 'string', - 'default': function _default() { - return 'cn=Panter, ou=Panter, o=Panter, c=CH'; - } - } - } - }, _lodash2['default'].get(config, ['environments', environment])); -}; -exports.environmentSchema = environmentSchema; -//# sourceMappingURL=prompt_schemas.js.map \ No newline at end of file diff --git a/dist/prompt_schemas.js.map b/dist/prompt_schemas.js.map deleted file mode 100644 index b12d5a7..0000000 --- a/dist/prompt_schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/prompt_schemas.js"],"names":[],"mappings":";;;;;;;;;;;;sBAAc,QAAQ;;;;sBACH,QAAQ;;;;AAG3B,IAAM,YAAY,GAAG,SAAf,YAAY,CAAI,MAAM;MAAE,QAAQ,yDAAG,EAAE;sBACtC,MAAM;AACT,cAAU,EAAE,oBAAE,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,UAAC,KAAK,EAAE,GAAG;0BACjD,KAAK;AACR,mBAAS;iBAAM,QAAQ,CAAC,GAAG,CAAC,IAAI,oBAAE,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC;SAAA;;KAC1D,CAAC;;CACH,CAAC;;AAEI,IAAM,UAAU,GAAG,SAAb,UAAU,CAAG,MAAM;SAAI,YAAY,CAAC;AAC/C,cAAU,EAAE;AACV,cAAQ,EAAE;AACR,mBAAW,EAAE,iBAAiB;AAC9B,gBAAQ,EAAE,IAAI;AACd,mBAAS,KAAK;OACf;AACD,aAAO,EAAE;AACP,mBAAW,EAAE,qCAAqC;AAClD,YAAI,EAAE,QAAQ;AACd,gBAAQ,EAAE,IAAI;AACd,eAAO,EAAE,aAAa;OACvB;AACD,cAAQ,EAAE;AACR,mBAAW,EAAE,cAAc;AAC3B,gBAAQ,EAAE,IAAI;AACd,mBAAS;iBAAS,oBAAO,OAAO,CAAC,UAAU,CAAC,CAA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AAuB;AACpC,YAAI,EAAE,QAAQ;AACd,mBAAS;iBAAM,sCAAsC;SAAA;OACtD;KACF;GACF,EAAE,oBAAE,GAAG,CAAC,MAAM,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;CAAA,CAAC","file":"prompt_schemas.js","sourcesContent":["import _ from 'lodash';\nimport prompt from 'prompt';\n\n\nconst withDefaults = (schema, defaults = {}) => ({\n ...schema,\n properties: _.mapValues(schema.properties, (value, key) => ({\n ...value,\n default: () => defaults[key] || _.result(value, 'default'),\n })),\n});\n\nexport const initSchema = config => withDefaults({\n properties: {\n customer: {\n description: 'Customer kΓΌrzel',\n required: true,\n default: 'pan',\n },\n appname: {\n description: 'App name (for dbs, filenames, etc.)',\n type: 'string',\n required: true,\n pattern: /^[a-zA-Z]+$/,\n },\n passPath: {\n description: 'Path in pass',\n required: true,\n default: () => `${prompt.history('customer').value}/${prompt.history('appname').value}`,\n },\n appDir: {\n description: 'app directory',\n type: 'string',\n default: './app',\n },\n buildDir: {\n description: 'build directory',\n type: 'string',\n default: './build',\n },\n androidBuildToolVersion: {\n description: 'android build tool version',\n type: 'string',\n default: '25.0.2',\n },\n useYarn: {\n description: 'use yarn to build (false: use npm)',\n type: 'boolean',\n default: true,\n },\n },\n}, config);\n\nexport const environmentSchema = ({ environment, appname, ...config }) => withDefaults({\n properties: {\n host: {\n description: 'ssh host',\n type: 'string',\n required: true,\n default: `${appname}-${environment}.panter.biz`,\n },\n user: {\n description: 'ssh user',\n default: 'app',\n },\n url: {\n description: 'full url',\n default: () => `https://${prompt.history('host').value}`,\n },\n androidKeystore: {\n description: 'android keystore file',\n type: 'string',\n default: './android.keystore',\n },\n androidKeyname: {\n description: 'Android keystore name / alias',\n default: `${appname}-${environment}`,\n },\n androidDName: {\n description: 'android dname for key',\n type: 'string',\n default: () => 'cn=Panter, ou=Panter, o=Panter, c=CH',\n },\n },\n}, _.get(config, ['environments', environment]));\n"]} \ No newline at end of file diff --git a/dist/ui/action_title.js b/dist/ui/action_title.js deleted file mode 100644 index 2df3abb..0000000 --- a/dist/ui/action_title.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _print_yellow = require('./print_yellow'); - -var _print_yellow2 = _interopRequireDefault(_print_yellow); - -exports['default'] = function (title) { - (0, _print_yellow2['default'])(''); - (0, _print_yellow2['default'])(' 🐱 πŸ”§ ' + title); - (0, _print_yellow2['default'])(''); -}; - -module.exports = exports['default']; -//# sourceMappingURL=action_title.js.map \ No newline at end of file diff --git a/dist/ui/action_title.js.map b/dist/ui/action_title.js.map deleted file mode 100644 index 1cb8e36..0000000 --- a/dist/ui/action_title.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/ui/action_title.js"],"names":[],"mappings":";;;;;;;;4BAAwB,gBAAgB;;;;qBAEzB,UAAC,KAAK,EAAK;AACxB,iCAAY,EAAE,CAAC,CAAC;AAChB,8CAAuB,KAAK,CAAG,CAAC;AAChC,iCAAY,EAAE,CAAC,CAAC;CACjB","file":"action_title.js","sourcesContent":["import printYellow from './print_yellow';\n\nexport default (title) => {\n printYellow('');\n printYellow(` 🐱 πŸ”§ ${title}`);\n printYellow('');\n};\n"]} \ No newline at end of file diff --git a/dist/ui/done_error.js b/dist/ui/done_error.js deleted file mode 100644 index 9bc99e1..0000000 --- a/dist/ui/done_error.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _print_error = require('./print_error'); - -var _print_error2 = _interopRequireDefault(_print_error); - -exports['default'] = function (error, message) { - (0, _print_error2['default'])(''); - (0, _print_error2['default'])(''); - (0, _print_error2['default'])('β•— πŸ™€ ' + message + ' 😿'); - (0, _print_error2['default'])('β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•'); - (0, _print_error2['default'])('😾 🐁 🐁 🐁 🐁 🐁 🐁'); - console.log('' + (error ? error.message || error.reason : '')); - (0, _print_error2['default'])(''); - console.log(error ? error.stack : ''); - (0, _print_error2['default'])('════════════════════════════════════════════════════════════════════════════════'); -}; - -module.exports = exports['default']; -//# sourceMappingURL=done_error.js.map \ No newline at end of file diff --git a/dist/ui/done_error.js.map b/dist/ui/done_error.js.map deleted file mode 100644 index a29dd4c..0000000 --- a/dist/ui/done_error.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/ui/done_error.js"],"names":[],"mappings":";;;;;;;;2BAAuB,eAAe;;;;qBAEvB,UAAC,KAAK,EAAE,OAAO,EAAK;AACjC,gCAAW,EAAE,CAAC,CAAC;AACf,gCAAW,EAAE,CAAC,CAAC;AACf,2CAAoB,OAAO,UAAO,CAAC;AACnC,gCAAW,kFAAkF,CAAC,CAAC;AAC/F,gCAAW,8BAA8B,CAAC,CAAC;AAC3C,SAAO,CAAC,GAAG,OAAI,KAAK,GAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,GAAI,EAAE,CAAA,CAAG,CAAC;AAC/D,gCAAW,EAAE,CAAC,CAAC;AACf,SAAO,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;AACtC,gCAAW,kFAAkF,CAAC,CAAC;CAChG","file":"done_error.js","sourcesContent":["import printError from './print_error';\n\nexport default (error, message) => {\n printError('');\n printError('');\n printError(`β•— πŸ™€ ${message} 😿`);\n printError('β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•');\n printError('😾 🐁 🐁 🐁 🐁 🐁 🐁');\n console.log(`${error ? (error.message || error.reason) : ''}`);\n printError('');\n console.log(error ? error.stack : '');\n printError('════════════════════════════════════════════════════════════════════════════════');\n};\n"]} \ No newline at end of file diff --git a/dist/ui/done_success.js b/dist/ui/done_success.js deleted file mode 100644 index 2c6439d..0000000 --- a/dist/ui/done_success.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _print_yellow = require('./print_yellow'); - -var _print_yellow2 = _interopRequireDefault(_print_yellow); - -exports['default'] = function () { - var message = arguments.length <= 0 || arguments[0] === undefined ? '' : arguments[0]; - - (0, _print_yellow2['default'])(''); - (0, _print_yellow2['default'])(''); - (0, _print_yellow2['default'])('β•—'); - (0, _print_yellow2['default'])('β•šβ•β•— ' + message + ' πŸ‘‹ 🐱'); - (0, _print_yellow2['default'])(' β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•'); -}; - -module.exports = exports['default']; -//# sourceMappingURL=done_success.js.map \ No newline at end of file diff --git a/dist/ui/done_success.js.map b/dist/ui/done_success.js.map deleted file mode 100644 index 22e1386..0000000 --- a/dist/ui/done_success.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/ui/done_success.js"],"names":[],"mappings":";;;;;;;;4BAAwB,gBAAgB;;;;qBAEzB,YAAkB;MAAjB,OAAO,yDAAG,EAAE;;AAC1B,iCAAY,EAAE,CAAC,CAAC;AAChB,iCAAY,EAAE,CAAC,CAAC;AAChB,iCAAY,GAAG,CAAC,CAAC;AACjB,0CAAmB,OAAO,aAAU,CAAC;AACrC,iCAAY,kFAAkF,CAAC,CAAC;CACjG","file":"done_success.js","sourcesContent":["import printYellow from './print_yellow';\n\nexport default (message = '') => {\n printYellow('');\n printYellow('');\n printYellow('β•—');\n printYellow(`β•šβ•β•— ${message} πŸ‘‹ 🐱`);\n printYellow(' β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•');\n};\n"]} \ No newline at end of file diff --git a/dist/ui/intro.js b/dist/ui/intro.js deleted file mode 100644 index 74d2f2b..0000000 --- a/dist/ui/intro.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _packageJson = require('../../package.json'); - -var _print_yellow = require('./print_yellow'); - -var _print_yellow2 = _interopRequireDefault(_print_yellow); - -exports['default'] = function () { - (0, _print_yellow2['default'])(''); - (0, _print_yellow2['default'])(' 🐱 πŸ”§'); - (0, _print_yellow2['default'])(' ╔═════ PANTER CATLADDER ════════'); - (0, _print_yellow2['default'])(' ╔═╝'); - (0, _print_yellow2['default'])(' ╔═╝ v' + _packageJson.version); - (0, _print_yellow2['default'])(' ╔═╝'); - (0, _print_yellow2['default'])(' ╔═╝'); - (0, _print_yellow2['default'])('═╝'); - (0, _print_yellow2['default'])(''); -}; - -module.exports = exports['default']; -//# sourceMappingURL=intro.js.map \ No newline at end of file diff --git a/dist/ui/intro.js.map b/dist/ui/intro.js.map deleted file mode 100644 index bed0b4a..0000000 --- a/dist/ui/intro.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/ui/intro.js"],"names":[],"mappings":";;;;;;;;2BAAwB,oBAAoB;;4BACpB,gBAAgB;;;;qBAEzB,YAAM;AACnB,iCAAY,EAAE,CAAC,CAAC;AAChB,iCAAY,0CAA0C,CAAC,CAAC;AACxD,iCAAY,2CAA2C,CAAC,CAAC;AACzD,iCAAY,YAAY,CAAC,CAAC;AAC1B,+EAA6C,CAAC;AAC9C,iCAAY,QAAQ,CAAC,CAAC;AACtB,iCAAY,MAAM,CAAC,CAAC;AACpB,iCAAY,IAAI,CAAC,CAAC;AAClB,iCAAY,EAAE,CAAC,CAAC;CACjB","file":"intro.js","sourcesContent":["import { version } from '../../package.json';\nimport printYellow from './print_yellow';\n\nexport default () => {\n printYellow('');\n printYellow(' 🐱 πŸ”§');\n printYellow(' ╔═════ PANTER CATLADDER ════════');\n printYellow(' ╔═╝');\n printYellow(` ╔═╝ v${version}`);\n printYellow(' ╔═╝');\n printYellow(' ╔═╝');\n printYellow('═╝');\n printYellow('');\n};\n"]} \ No newline at end of file diff --git a/dist/ui/print_command.js b/dist/ui/print_command.js deleted file mode 100644 index 170d6cf..0000000 --- a/dist/ui/print_command.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _colorsSafe = require('colors/safe'); - -var _colorsSafe2 = _interopRequireDefault(_colorsSafe); - -exports['default'] = function (line) { - console.log(); - console.log(_colorsSafe2['default'].green('$ ' + line)); -}; - -module.exports = exports['default']; -//# sourceMappingURL=print_command.js.map \ No newline at end of file diff --git a/dist/ui/print_command.js.map b/dist/ui/print_command.js.map deleted file mode 100644 index 4ce4780..0000000 --- a/dist/ui/print_command.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/ui/print_command.js"],"names":[],"mappings":";;;;;;;;0BAAmB,aAAa;;;;qBAEjB,UAAC,IAAI,EAAK;AACvB,SAAO,CAAC,GAAG,EAAE,CAAC;AACd,SAAO,CAAC,GAAG,CAAC,wBAAO,KAAK,QAAM,IAAI,CAAG,CAAC,CAAC;CACxC","file":"print_command.js","sourcesContent":["import colors from 'colors/safe';\n\nexport default (line) => {\n console.log();\n console.log(colors.green(`$ ${line}`));\n};\n"]} \ No newline at end of file diff --git a/dist/ui/print_error.js b/dist/ui/print_error.js deleted file mode 100644 index e368e9d..0000000 --- a/dist/ui/print_error.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _colorsSafe = require('colors/safe'); - -var _colorsSafe2 = _interopRequireDefault(_colorsSafe); - -exports['default'] = function (line) { - return console.log(_colorsSafe2['default'].red.bold(line)); -}; - -module.exports = exports['default']; -//# sourceMappingURL=print_error.js.map \ No newline at end of file diff --git a/dist/ui/print_error.js.map b/dist/ui/print_error.js.map deleted file mode 100644 index f9d6f66..0000000 --- a/dist/ui/print_error.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/ui/print_error.js"],"names":[],"mappings":";;;;;;;;0BAAmB,aAAa;;;;qBAEjB,UAAA,IAAI;SAAI,OAAO,CAAC,GAAG,CAAC,wBAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;CAAA","file":"print_error.js","sourcesContent":["import colors from 'colors/safe';\n\nexport default line => console.log(colors.red.bold(line));\n"]} \ No newline at end of file diff --git a/dist/ui/print_intro.js b/dist/ui/print_intro.js deleted file mode 100644 index 0fb1b50..0000000 --- a/dist/ui/print_intro.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _colorsSafe = require('colors/safe'); - -var _colorsSafe2 = _interopRequireDefault(_colorsSafe); - -exports['default'] = function (line) { - return console.log(_colorsSafe2['default'].yellow(line)); -}; - -module.exports = exports['default']; -//# sourceMappingURL=print_intro.js.map \ No newline at end of file diff --git a/dist/ui/print_intro.js.map b/dist/ui/print_intro.js.map deleted file mode 100644 index f88d041..0000000 --- a/dist/ui/print_intro.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/ui/print_intro.js"],"names":[],"mappings":";;;;;;;;0BAAmB,aAAa;;;;qBAEjB,UAAA,IAAI;SAAI,OAAO,CAAC,GAAG,CAAC,wBAAO,MAAM,CAAC,IAAI,CAAC,CAAC;CAAA","file":"print_intro.js","sourcesContent":["import colors from 'colors/safe';\n\nexport default line => console.log(colors.yellow(line));\n"]} \ No newline at end of file diff --git a/dist/ui/print_intro_style.js b/dist/ui/print_intro_style.js deleted file mode 100644 index c0c7c3d..0000000 --- a/dist/ui/print_intro_style.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports["default"] = function (line) { - return console.log(colors.yellow(line)); -}; - -module.exports = exports["default"]; -//# sourceMappingURL=print_intro_style.js.map \ No newline at end of file diff --git a/dist/ui/print_intro_style.js.map b/dist/ui/print_intro_style.js.map deleted file mode 100644 index 199cfbe..0000000 --- a/dist/ui/print_intro_style.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/ui/print_intro_style.js"],"names":[],"mappings":";;;;;;qBAAe,UAAA,IAAI;SAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAAA","file":"print_intro_style.js","sourcesContent":["export default line => console.log(colors.yellow(line));\n"]} \ No newline at end of file diff --git a/dist/ui/print_yellow.js b/dist/ui/print_yellow.js deleted file mode 100644 index b97b5a7..0000000 --- a/dist/ui/print_yellow.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _colorsSafe = require('colors/safe'); - -var _colorsSafe2 = _interopRequireDefault(_colorsSafe); - -exports['default'] = function (line) { - return console.log(_colorsSafe2['default'].yellow(line)); -}; - -module.exports = exports['default']; -//# sourceMappingURL=print_yellow.js.map \ No newline at end of file diff --git a/dist/ui/print_yellow.js.map b/dist/ui/print_yellow.js.map deleted file mode 100644 index d7b29df..0000000 --- a/dist/ui/print_yellow.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/ui/print_yellow.js"],"names":[],"mappings":";;;;;;;;0BAAmB,aAAa;;;;qBAEjB,UAAA,IAAI;SAAI,OAAO,CAAC,GAAG,CAAC,wBAAO,MAAM,CAAC,IAAI,CAAC,CAAC;CAAA","file":"print_yellow.js","sourcesContent":["import colors from 'colors/safe';\n\nexport default line => console.log(colors.yellow(line));\n"]} \ No newline at end of file diff --git a/dist/ui/print_yellow0.js b/dist/ui/print_yellow0.js deleted file mode 100644 index 3244986..0000000 --- a/dist/ui/print_yellow0.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _colorsSafe = require('colors/safe'); - -var _colorsSafe2 = _interopRequireDefault(_colorsSafe); - -exports['default'] = function (line) { - return console.log(_colorsSafe2['default'].yellow(line)); -}; - -module.exports = exports['default']; -//# sourceMappingURL=print_yellow0.js.map \ No newline at end of file diff --git a/dist/ui/print_yellow0.js.map b/dist/ui/print_yellow0.js.map deleted file mode 100644 index 0cb544a..0000000 --- a/dist/ui/print_yellow0.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/ui/print_yellow0.js"],"names":[],"mappings":";;;;;;;;0BAAmB,aAAa;;;;qBAEjB,UAAA,IAAI;SAAI,OAAO,CAAC,GAAG,CAAC,wBAAO,MAAM,CAAC,IAAI,CAAC,CAAC;CAAA","file":"print_yellow0.js","sourcesContent":["import colors from 'colors/safe';\n\nexport default line => console.log(colors.yellow(line));\n"]} \ No newline at end of file diff --git a/dist/update_notifier.js b/dist/update_notifier.js deleted file mode 100644 index 622b27b..0000000 --- a/dist/update_notifier.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -var _updateNotifier = require('update-notifier'); - -var _updateNotifier2 = _interopRequireDefault(_updateNotifier); - -var _packageJson = require('../package.json'); - -var _packageJson2 = _interopRequireDefault(_packageJson); - -(0, _updateNotifier2['default'])({ pkg: _packageJson2['default'] }).notify(); -//# sourceMappingURL=update_notifier.js.map \ No newline at end of file diff --git a/dist/update_notifier.js.map b/dist/update_notifier.js.map deleted file mode 100644 index 018324a..0000000 --- a/dist/update_notifier.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/update_notifier.js"],"names":[],"mappings":";;;;8BAA2B,iBAAiB;;;;2BAC5B,iBAAiB;;;;AAEjC,iCAAe,EAAE,GAAG,0BAAA,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC","file":"update_notifier.js","sourcesContent":["import updateNotifier from 'update-notifier';\nimport pkg from '../package.json';\n\nupdateNotifier({ pkg }).notify();\n"]} \ No newline at end of file diff --git a/dist/utils/config_utils.js b/dist/utils/config_utils.js deleted file mode 100644 index bdd4998..0000000 --- a/dist/utils/config_utils.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _fs = require('fs'); - -var _fs2 = _interopRequireDefault(_fs); - -var _jsYaml = require('js-yaml'); - -var _jsYaml2 = _interopRequireDefault(_jsYaml); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var CONFIGFILE = '.catladder.yaml'; - -var writeConfig = function writeConfig(configFile, config) { - var theyaml = _jsYaml2['default'].safeDump(config); - _fs2['default'].writeFileSync(configFile, theyaml); -}; -exports.writeConfig = writeConfig; -var readConfig = function readConfig() { - return _jsYaml2['default'].safeLoad(_fs2['default'].readFileSync(CONFIGFILE)); -}; - -exports.readConfig = readConfig; -var getSshConfig = function getSshConfig(configFile, environment) { - var config = readConfig(); - return _lodash2['default'].pick(config.environments[environment], ['host', 'user', 'password', 'key']); -}; - -exports.getSshConfig = getSshConfig; -var getSanitziedValue = function getSanitziedValue(value) { - if (_lodash2['default'].isObject(value)) { - return JSON.stringify(value); - } - return value; -}; - -var getKeyValueArraySanitized = function getKeyValueArraySanitized(envVars) { - return _lodash2['default'].keys(envVars).map(function (key) { - return { - key: key, - value: getSanitziedValue(envVars[key]) - }; - }); -}; - -var getEnvCommandString = function getEnvCommandString(envVars) { - return getKeyValueArraySanitized(envVars).map(function (_ref) { - var key = _ref.key; - var value = _ref.value; - return key + '=\'' + value + '\''; - }).join(' '); -}; -exports.getEnvCommandString = getEnvCommandString; -var createEnvSh = function createEnvSh(_ref2, envVars) { - var environment = _ref2.environment; - var version = _ref2.version; - - // build is excluded, that is only used while building - var body = getKeyValueArraySanitized(_lodash2['default'].omit(envVars, ['build'])).map(function (_ref3) { - var key = _ref3.key; - var value = _ref3.value; - return 'export ' + key + '=\'' + value + '\''; - }).join('\n'); - var envHeader = '\n# autocreated with PANTER CATLADDER 🐱 πŸ”§ v' + version + '\n# environment: ' + environment + '\n#\n# DO NOT EDIT, use\n# $ catladder setup ' + environment + '\n# to edit\n#\n '; - return envHeader + '\n' + body; -}; -exports.createEnvSh = createEnvSh; -//# sourceMappingURL=config_utils.js.map \ No newline at end of file diff --git a/dist/utils/config_utils.js.map b/dist/utils/config_utils.js.map deleted file mode 100644 index 4a3c533..0000000 --- a/dist/utils/config_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/utils/config_utils.js"],"names":[],"mappings":";;;;;;;;kBAAe,IAAI;;;;sBACF,SAAS;;;;sBAEZ,QAAQ;;;;AAEtB,IAAM,UAAU,GAAG,iBAAiB,CAAC;;AAE9B,IAAM,WAAW,GAAG,SAAd,WAAW,CA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AAC,GAAG,CAAC;CAAA,CAAC;;AACR,IAAM,WAAW,GAAG,SAAd,WAAW,CAAI,KAAwB,EAAE,OAAO,EAAK;MAApC,WAAW,GAAb,KAAwB,CAAtB,WAAW;MAAE,OAAO,GAAtB,KAAwB,CAAT,OAAO;;;AAEhD,MAAM,IAAI,GAAG,yBAAyB,CAAC,oBAAE,IAAI,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAC/D,GAAG,CAAC,UAAC,KAAc;QAAZ,GAAG,GAAL,KAAc,CAAZ,GAAG;QAAE,KAAK,GAAZ,KAAc,CAAP,KAAK;uBAAiB,GAAG,WAAK,KAAK;GAAG,CAAC,CACnD,IAAI,CAAC,IAAI,CAAC,CAAC;AACd,MAAM,SAAS,qDAC4B,OAAO,yBACnC,WAAW,qDAGN,WAAW,uBAG9B,CAAC;AACF,SAAU,SAAS,UAAK,IAAI,CAAG;CAChC,CAAC","file":"config_utils.js","sourcesContent":["import fs from 'fs';\nimport yaml from 'js-yaml';\n\nimport _ from 'lodash';\n\nconst CONFIGFILE = '.catladder.yaml';\n\nexport const writeConfig = (configFile, config) => {\n const theyaml = yaml.safeDump(config);\n fs.writeFileSync(configFile, theyaml);\n};\nexport const readConfig = () => yaml.safeLoad(fs.readFileSync(CONFIGFILE));\n\nexport const getSshConfig = (configFile, environment) => {\n const config = readConfig();\n return _.pick(config.environments[environment], ['host', 'user', 'password', 'key']);\n};\n\nconst getSanitziedValue = (value) => {\n if (_.isObject(value)) {\n return JSON.stringify(value);\n }\n return value;\n};\n\nconst getKeyValueArraySanitized = envVars =>\n _.keys(envVars).map(key => ({\n key,\n value: getSanitziedValue(envVars[key]),\n }));\n\nexport const getEnvCommandString = envVars =>\n getKeyValueArraySanitized(envVars)\n .map(({ key, value }) => `${key}='${value}'`)\n .join(' ');\nexport const createEnvSh = ({ environment, version }, envVars) => {\n // build is excluded, that is only used while building\n const body = getKeyValueArraySanitized(_.omit(envVars, ['build']))\n .map(({ key, value }) => `export ${key}='${value}'`)\n .join('\\n');\n const envHeader = `\n# autocreated with PANTER CATLADDER 🐱 πŸ”§ v${version}\n# environment: ${environment}\n#\n# DO NOT EDIT, use\n# $ catladder setup ${environment}\n# to edit\n#\n `;\n return `${envHeader}\\n${body}`;\n};\n"]} \ No newline at end of file diff --git a/dist/utils/exec.js b/dist/utils/exec.js deleted file mode 100644 index 2258f37..0000000 --- a/dist/utils/exec.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -var _extends = require('babel-runtime/helpers/extends')['default']; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _child_process = require('child_process'); - -var _uiPrint_command = require('../ui/print_command'); - -var _uiPrint_command2 = _interopRequireDefault(_uiPrint_command); - -exports['default'] = function (cmd) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - - (0, _uiPrint_command2['default'])(cmd); - return (0, _child_process.execSync)(cmd, _extends({ stdio: 'inherit' }, options)); -}; - -module.exports = exports['default']; -//# sourceMappingURL=exec.js.map \ No newline at end of file diff --git a/dist/utils/exec.js.map b/dist/utils/exec.js.map deleted file mode 100644 index 4e75f76..0000000 --- a/dist/utils/exec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/utils/exec.js"],"names":[],"mappings":";;;;;;;;;;6BAAyB,eAAe;;+BAEf,qBAAqB;;;;qBAE/B,UAAC,GAAG,EAAmB;MAAjB,OAAO,yDAAG,EAAE;;AAC/B,oCAAa,GAAG,CAAC,CAAC;AAClB,SAAO,6BAAS,GAAG,aAAI,KAAK,EAAE,SAAS,IAAK,OAAO,EAAG,CAAC;CACxD","file":"exec.js","sourcesContent":["import { execSync } from 'child_process';\n\nimport printCommand from '../ui/print_command';\n\nexport default (cmd, options = {}) => {\n printCommand(cmd);\n return execSync(cmd, { stdio: 'inherit', ...options });\n};\n"]} \ No newline at end of file diff --git a/dist/utils/git_utils.js b/dist/utils/git_utils.js deleted file mode 100644 index f71065c..0000000 --- a/dist/utils/git_utils.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _child_process = require('child_process'); - -// we always multiply by 10 so that you can manipulate it a bit -var getBuildNumberFromGit = function getBuildNumberFromGit() { - var factor = arguments.length <= 0 || arguments[0] === undefined ? 10 : arguments[0]; - return Number((0, _child_process.execSync)('git rev-list --count HEAD')) * factor; -}; - -exports.getBuildNumberFromGit = getBuildNumberFromGit; -var getTagFromGit = function getTagFromGit() { - return _lodash2['default'].trim((0, _child_process.execSync)('git describe --tags --abbrev=0')); -}; - -exports.getTagFromGit = getTagFromGit; -var sanitizeVersionString = function sanitizeVersionString(versionString) { - return versionString.replace('v', ''); -}; - -exports.sanitizeVersionString = sanitizeVersionString; -var getVersionFromTag = function getVersionFromTag() { - var parts = getTagFromGit().split('/'); - if (parts.length === 1) { - return sanitizeVersionString(parts[0]); - } - return sanitizeVersionString(parts[parts.length - 1]); -}; - -exports.getVersionFromTag = getVersionFromTag; -var getFullGitVersion = function getFullGitVersion() { - return getVersionFromTag() + '-' + getBuildNumberFromGit(); -}; - -exports.getFullGitVersion = getFullGitVersion; -var getFullVersionString = function getFullVersionString(env) { - return env + '-' + getFullGitVersion(); -}; -exports.getFullVersionString = getFullVersionString; -//# sourceMappingURL=git_utils.js.map \ No newline at end of file diff --git a/dist/utils/git_utils.js.map b/dist/utils/git_utils.js.map deleted file mode 100644 index 395ce5a..0000000 --- a/dist/utils/git_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/utils/git_utils.js"],"names":[],"mappings":";;;;;;;;sBAAc,QAAQ;;;;6BACG,eAAe;;;AAGjC,IAAM,qBAAqB,GAAG,SAAxB,qBAAqB;MAAI,MAAM,yDAAG,EAAE;SAC/C,MAAM,CAAC,6BAAS,2BAA2B,CAAC,CAAC,GAAG,MAAM;CACvD,CAAC;;;AAEK,IAAM,aAAa,GAAG,SAAhB,aAAa;SACxB,oBAAE,IAAI,CAAC,6BAAS,gCAAgC,CAAC,CAAC;CACnD,CAAC;;;AAEK,IAAM,qBAAqB,GAAG,SAAxB,qBAAqB,CAAG,aAAa;SAChD,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;CAC/B,CAAC;;;AAEK,IAAM,iBAAiB,GAAG,SAApB,iBAAiB,GAAS;AACrC,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACzC,MAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AACtB,WAAO,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;GACxC;AACD,SAAO,qBAAqB,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;CACvD,CAAC;;;AAEK,IAAM,iBAAiB,GAAG,SAApB,iBAAiB;SAAY,iBAAiB,EAAE,SAAI,qBAAqB,EAAE;CAAE,CAAC;;;AAEpF,IAAM,oBAAoB,GAAG,SAAvB,oBAAoB,CAAG,GAAG;SAAO,GAAG,SAAI,iBAAiB,EAAE;CAAE,CAAC","file":"git_utils.js","sourcesContent":["import _ from 'lodash';\nimport { execSync } from 'child_process';\n\n// we always multiply by 10 so that you can manipulate it a bit\nexport const getBuildNumberFromGit = (factor = 10) => (\n Number(execSync('git rev-list --count HEAD')) * factor\n);\n\nexport const getTagFromGit = () => (\n _.trim(execSync('git describe --tags --abbrev=0'))\n);\n\nexport const sanitizeVersionString = versionString => (\n versionString.replace('v', '')\n);\n\nexport const getVersionFromTag = () => {\n const parts = getTagFromGit().split('/');\n if (parts.length === 1) {\n return sanitizeVersionString(parts[0]);\n }\n return sanitizeVersionString(parts[parts.length - 1]);\n};\n\nexport const getFullGitVersion = () => `${getVersionFromTag()}-${getBuildNumberFromGit()}`;\n\nexport const getFullVersionString = env => `${env}-${getFullGitVersion()}`;\n"]} \ No newline at end of file diff --git a/dist/utils/pass_utils.js b/dist/utils/pass_utils.js deleted file mode 100644 index 0868824..0000000 --- a/dist/utils/pass_utils.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default']; - -Object.defineProperty(exports, '__esModule', { - value: true -}); - -var _child_process = require('child_process'); - -var _lodash = require('lodash'); - -var _lodash2 = _interopRequireDefault(_lodash); - -var _jsYaml = require('js-yaml'); - -var _jsYaml2 = _interopRequireDefault(_jsYaml); - -var _configsDirectories = require('../configs/directories'); - -var _config_utils = require('./config_utils'); - -var _exec = require('./exec'); - -var _exec2 = _interopRequireDefault(_exec); - -var pullPass = function pullPass() { - return (0, _exec2['default'])('pass git pull', { stdio: ['pipe', 1, 2] }); -}; -exports.pullPass = pullPass; -var pushPass = function pushPass() { - pullPass(); - (0, _exec2['default'])('pass git push', { stdio: ['pipe', 1, 2] }); -}; - -exports.pushPass = pushPass; -var readPass = function readPass(passPath) { - try { - pullPass(); - return (0, _exec2['default'])('pass show ' + passPath, { stdio: [0], encoding: 'utf-8' }); - } catch (error) { - if (error.message.indexOf('is not in the password store') !== -1) { - return null; - } - throw error; - } -}; - -exports.readPass = readPass; -var hasPass = function hasPass(passPath) { - return !_lodash2['default'].isEmpty(readPass(passPath)); -}; - -exports.hasPass = hasPass; -var generatePass = function generatePass(passPath) { - var length = arguments.length <= 1 || arguments[1] === undefined ? 32 : arguments[1]; - - // generate without symbols - (0, _exec2['default'])('pass generate -n ' + passPath + ' ' + length); - pushPass(); - return readPass(passPath); -}; -exports.generatePass = generatePass; -var readPassYaml = function readPassYaml(passPath) { - return _jsYaml2['default'].safeLoad(readPass(passPath)); -}; - -exports.readPassYaml = readPassYaml; -var writePass = function writePass(passPath, input) { - console.log('writing to pass', passPath); - (0, _exec2['default'])('pass insert ' + passPath + ' -m', { input: input, stdio: ['pipe', 1, 2] }); - pushPass(); -}; - -exports.writePass = writePass; -var editPass = function editPass(passPath) { - pullPass(); - (0, _child_process.spawnSync)('pass', ['edit', passPath], { - stdio: 'inherit' - }); - pushPass(); -}; - -exports.editPass = editPass; -// high level - -var readEnvFileFromPass = function readEnvFileFromPass(environment) { - var config = (0, _config_utils.readConfig)(); - var passPathForEnvVars = (0, _configsDirectories.passEnvFile)({ config: config, environment: environment }); - return readPassYaml(passPathForEnvVars); -}; -exports.readEnvFileFromPass = readEnvFileFromPass; -//# sourceMappingURL=pass_utils.js.map \ No newline at end of file diff --git a/dist/utils/pass_utils.js.map b/dist/utils/pass_utils.js.map deleted file mode 100644 index fa3520f..0000000 --- a/dist/utils/pass_utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/utils/pass_utils.js"],"names":[],"mappings":";;;;;;;;6BAA0B,eAAe;;sBAE3B,QAAQ;;;;sBACL,SAAS;;;;kCAEE,wBAAwB;;4BACzB,gBAAgB;;oBAC1B,QAAQ;;;;AAElB,IAAM,QAAQ,GAAG,SAAX,QAAQ;SAAS,uBAAK,eAAe,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;CAAA,CAAC;;AACxE,IAAM,QAAQ,GAAG,SAAX,QAAQ,GAAS;AAC5B,UAAQ,EAAE,CAAC;AACX,yBAAK,eAAe,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;CAClD,CAAC;;;AAEK,IAAM,QAAQ,GAAG,SAAX,QAAQ,CAAI,QAAQ,EAAK;AACpC,MAAI;AACF,YAAQ,EAAE,CAAC;AACX,WAAO,sCAAkB,QAAQ,EAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;GACzE,CAAC,OAAO,KAAK,EAAE;AAC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AG,+BAAY,CAAC;AAC5B,MAAM,kBAAkB,GAAG,qCAAY,EAAE,MAAM,EAAN,MAAM,EAAE,WAAW,EAAX,WAAW,EAAE,CAAC,CAAC;AAChE,SAAO,YAAY,CAAC,kBAAkB,CAAC,CAAC;CACzC,CAAC","file":"pass_utils.js","sourcesContent":["import { spawnSync } from 'child_process';\n\nimport _ from 'lodash';\nimport yaml from 'js-yaml';\n\nimport { passEnvFile } from '../configs/directories';\nimport { readConfig } from './config_utils';\nimport exec from './exec';\n\nexport const pullPass = () => exec('pass git pull', { stdio: ['pipe', 1, 2] });\nexport const pushPass = () => {\n pullPass();\n exec('pass git push', { stdio: ['pipe', 1, 2] });\n};\n\nexport const readPass = (passPath) => {\n try {\n pullPass();\n return exec(`pass show ${passPath}`, { stdio: [0], encoding: 'utf-8' });\n } catch (error) {\n if (error.message.indexOf('is not in the password store') !== -1) {\n return null;\n }\n throw error;\n }\n};\n\nexport const hasPass = passPath => !_.isEmpty(readPass(passPath));\n\nexport const generatePass = (passPath, length = 32) => {\n // generate without symbols\n exec(`pass generate -n ${passPath} ${length}`);\n pushPass();\n return readPass(passPath);\n};\nexport const readPassYaml = passPath => yaml.safeLoad(readPass(passPath));\n\nexport const writePass = (passPath, input) => {\n console.log('writing to pass', passPath);\n exec(`pass insert ${passPath} -m`, { input, stdio: ['pipe', 1, 2] });\n pushPass();\n};\n\nexport const editPass = (passPath) => {\n pullPass();\n spawnSync('pass', ['edit', passPath], {\n stdio: 'inherit',\n });\n pushPass();\n};\n\n// high level\n\nexport const readEnvFileFromPass = (environment) => {\n const config = readConfig();\n const passPathForEnvVars = passEnvFile({ config, environment });\n return readPassYaml(passPathForEnvVars);\n};\n"]} \ No newline at end of file