Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

License

NotificationsYou must be signed in to change notification settings

coder/terraform-provider-coder

Terraform provider forCoder.

Developing

Prerequisites

We recommend usingnix to manage your development environment. If you havenix installed, you can runnix develop to enter a shell with all the necessary dependencies.

Alternatively, you can install the dependencies manually.

Building

Follow the instructions outlined in theTerraform documentationto setup your local Terraform to use your local version rather than the registry version.

  1. Create a file named.terraformrc in your$HOME directory

  2. Add the following content:

    provider_installation {# Override the coder/coder provider to use your local versiondev_overrides {"coder/coder" ="/path/to/terraform-provider-coder"     }# 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 {} }
  3. (optional, but recommended) Validate your configuration:

    1. Create a newmain.tf file and include:
    terraform {required_providers {coder={            source="coder/coder"        }    }}
    1. Runterraform init and observe a warning likeWarning: Provider development overrides are in effect
  4. Runmake build to build the provider binary, which Terraform will try locate and execute

  5. All local Terraform runs will now use your local provider!

  6. NOTE: We vendor this provider intogithub.com/coder/coder, so if you're testing with a local clone, make sure to run the following in your local clone ofcoder:

    go mod edit -replace github.com/coder/terraform-provider-coder/v2=/path/to/terraform-provider-codergo mod tidy

    ⚠️ Be sure to include/v2 in the module path as it needs to match the version declared in the provider’sgo.mod.

Terraform Acceptance Tests

To run Terraform acceptance tests, runmake testacc. This will test the provider against the locally installed version of Terraform.

Note

OurCI workflow runs a test matrix against multiple Terraform versions.

Integration Tests

The tests under the./integration directory perform the following steps:

  • Build the local version of the provider,
  • Run an in-memory Coder instance with a specified version,
  • Validate the behaviour of the local provider against that specific version of Coder.

To run these integration tests locally:

  1. Pull the version of the Coder image you wish to test:

      docker pull ghcr.io/coder/coder-preview:main-x.y.z-devel-abcd1234
  2. RunCODER_IMAGE=ghcr.io/coder/coder-preview CODER_VERSION=main-x.y.z-devel-abcd1234 make test-integration.

Note

You can specifyCODER_IMAGE if the Coder image you wish to test is hosted somewhere other thanghcr.io/coder/coder.For example,CODER_IMAGE=example.com/repo/coder CODER_VERSION=foobar make test-integration.

How to create a new release

Warning

Before creating a new release, make sure you have pulled the latest commit from the main branch i.e.git pull origin main

  1. Create a new tag with a version number (following semantic versioning):

    git tag -a v2.1.2 -m "v2.1.2"
  2. Push the tag to the remote repository:

    git push origin tag v2.1.2

A GitHub Actions workflow named "Release" will automatically trigger, run integration tests, and publish the new release.

About

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors33

Languages


[8]ページ先頭

©2009-2025 Movatter.jp