Code Monkey home page Code Monkey logo

consul-uploader's Introduction

Consul Uploader CLI

Consul Uploader is a CLI tool used to upload configuration files from a specified directory to the Consul KV store.

Installation

You can download the latest release from the Releases page.

Using the Binary

Download the binary for your platform from the releases page and add it to your PATH.

Example for Linux

wget https://github.com/musanmaz/consul-uploader/releases/download/v1.0.1/consul-uploader-linux-amd64
chmod +x consul-uploader-linux-amd64
sudo mv consul-uploader-linux-amd64 /usr/local/bin/consul-uploader

Example for macOS

wget https://github.com/musanmaz/consul-uploader/releases/download/v1.0.0/consul-uploader-darwin-amd64
chmod +x consul-uploader-darwin-amd64
sudo mv consul-uploader-darwin-amd64 /usr/local/bin/consul-uploader

Example for Windows

Download the binary from the releases page and add it to your PATH.

Usage

You can run the CLI tool using the following command:

consul-uploader --consul-addr=http://localhost:8500 /path/to/config/directory

Installing Dependencies for Local Development

To install the dependencies for the project, run the following commands:

go get github.com/hashicorp/consul/api
go get github.com/spf13/cobra
go mod tidy

Usage for Local Development

You can run the CLI tool using the following command:

go run main.go --consul-addr=http://localhost:8500 /path/to/config/directory

Command Line Arguments

  • --consul-addr : Specifies the address of the Consul server. The default value is http://localhost:8500.

  • /path/to/config/directory : The directory containing the configuration files you want to upload.

Example Usage

go run main.go --consul-addr=http://localhost:8500 test

This command finds the files with the .production extension in the test directory and uploads them to the Consul KV store.

Example Directory Structure

consul-uploader/
├── cmd/
│   └── root.go
├── test/
│   ├── team1/apps/
│   │   ├── project1/
│   │   │   └── .env.production
│   │   ├── project2/
│   │   │   └── appsettings.json.production
│   ├── team2/apps/
│   │   ├── project1/
│   │   │   └── .env.production
│   │   │   └── appsettings.json.production
├── go.mod
├── go.sum
└── main.go
  • cmd/: Contains the CLI command files.

  • test/: Example directory containing the configuration files you want to upload.

  • go.mod: Contains Go module information.

  • go.sum: Contains the verification information for the Go modules.

  • main.go: The entry point of the program.

Bağımlılıklar

consul-uploader's People

Contributors

musanmaz avatar

Watchers

 avatar

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.