Giter Club home page Giter Club logo

terraform-provider-sonarcloud's Introduction

Terraform Provider SonarCloud

A Terraform provider for managing SonarCloud user groups and their permissions.

Requirements

Installing the Provider locally

  1. Clone the repository
  2. Enter the repository directory
  3. Run make install to build the terraform provider and store it in ~/.terraform/plugins.

Note: this uses Goreleaser under the hood. Alternatively you can use go build and move the binary to the correct location yourself.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

Run make test to run all unit tests. This should work without further config and not touch any infrastructure.

Run make testacc to run all acceptance tests. This relies on quite a specific test-organization being available in SonarCloud. The project should have the following 3 groups:

  • Members (Default) - with 2 members
  • Owners (Should be auto-created as well) - with 1 member
  • TEST_DONT_REMOVE - with 0 members (see environment variables below to see how to customize this)

Acceptance tests also rely on the following preconfigured SonarCloud Resources:

  • One test Quality Gate
  • One test Project

Set the following environment variables before running the acceptance test:

Variable Description
SONARCLOUD_ORGANIZATION The name of the org to run tests against.
SONARCLOUD_TOKEN A token with admin permissions for the organization.
SONARCLOUD_TEST_USER_LOGIN The login for testing sonarcloud_user_group_member. Must be an existing member of the org and in the form of <github_handle>@github if you have imported the user via GitHub.
SONARCLOUD_TEST_GROUP_NAME The name of an existing group to which the test-user will be added and removed from.
SONARCLOUD_TOKEN_TEST_USER_LOGIN The login for testing sonarcloud_user_token. This must be the login that also has the existing SONARCLOUD_TOKEN.
SONARCLOUD_PROJECT_KEY The Key of a test project for testing the sonarcloud_quality_gate_selection resource.
SONARCLOUD_QUALITY_GATE_ID The GateId of a test Quality Gate for testing sonarcloud_qualtiy_gate_selection resource.
SONARCLOUD_QUALITY_GATE_NAME The name of a test Quality Gate for testing the sonarcloud_qualtiy_gate data source.

terraform-provider-sonarcloud's People

Contributors

reinoudk avatar dependabot[bot] avatar mdb avatar worming004 avatar arnavbhutanilithia avatar ramshazar avatar bhutania avatar gotreasa 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.