GithubHelp home page GithubHelp logo

dhomane / terraform-provider-grafana Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grafana/terraform-provider-grafana

0.0 1.0 0.0 11.81 MB

Terraform Grafana provider

Home Page: https://www.terraform.io/docs/providers/grafana/

License: Mozilla Public License 2.0

Shell 0.10% Go 99.67% Makefile 0.23%

terraform-provider-grafana's Introduction

Terraform Provider for Grafana

Build Status

Requirements

Development

If you're new to provider development, a good place to start is the Extending Terraform docs.

Set up your local environment by installing Go. Also Docker can be used for running tests.

Local Development with Grafana

If you develop the provider and want to test locally with your grafana provider

  1. create a .terraformrc and paste the following
provider_installation {
   dev_overrides {
      "grafana/grafana" = "/path/to/your/grafana/terraform-provider" # this path is the diretory where the binary is built
  }
  # For all other providers, install them directly from their origin provider
  # registries as normal. If you omit this, Terraform will _only_ use
  # the dev_overrides block, and so no other providers will be available.
  direct {}
}
  1. Run go build in this directory to get the binary, Terraform will use the binary you just built (it should print out a warning)

Testing the grafana-api-golang-client Together with the Terraform Provider

As for testing the client, make a branch and open the provider PR with a TODO: to remove the replace operator, because the best way to test the changes you just made in the client is to integrate everything in the provider

  1. create a branch api-client-branchname with your changes
  2. modify the provider go.mod:
  • replace github.com/grafana/grafana-api-golang-client => github.com/grafana/grafana-api-golang-client
  1. run go mod tidy in this directory
  2. pushing allows you to run the provider tests in CI

Running Tests

Acceptance tests require a running instance of Grafana. You can either handle running an instance of Grafana yourself or use docker-compose.

If you choose docker-compose, run make testacc-docker. This is the simplest option, but often not the quickest.

Alternatively you can use the testacc target which will use your local go installation:

# Assuming Grafana was run with:
# docker run --rm -p 3000:3000 grafana/grafana

GRAFANA_URL=http://localhost:3000 \
GRAFANA_AUTH=admin:admin \
make testacc

Running enterprise tests

To run tests for resources which are available only for Grafana Enterprise, running instance of Grafana Enterprise is required. It is only possible to run tests for Grafana Enterprise using local environment.

# Assuming Grafana was run with:
# docker run --rm -p 3000:3000 grafana/grafana

GRAFANA_URL=http://localhost:3000 \
GRAFANA_AUTH=admin:admin \
make testacc-enterprise

Documentation

Documentation is generated with tfplugindocs. Generated files are in docs/ and should not be updated manually. They are derived from:

Use go generate to update generated docs.

Releasing

Builds and releases are automated with GitHub Actions and GoReleaser.

Currently there are a few manual steps to this:

  1. Kick off the release:

    RELEASE_VERSION=v... \
    make release
  2. Publish release:

    The Action creates the release, but leaves it in "draft" state. Open it up in a browser and if all looks well, click the Auto-generate release notes button and mash the publish button.

terraform-provider-grafana's People

Contributors

julienduchesne avatar dependabot[bot] avatar trotttrotttrott avatar jonathan-dorsey avatar mlclmj avatar inkel avatar alexweav avatar grubernaut avatar ievavasiljeva avatar pearkes avatar radeksimko avatar tonglil avatar medains avatar vtorosyan avatar appilon avatar paultyng avatar mdb avatar eleijonmarck avatar konstantinov-innokentii avatar elainevuong avatar apparentlymart avatar yuri-tceretian avatar justintm avatar gw0 avatar mem avatar tombuildsstuff avatar skatsaounis avatar puneeth-n avatar sa-githubcloudtesting avatar erothmayer 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.