UNPKG

@vroomlabs/gsdk-deploy

Version:

Google Cloud deployment script for kubernetes clusters using Global Load Balancer

55 lines (46 loc) 3.1 kB
'use strict'; /****************************************************************************** * MIT License * Copyright (c) 2017 https://github.com/vroomlabs * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Created by vroomlabs on 7/2/17. ******************************************************************************/ var _appState=require('./appState');function _asyncToGenerator(fn){return function(){var gen=fn.apply(this,arguments);return new Promise(function(resolve,reject){function step(key,arg){try{var info=gen[key](arg);var value=info.value}catch(error){reject(error);return}if(info.done){resolve(value)}else{return Promise.resolve(value).then(function(value){step('next',value)},function(err){step('throw',err)})}}return step('next')})}} var methods={ 'test-config':require('./commands/testConfig'), 'full-deploy':require('./commands/fullDeploy'), 'kube-images':require('./commands/kubeGetImages'), 'list-images':require('./commands/listAllImages'), 'image-list':require('./commands/listAllImages'), 'kube-status':require('./commands/kubeStatus'), 'kube-rollback':require('./commands/rollbackDeploy'), 'deploy-api':require('./commands/deployApi'), 'deploy-tag':require('./commands/deployTag'), 'deploy-image':require('./commands/deployImage'), 'remove-deployment':require('./commands/removeDeployment'), 'view-logs':require('./commands/view-logs'), 'logs':require('./commands/view-logs'), 'help':require('./commands/help')}; module.exports=function(){var _ref=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(argv){var app,cmd;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0: app=new _appState.AppState(argv);_context.next=3;return( app.init());case 3: cmd=methods[app.args.command];if( cmd){_context.next=6;break}throw( new Error('unknown command: "'+app.args.command+'", use -help for usage.'));case 6:_context.next=8;return( cmd(app));case 8:case'end':return _context.stop();}}},_callee,this)}));function _main(_x){return _ref.apply(this,arguments)}return _main}();