All Projects → yoheimuta → Hubot Env

yoheimuta / Hubot Env

Hubot manages environment variables in process.env and redis via commands

Programming Languages

coffeescript
4710 projects

Projects that are alternatives of or similar to Hubot Env

Redis Stream Demo
Demo for Redis Streams
Stars: ✭ 24 (+140%)
Mutual labels:  redis
Re Verb
speaker diarization system using an LSTM
Stars: ✭ 27 (+170%)
Mutual labels:  redis
Weixinmpsdk
微信全平台 SDK Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 6.0。已支持微信公众号、小程序、小游戏、企业号、企业微信、开放平台、微信支付、JSSDK、微信周边等全平台。 WeChat SDK for C#.
Stars: ✭ 7,098 (+70880%)
Mutual labels:  redis
Appcrawler
Android应用市场网络爬虫
Stars: ✭ 25 (+150%)
Mutual labels:  redis
Perfect Redis
A Swift client for Redis.
Stars: ✭ 26 (+160%)
Mutual labels:  redis
Bestnote
👊 持续更新,Java Android 近几年最全面的技术点以及面试题 供自己学习使用
Stars: ✭ 841 (+8310%)
Mutual labels:  redis
Sseredis
Redis Streams and PubSub to Server-Sent Event bridge in Go
Stars: ✭ 23 (+130%)
Mutual labels:  redis
Hubot Wit
💬 A script to use Wit.ai with Hubot.
Stars: ✭ 10 (+0%)
Mutual labels:  hubot
Asynq
Asynq: simple, reliable, and efficient distributed task queue in Go
Stars: ✭ 934 (+9240%)
Mutual labels:  redis
Walrus
Lightweight Python utilities for working with Redis
Stars: ✭ 846 (+8360%)
Mutual labels:  redis
Redis Py Cluster
Python cluster client for the official redis cluster. Redis 3.0+.
Stars: ✭ 934 (+9240%)
Mutual labels:  redis
Twjitm
项目基于idea工作环境搭建的框架,添加mybatis3,spring4,springmvc4,以及redis。主要实现通过注解和反射自定义netty私有协议栈,实现在一条socket通道上传递不同的消息,采用支持tcp,udp和http协议
Stars: ✭ 26 (+160%)
Mutual labels:  redis
Puppet Redis cluster
Install multiple redis instances via Puppet to configure a cluster with redis-trib.rb (for Redis version >= 3.0)
Stars: ✭ 8 (-20%)
Mutual labels:  redis
Blog
my blog, using markdown
Stars: ✭ 25 (+150%)
Mutual labels:  redis
Predis
A flexible and feature-complete Redis client for PHP.
Stars: ✭ 6,966 (+69560%)
Mutual labels:  redis
Fennel
A task queue library for Python and Redis
Stars: ✭ 24 (+140%)
Mutual labels:  redis
Jobqueue Redis
A job queue backend for the Flow framework, based on Redis
Stars: ✭ 7 (-30%)
Mutual labels:  redis
Redisbloom
Probabilistic Datatypes Module for Redis
Stars: ✭ 858 (+8480%)
Mutual labels:  redis
Cpp redis
C++11 Lightweight Redis client: async, thread-safe, no dependency, pipelining, multi-platform - NO LONGER MAINTAINED - Please check https://github.com/cpp-redis/cpp_redis
Stars: ✭ 855 (+8450%)
Mutual labels:  redis
Springbootunity
rabbitmq、redis、scheduled、socket、mongodb、Swagger2、spring data jpa、Thymeleaf、freemarker etc. (muti module spring boot project) (with spring boot framework,different bussiness scence with different technology。)
Stars: ✭ 845 (+8350%)
Mutual labels:  redis

hubot-env

NPM

Hubot manages environment variables dynamically in process.env and redis.

  • load environment variables in process.env.
  • store environment variables in redis.
  • reload environment variables from redis to process.env in restarting hubot.
  • flush all environment variables previously loaded via commands in process.env and redis.

If you use hubot-aws for example, you can switch environment variables about AWS Account Credentials via hubot command dynamically.

Installation

Add hubot-env to your package.json file:

npm install --save hubot-env

Add hubot-env to your external-scripts.json:

["hubot-env"]

Run npm install

Commands

hubot env current - Displays all current environment variables
hubot env current --prefix=[prefix] - Displays current environment variables with prefix
hubot env file - List name of files under HUBOT_ENV_BASE_PATH
hubot env flush all - Flush all current environment variables in process.env and redis
hubot env flush all --dry-run - Try flushing all current environment variables in process.env and redis
hubot env load --filename=[filename] - Loads [filename] of environment variables in process.env and redis
hubot env load --filename=[filename] --dry-run - Try loading [filename] of environment variables in process.env and redis

Configuration

Set environment variables like an example below.

export HUBOT_ENV_BASE_PATH="${HOME}/example"
export HUBOT_ENV_HIDDEN_WORDS="SECRET_ACCESS_KEY,PASSWORD,TOKEN,API_KEY"

You can parepare your own env files by referring to the example files.

Examples

Display current environment variables. You can limit to output with a prefix.

hubot> hubot env current --prefix=HUBOT
HUBOT_GITHUB_TOKEN=***
HUBOT_ENV_HIDDEN_WORDS=SECRET_ACCESS_KEY,PASSWORD,TOKEN,API_KEY
HUBOT_AUTH_ADMIN=ADMIN
HUBOT_ENV_BASE_PATH=files/env
HUBOT_GITHUB_REPO=yoheimuta/hubot-env
HUBOT_CONCURRENT_REQUESTS=20

Display env files under HUBOT_ENV_BASE_PATH. You can select one in this list to load.

hubot> hubot env file
aws-cred-account1.env
aws-cred-account2.env

Load new environment variables abount AWS credentials of account 1.

hubot> hubot env load --filename=aws-cred-account1.env
Loading env --filename=aws-cred-account1.env, --dry-run=false...
HUBOT_AWS_CREDENTIALS=account1
HUBOT_AWS_ACCESS_KEY_ID=ACCESS_KEY1
HUBOT_AWS_SECRET_ACCESS_KEY=***
HUBOT_AWS_REGION=ap-northeast-1

Then, Switch to overwrite environment variables abount AWS credentials of account 2.

hubot> hubot env load --filename=aws-cred-account2.env
Loading env --filename=aws-cred-account2.env, --dry-run=false...
HUBOT_AWS_CREDENTIALS=account2
HUBOT_AWS_ACCESS_KEY_ID=ACCESS_KEY2
HUBOT_AWS_SECRET_ACCESS_KEY=***
HUBOT_AWS_REGION=ap-northeast-1

Reload environment variables when restarting hubot.

$ ./bin/hubot
hubot>
[Sun May 10 2015 16:19:20 GMT+0900 (JST)] INFO Using default redis on localhost:6379
[Sun May 10 2015 16:19:20 GMT+0900 (JST)] INFO Data for hubot brain retrieved from Redis
hubot env bootstrap loaded HUBOT_AWS_CREDENTIALS => account2
hubot env bootstrap loaded HUBOT_AWS_ACCESS_KEY_ID => ACCESS_KEY2
hubot env bootstrap loaded HUBOT_AWS_SECRET_ACCESS_KEY => ***
hubot env bootstrap loaded HUBOT_AWS_REGION => ap-northeast-1

hubot>

Flush all loaded environment variables.

# Dry-run
hubot> hubot env flush all --dry-run
Flushing all --dry-run=true...
Complete dry-run: loadedData={
  HUBOT_AWS_CREDENTIALS: 'account2',
  HUBOT_AWS_ACCESS_KEY_ID: 'ACCESS_KEY2',
  HUBOT_AWS_SECRET_ACCESS_KEY: '***',
  HUBOT_AWS_REGION: 'ap-northeast-1' }

# Flush all
hubot> hubot env flush all
Flushing all --dry-run=false...
Complete flushing all

# Confirm to be flushed data in redis and process.env
hubot> hubot brain show storage --key=_private.hubot-env
null
hubot> hubot env current --prefix=HUBOT
HUBOT_GITHUB_TOKEN=***
HUBOT_ENV_HIDDEN_WORDS=SECRET_ACCESS_KEY,PASSWORD,TOKEN,API_KEY
HUBOT_AUTH_ADMIN=ADMIN
HUBOT_ENV_BASE_PATH=files/env
HUBOT_GITHUB_REPO=yoheimuta/hubot-env
HUBOT_CONCURRENT_REQUESTS=20

Recommended Usage

Use hubot-brain-inspect

hubot-brain-inspect displays data saved in redis with specifying by keys.

hubot> hubot brain show storage --key=_private.hubot-env
{ env:
   { HUBOT_AWS_CREDENTIALS: 'account2',
     HUBOT_AWS_ACCESS_KEY_ID: 'ACCESS_KEY2',
     HUBOT_AWS_SECRET_ACCESS_KEY: '***',
     HUBOT_AWS_REGION: 'ap-northeast-1' } }
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].