Giter Site home page Giter Site logo

rancher.confr-upload's Introduction

rancher.confr-upload

Upload configuration files from a given directory to confr-backend. Directory name is a stack name, subdirectories are services

Install

npm -g i confr-upload

You may create alias

alias cu="confr-upload"

Directory structure example

|-stacks                                
|  |-stackA
|  |  |-service1                       
|  |  |  |-conf.es6                     ConfR configuration template. Can be used for bootstraping haproxy, nginx, rabbitmq.conf and etc
|  |  |  |-arbitrary[@env#version].file Arbitrary file
|  |  |  |-config[@env#version].json    Json-file on a service level. May have @env and #version markers
|  |  |-compose[@environment].yml       Docker compose file for stack with all it services
|  |  |-config.json                     Json-file on a stack level. Will be merged to service-env-version files
|  |-stackB

Usage

$ cu --help

  Usage: confr-upload [options]

  Options:

    -h, --help             output usage information
    -V, --version          output the version number
    -u, --url [url]        Url to confr-backend
    -e, --env [env]        Enviromnent for environment-less files. Comma-separated values
    -d, --dir [dir]        Stack files directory [default: cwd]
    -s, --stack [stack]    Override stack name [default: directory name]
    -f, --filter [filter]  Filter only services
$ pwd
/Users/ndelitski/repo/rancher.confr-directory-tree-example
$ LOG_LEVEL=debug cu -d ./metadata-proxy -e qa,production -u http://user:super-password@localhost:3000
[INFO]   2015-11-28 21:10:16:924   Start upload...
[INFO]   2015-11-28 21:10:16:925   uploading conf.es6
[DEBUG]  2015-11-28 21:10:16:932   started POST localhost:3000/files?stack=metadata-proxy&service=proxy&environment=qa&version=&name=conf.es6
[DEBUG]  2015-11-28 21:10:16:940   started POST localhost:3000/files?stack=metadata-proxy&service=proxy&environment=production&version=&name=conf.es6
[DEBUG]  2015-11-28 21:10:16:959   finished POST localhost:3000/files?stack=metadata-proxy&service=proxy&environment=qa&version=&name=conf.es6 with response:
{"status":"ok"}
[DEBUG]  2015-11-28 21:10:16:983   finished POST localhost:3000/files?stack=metadata-proxy&service=proxy&environment=production&version=&name=conf.es6 with response:
{"status":"ok"}
[INFO]   2015-11-28 21:10:16:984   uploaded /metadata-proxy/proxy/qa/conf.es6
[INFO]   2015-11-28 21:10:16:984   uploaded /metadata-proxy/proxy/production/conf.es6

Short usage

  • define CONFR_BACKEND environment variable in .bash_profile or other shell
  • Environments will be loaded from ~/.rancher file if you are using rancher-cli
  • alias cud="confr-upload -d"
  • cd to root directory

And now:

$ cud your-stack [service] 

rancher.confr-upload's People

Contributors

ndelitski avatar

Watchers

James Cloos avatar  avatar

rancher.confr-upload's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.