Skip to content

Metabase API Client for creating Decidim's dashboards based on static queries

License

Notifications You must be signed in to change notification settings

Quentinchampenois/metabase_automation

 
 

Repository files navigation

Metabase Automation

Metabase Automation is a program written in Ruby and helps to create Metabase models. The aim is to create easily models based on Decidim needs.

Based on the Metabase API, it helps creating Metabase resources based on YAML config files present in ./cards/decidim_cards and a config.yml

Installation

This program is not a dedicated gem, you must run it using the main.rb file. However we'll probably enhance tests and library and then share it.

  1. Ensure file main.rb has the execution rights, if not, add it :
chmod +x main.rb
  1. Install dependencies:
bundle install
  1. Pull the defined submodules
git submodule update --recursive
  1. Move config.yml.example to config.yml and replace placeholders by your configuration.

  2. Don't forget to setup env variables for Metabase connection:

export METABASE_HOST="metabase.example.com" && export METABASE_USERNAME="john@doe.com" && export METABASE_PASSWORD="secretpassword"
# Also possible to put relevant variables in a .env file

You also can use a .env file containing the relevant informations

METABASE_HOST=metabase.example.com
METABASE_USERNAME=john@doe.com
METABASE_PASSWORD=secretpassword

and source it

source .env

Usage

You can easily execute the program with one of these commands :

make
# OR 
make run
# OR
bundle exec main.rb
# OR
ruby main.rb
# OR 
./main.rb

Development

For now Metabase Automation simplify operations for our Data team. Please note that the code is not efficient and potential fails are present. At the moment, it shouldn't causes specific issues on your Metabase server.

Contributing

Contributions are welcome, at the moment it is still in development.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Metabase Automation project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

About

Metabase API Client for creating Decidim's dashboards based on static queries

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Ruby 97.7%
  • Shell 1.4%
  • Makefile 0.9%