@vroomlabs/gsdk-deploy
Version:
Google Cloud deployment script for kubernetes clusters using Global Load Balancer
28 lines (25 loc) • 4.79 kB
JavaScript
'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.
******************************************************************************/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')})}}
module.exports=function(){var _ref=_asyncToGenerator(/*#__PURE__*/regeneratorRuntime.mark(function _callee(){return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:
process.stdout.write('******************************************************************************\ngsdk-deploy\n******************************************************************************\nUsage:\n gsdk-deploy [command-name] -build=[build-name] (-arg=value ...)\n\nCommands:\n test-config - Light check on configuration \n full-deploy - Normal full deployment, create clusters, networks, etc\n *optional (user/build) -image=[local docker tag name]\n list-images - Display the list of docker tags from related repo \n kube-images - Display the images running in kube for each cluster\n kube-history - Display kube rollout history for each clusters\n kube-status - Display the current rollout status for each cluster\n kube-rollback - Perform a kube rollback for each cluster\n deploy-api - Deploy only the Google Endpoints API configuration\n deploy-tag - Update to a specific docker image tag name in each cluster\n *requires -tag=[docker tag name from repo]\n deploy-image - Update to a specific docker image uri in each cluster\n *requires -image=[full uri and tag]\n remove-deployment - Removes kubernetes deployment and load balancer\n\nArguments:\n -branch - REQUIRED: name of config section from configuration file\n -config - Relative path to a yaml configuration file\n -auth-env - The name of an environment variable with base64 json auth\n -auth-file - Relative path to json authentication file\n -artifacts - Relative path to an existing directory to store artifacts\n -log - Specifies log console level (warn,info,debug,verbose,silly) \n\nEnvironment:\n - Most configuration values can be substituted at runtime via $(NAME)\n - GCLOUD_COMMAND, DOCKER_COMMAND, and KUBECTL_COMMAND will control the \n command-line to these commands.\n for example: export GCLOUD_COMMAND=sudo /opt/gsdk/gcloud\n - AUTO_UPDATE_SDK set to \'true\' to auto-upgrade gcloud sdk\n - The following variables are defined at runtime:\n - BRANCH - value of the -branch= argument\n - ENDPOINT_NAME - value of the endpoints api name\n - ENDPOINT_VERSION - value of the endpoints api version\n - ARTIFACTS - folder for build artifacts and log files\n - BUILD_TIME - full build timestamp in yyyy-MM-ddThh-mm-ss-sssZ\n - SERVICE_NAME - the name of the service from deploy.yaml\n - GCLOUD_PROJECT - the name of the google project from deploy.yaml\n - HOSTNAME - the host value from the deploy.yaml file\n - NODE_PORT - the configured or generated port for the kube service\n******************************************************************************\n');case 1:case'end':return _context.stop();}}},_callee,this)}));function help(){return _ref.apply(this,arguments)}return help}();