Skip to content

Helps pushing property files content to configuration store (e.g. Consul, ZooKeeper, Etcd)

License

Notifications You must be signed in to change notification settings

GarciaPL/ConsulPusher

Repository files navigation

ConsulPusher

This small utility app might help you push content of your property files to configuration store like Consul, ZooKeeper or Etcd.

After cloning this repo, please have a look on file called application.yml which contains all necessary information regarding mode, path to directory which contains property files and consul connection settings like host and port.

Additionally this project contains also file called profiles.json which allows you to define keywords related with profiles. They will be used in case of searching those profiles in absolute path or in property file name and then they will be used to create appropriate directory on Consul side. At this moment this file looks like below, but feel free to add your own profiles based on which are used in your company. PS. This profiles configuration refers only to mode called file. More about this below.

{
  "profiles": [
    {
      "name": "deployment"
    },
    {
      "name": "dev"
    },
    {
      "name": "devH2"
    },
    {
      "name": "performance"
    },
    {
      "name": "qa"
    },
    {
      "name": "staging"
    },
    {
      "name": "production"
    }
  ]
}

Regarding to mode setting, at this point of time application supports two modes or in other words ways of fetching properties files :

  • File - app will detect if profiles defined in profiles.json are part of directory path or file name. In this case app will be able to push content to configuration store for properties stored as below for project_1 and project_2 as well.

Properties

  • Interactive - user will provide via program arguments like profile, key and value using below syntax
Usage
 -p,--profile <arg>   Profile
 -k,--key <arg>       Key
 -v,--value <arg>     Value

Pushing your property on dev instance of Consul use :

java -jar -Dspring.profiles.active=dev consul-pusher-1.0.0-SNAPSHOT.jar -profile dev -key db.driver.class -value org.h2.Driver

Pushing your property on production instance of Consul use :

java -jar -Dspring.profiles.active=prod consul-pusher-1.0.0-SNAPSHOT.jar -profile dev -key db.driver.class -value org.h2.Driver

Technology

Stack

  • Java - 1.8.0_102
  • Spring Boot - 1.4.0.RELEASE

Libraries

Screenshot

Consul

License

Code released under the Apache License 2.0. Docs released under Creative Commons.

References

Moreover I would like to put special greetings for Norbert Potocki who made initial version of this utility app under this link Cfg4j-Pusher. Thanks a million!

Travis CircleCI

Known Vulnerabilities

About

Helps pushing property files content to configuration store (e.g. Consul, ZooKeeper, Etcd)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages