Skip to content

Latest commit

 

History

History
117 lines (73 loc) · 2.69 KB

README.md

File metadata and controls

117 lines (73 loc) · 2.69 KB

Config Properties Extractor

Simple command-line application to get properties from ConfigMaps and Secrets

Features

  • Run without need to install dart (compiled files)
  • Cross platform

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

GIT_REPO_PATH Required. Selected folder or url that contain config files

GIT_BRANCH Optional. By default is the current branch

GIT_SSL_ENABLED Optional. If the SSL verification can be enabled. By default is true

GIT_FORCE_REMOTE Optional. If you need to get the last remote version. By default is false

CONFIG_MAPS_PATH Optional. The subfolder where the configMap files are saved. By default is 'configMap'

SECRETS_PATH Optional. The subfolder where the secret files are saved. By default is 'secret'

MAX_DURATION_IN_MIN Optional. The max duration for fetch get last remote version. By default is 2

Run Locally

Requirements:

Before to run this app requires the following

Steps:

  1. Clone the project
  git clone https://github.com/jsilverdev/config_props_extractor.git
  1. Go to the project directory
  cd config_props_extractor
  1. Create .env from the .env.example
  cp .env.example .env
  1. Define the GIT_REPO_PATH in the .env file
  GIT_REPO_PATH="path/to/config_folder_path"
  1. Install dependencies (if you don´t have dart go to the Run binaries section)
  dart pub get
  1. Start the cli app
  dart run bin/main.dart

Run binaries

You can download the binaries on the releases section.

Or git checkout to a desired tag (for example v1.4.1):

  git checkout tags/v1.4.1

And then run the binary for your platform

  .\run-win.exe
  ./run-macos
  ./run-linux

Running Tests

To run tests, run the following command

  dart test

If you want run tests with coverage, install coverage globally

  dart pub global activate coverage

Then run

  dart pub global run coverage:test_with_coverage --function-coverage --branch-coverage

If you want to see a way to visualize this in a html page, you can use lcov for Linux or Mac. If you are on Windows, you can use jgenhtml and then run

  genhtml -o coverage coverage/lcov.info