2017-06-05 20:54:06 +00:00
Terraform Provider
==================
- Website: https://www.terraform.io
- [![Gitter chat ](https://badges.gitter.im/hashicorp-terraform/Lobby.png )](https://gitter.im/hashicorp-terraform/Lobby)
- Mailing list: [Google Groups ](http://groups.google.com/group/terraform-tool )
2017-08-31 15:04:45 +00:00
< img src = "https://cdn.rawgit.com/hashicorp/terraform-website/master/content/source/assets/images/logo-hashicorp.svg" width = "600px" >
2017-06-05 20:54:06 +00:00
Requirements
------------
- [Terraform ](https://www.terraform.io/downloads.html ) 0.10.x
2019-01-07 22:05:13 +00:00
- [Go ](https://golang.org/doc/install ) 1.11 (to build the provider plugin)
2017-06-05 20:54:06 +00:00
Building The Provider
---------------------
2018-05-02 16:34:45 +00:00
Clone repository to: `$GOPATH/src/github.com/terraform-providers/terraform-provider-digitalocean`
2017-06-05 20:54:06 +00:00
```sh
2017-07-04 19:33:09 +00:00
$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers
2018-05-02 16:34:45 +00:00
$ git clone git@github.com:terraform-providers/terraform-provider-digitalocean
2017-06-05 20:54:06 +00:00
```
Enter the provider directory and build the provider
```sh
2018-05-02 16:34:45 +00:00
$ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-digitalocean
2017-06-05 20:54:06 +00:00
$ make build
```
Using the provider
----------------------
2017-10-17 00:39:00 +00:00
See the [DigitalOcean Provider documentation ](https://www.terraform.io/docs/providers/do/index.html ) to get started using the DigitalOcean provider.
2017-06-05 20:54:06 +00:00
Developing the Provider
---------------------------
2019-03-01 20:52:49 +00:00
If you wish to work on the provider, you'll first need [Go ](http://www.golang.org ) installed on your machine (version 1.11+ is *required* ). You'll also need to correctly setup a [GOPATH ](http://golang.org/doc/code.html#GOPATH ), as well as adding `$GOPATH/bin` to your `$PATH` .
2017-06-05 20:54:06 +00:00
To compile the provider, run `make build` . This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
```sh
2017-08-21 20:34:05 +00:00
$ make build
2017-06-05 20:54:06 +00:00
...
2018-05-02 16:34:45 +00:00
$ $GOPATH/bin/terraform-provider-digitalocean
2017-06-05 20:54:06 +00:00
...
```
In order to test the provider, you can simply run `make test` .
```sh
$ make test
```
2018-04-13 19:29:54 +00:00
In order to run the full suite of acceptance tests, run `make testacc` .
2017-06-05 20:54:06 +00:00
*Note:* Acceptance tests create real resources, and often cost money to run.
```sh
$ make testacc
```
2018-04-13 19:29:54 +00:00
In order to run a specific acceptance test, use the `TESTARGS` environment variable. For example, the following command will run `TestAccDigitalOceanDomain_Basic` acceptance test only:
```sh
$ make testacc TESTARGS='-run=TestAccDigitalOceanDomain_Basic'
```
2019-05-24 18:31:44 +00:00
For information about writing acceptance tests, see the main Terraform [contributing guide ](https://github.com/hashicorp/terraform/blob/master/.github/CONTRIBUTING.md#writing-acceptance-tests ).