GithubHelp home page GithubHelp logo

felixlut / terraform-provider-circleci Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sectorlabs/terraform-provider-circleci

0.0 0.0 0.0 12.86 MB

Terraform provider for CircleCI

License: MIT License

Go 100.00%

terraform-provider-circleci's Introduction

CircleCI Terraform Provider

Terraform provider plugin to manage CircleCI resources using CircleCI API V2.

Maintainers

This provider plugin is maintained by the DevOps team at SectorLabs.

Requirements

  • Terraform 0.12.x
  • Go 1.18+ (to build the provider plugin)

Using the provider

Building the provider

Clone repository to: $GOPATH/src/github.com/SectorLabs/terraform-provider-circleci

$ mkdir -p $GOPATH/src/github.com/SectorLabs; cd $GOPATH/src/github.com/SectorLabs
$ git clone [email protected]:SectorLabs/terraform-provider-circleci.git

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/SectorLabs/terraform-provider-circleci
$ go build -v -o terraform-provider-circleci main.go

Testing the provider

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/SectorLabs/terraform-provider-circleci
$ go test -v ./...

Downloading the provider

Download the latest release to your OS from the release page.

Installing the provider

Move the provider binary (either built or downloaded) to your local Terraform directory

$ mkdir -p ~/.terraform.d/plugins/registry.terraform.io/SectorLabs/circleci/1.0.0/$(go env GOOS)_$(go env GOARCH)
$ mv terraform-provider-circleci ~/.terraform.d/registry.terraform.io/SectorLabs/circleci/1.0.0/$(go env GOOS)_$(go env GOARCH)/terraform-provider-circleci

Replace the 1.0.0 directory name with the version you're currently using.

Resources

terraform {
  required_providers {
    circleci = {
      source  = "SectorLabs/circleci"
      version = "1.0.0"
    }
  }
}

provider "circleci" {
  api_token    = "${file("circleci_token")}"
  vcs_type     = "github"
  organization = "MyOrganization"
}

data "circleci_project" "project" {
  name = "myProject"
}

resource "circleci_environment_variable" "variable" {
  project = data.circleci_project.project.name
  name    = "DUMMY"
  value   = "VALUE"
}

resource "circleci_checkout_key" "key" {
  project = data.circleci_project.project.name
  type    = "deploy-key"
}

resource "circleci_context" "context" {
  name = "myContext"
}

resource "circleci_context_environment_variable" "variable" {
  context = circleci_context.context.name

  name  = "DUMMY"
  value = "VALUE"
}

terraform-provider-circleci's People

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.