2024-12-20 02:18:58 +08:00
### Test A Branch
Instructions for testing DNSControl at a particular PR or branch.
Assumptions:
* `/THE/PATH` -- Change this to the full path to where your dnsconfig.js and other files are located.
* `INSERT_BRANCH_HERE` -- The branch you want to test. The branch associated with a PR is listed on [https://github.com/StackExchange/dnscontrol/branches ](https://github.com/StackExchange/dnscontrol/branches ).
2024-12-20 03:12:56 +08:00
## Using Docker
Using Docker assures you're using the latest version of Go and doesn't require you to install anything on your machine, other than Docker!
```shell
2024-12-20 02:18:58 +08:00
docker run -it -v /THE/PATH:/dns golang
2024-12-20 03:12:56 +08:00
git clone -b INSERT_BRANCH_HERE --single-branch https://github.com/StackExchange/dnscontrol.git
2024-12-20 02:18:58 +08:00
cd dnscontrol
go install
2024-12-20 03:12:56 +08:00
```
2024-12-20 02:18:58 +08:00
2024-12-20 03:12:56 +08:00
```shell
2024-12-20 02:18:58 +08:00
cd /dns
dnscontrol preview
```
If you want to run the integration tests, follow the
2024-12-20 03:12:56 +08:00
[Integration Tests ](integration-tests.md ) document
2024-12-20 02:18:58 +08:00
as usual. The directory to be in is `/go/dnscontrol/integrationTest` .
2024-12-20 03:12:56 +08:00
```shell
2024-12-20 02:18:58 +08:00
cd /go/dnscontrol/integrationTest
go test -v -verbose -provider INSERT_PROVIDER_NAME -start 1 -end 3
```
2024-12-20 03:12:56 +08:00
Change `INSERT_PROVIDER_NAME` to the name of your provider (`BIND`, `ROUTE53` , `GCLOUD` , etc.)
2024-12-20 02:18:58 +08:00
## Not using Docker
Step 1: Install Go
[https://go.dev/dl/ ](https://go.dev/dl/ )
Step 2: Check out the software
2024-12-20 03:12:56 +08:00
```shell
git clone -b INSERT_BRANCH_HERE --single-branch https://github.com/StackExchange/dnscontrol.git
2024-12-20 02:18:58 +08:00
cd dnscontrol
go install
2024-12-20 03:12:56 +08:00
```
2024-12-20 02:18:58 +08:00
2024-12-20 03:12:56 +08:00
```shell
2024-12-20 02:18:58 +08:00
cd /THE/PATH
dnscontrol preview
```
Step 3: Clean up
`go install` put the `dnscontrol` program in your `$HOME/bin` directory. You probably want to remove it.
2024-12-20 03:12:56 +08:00
```shell
rm -i $HOME/bin/dnscontrol
2024-12-20 02:18:58 +08:00
```