marlowe19 / terraform-provider-commercetools

Terraform provider for commercetools

Home Page:https://commercetools-terraform-provider.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

commercetools Terraform Provider

Build Status codecov Go Report Card Documentation Status

Status

This is the Terraform provider for commercetools. It allows you to configure your commercetools project with infrastructure-as-code principles. The project is still in early development and it doesn't support the complete commercetools API yet but it can be considered 'production' ready for the resource it does support.

Using the provider

This is a third-party provider and that means that terraform cannot download it automatically. Packages of the releases are available at https://github.com/labd/terraform-provider-commercetools/releases See the terraform documentation for more information about installing third-party providers.

Read our documentation and check out the examples.

Contributing

Building the provider

Clone repository to: $GOPATH/src/github.com/labd/terraform-provider-commercetools

$ mkdir -p $GOPATH/src/github.com/labd; cd $GOPATH/src/github.com/labd
$ git clone git@github.com:labd/terraform-provider-commercetools

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/labd/terraform-provider-commercetools
$ make build

To then locally test:

$ cp terraform-provider-commercetools ~/.terraform.d/plugins/darwin_amd64/terraform-provider-commercetools

Releasing

This project uses Goreleaser, see .goreleaser.yml. To release:

git tag <release> -m "Release <release>"
git push --follow-tags
GITHUB_TOKEN=<your github token> gorelease release --rm-dist

Testing

Running the unit tests

$ make test

Running an Acceptance Test

In order to run the full suite of Acceptance tests, run make testacc.

NOTE: Acceptance tests create real resources.

Prior to running the tests provider configuration details such as access keys must be made available as environment variables.

Since we need to be able to create commercetools resources, we need the commercetools API credentials. So in order for the acceptance tests to run correctly please provide all of the following:

export CTP_CLIENT_ID=...
export CTP_CLIENT_SECRET=...
export CTP_PROJECT_KEY=...

For convenience, place a testenv.sh in your local folder (which is included in .gitignore) where you can store these environment variables.

Tests can then be started by running

$ source local/testenv.sh
$ make testacc

Authors

This project is developed by Lab Digital. We welcome additional contributors. Please see our GitHub repository for more information.

About

Terraform provider for commercetools

https://commercetools-terraform-provider.readthedocs.io/

License:Mozilla Public License 2.0


Languages

Language:Go 99.4%Language:Makefile 0.4%Language:Dockerfile 0.2%